Refactor Makefile to improve environment setup; change poetry install command to use --no-root and fix formatting for consistency.

This commit is contained in:
William Valentin
2025-07-25 10:30:38 -07:00
parent 4d11f28cad
commit 3875e0956f

View File

@@ -7,8 +7,9 @@ help: ## Show this help
install: ## Set up the development environment
@echo "Setting up the development environment..."
# poetry env use 3.13
# eval $(poetry env use 3.13) # bash/zsh/csh
eval (poetry env activate)
poetry install
poetry install --no-root
poetry run pre-commit install --install-hooks --overwrite
poetry run pre-commit autoupdate
poetry run pre-commit run --all-files
@@ -17,7 +18,7 @@ build: ## Build the Docker image
docker buildx build --platform linux/amd64,linux/arm64 -t ${IMAGE} --push .
deploy: ## Deploy the application as a standalone executable
@echo "Deploying the application..."
pyinstaller --name ${TARGET} --optimize 2 --onefile --windowed --hidden-import='PIL._tkinter_finder' --icon='${ICON}' --add-data=".env:." --add-data='./chart-671.png:.' --add-data='./thechart_data.csv:.' src/main.py
pyinstaller --name ${TARGET} --optimize 2 --onefile --windowed --hidden-import='PIL._tkinter_finder' --icon='${ICON}' --add-data="./.env:." --add-data='./chart-671.png:.' --add-data='./thechart_data.csv:.' src/main.py
cp -f ./thechart_data.csv ${ROOT}/Documents/
cp -f ./dist/${TARGET} ${ROOT}/Applications/
cp -f ./deploy/${TARGET}.desktop ${ROOT}/.local/share/applications/
@@ -45,7 +46,7 @@ attach: ## Open a shell in the container
docker-compose exec -it ${TARGET} /bin/bash
shell: ## Open a shell in the local environment
@echo "Opening a shell in the local environment..."
poetry eval (poetry env activate)
eval (poetry env activate)
requirements: ## Export the requirements to a file
@echo "Exporting requirements to requirements.txt..."
poetry export --without-hashes -f requirements.txt -o requirements.txt