Add Makefile and refactor package structure

- Replace shell script with Makefile for build/install tasks
- Move main logic into main() function for proper packaging
- Configure package entrypoint in pyproject.toml
This commit is contained in:
2024-10-12 22:40:18 -04:00
parent 4ab46ee2fc
commit b23ca49a83
5 changed files with 140 additions and 116 deletions

25
Makefile Normal file
View File

@@ -0,0 +1,25 @@
.PHONY: default venv build install clean
default: install
venv:
@[ ! -d ./venv ] && python3 -m venv venv && bash -c \
"source venv/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.txt" || true
build: venv
@if [ -n "$$(git status --porcelain)" ]; then \
echo "[ERROR]: There are uncommitted changes or untracked files."; \
exit 1; \
fi
@bash -c \
"source venv/bin/activate && \
pip install build twine && \
python -m build"
install: venv
@bash -c "source venv/bin/activate && pip install -e ."
clean:
rm -rf venv dist tarc.egg-info