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:
25
Makefile
Normal file
25
Makefile
Normal 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
|
Reference in New Issue
Block a user