Files
thechart/Makefile
William Valentin c20c4478a6 feat: Add coverage, iniconfig, pluggy, pygments, pytest, pytest-cov, and pytest-mock as dependencies
- Added coverage version 7.10.1 with multiple wheel distributions.
- Added iniconfig version 2.1.0 with its wheel distribution.
- Added pluggy version 1.6.0 with its wheel distribution.
- Added pygments version 2.19.2 with its wheel distribution.
- Added pytest version 8.4.1 with its wheel distribution and dependencies.
- Added pytest-cov version 6.2.1 with its wheel distribution and dependencies.
- Added pytest-mock version 3.14.1 with its wheel distribution and dependencies.
- Updated dev-dependencies to include coverage, pytest, pytest-cov, and pytest-mock.
- Updated requires-dist to specify minimum versions for coverage, pytest, pytest-cov, and pytest-mock.
2025-07-28 17:53:19 -07:00

67 lines
3.1 KiB
Makefile

TARGET=thechart
VERSION=1.0.0
ROOT=/home/will
ICON=chart-671.png
SHELL=fish
help: ## Show this help
@grep -E -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
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 --no-root
poetry run pre-commit install --install-hooks --overwrite
poetry run pre-commit autoupdate
poetry run pre-commit run --all-files
build: ## Build the Docker image
@echo "Building 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
cp -f ./thechart_data.csv ${ROOT}/Documents/
cp -f ./dist/${TARGET} ${ROOT}/Applications/
cp -f ./deploy/${TARGET}.desktop ${ROOT}/.local/share/applications/
desktop-file-validate ${ROOT}/.local/share/applications/${TARGET}.desktop
run: ## Run the application
@echo "Running the application..."
python src/main.py
start: ## Start the application
@echo "Starting the application..."
docker-compose up -d --build
stop: ## Stop the application
@echo "Stopping the application..."
docker-compose down
test: ## Run the tests
@echo "Running the tests..."
.venv/bin/python -m pytest tests/ -v --cov=src --cov-report=term-missing --cov-report=html:htmlcov
test-unit: ## Run unit tests only
@echo "Running unit tests..."
.venv/bin/python -m pytest tests/ -v --tb=short
test-coverage: ## Run tests with detailed coverage report
@echo "Running tests with coverage..."
.venv/bin/python -m pytest tests/ --cov=src --cov-report=html:htmlcov --cov-report=xml --cov-report=term-missing
test-watch: ## Run tests in watch mode
@echo "Running tests in watch mode..."
.venv/bin/python -m pytest-watch tests/ -- -v --cov=src
test-debug: ## Run tests with debug output
@echo "Running tests with debug output..."
.venv/bin/python -m pytest tests/ -v -s --tb=long --cov=src
lint: ## Run the linter
@echo "Running the linter..."
docker-compose exec ${TARGET} pipenv run pre-commit run --all-files
format: ## Format the code
@echo "Formatting the code..."
docker-compose exec ${TARGET} pipenv run pre-commit run --all-files --show-diff
attach: ## Open a shell in the container
@echo "Opening 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..."
source ./.venv/bin/activate.${SHELL} && /bin/${SHELL}
requirements: ## Export the requirements to a file
@echo "Exporting requirements to requirements.txt..."
poetry export --without-hashes -f requirements.txt -o requirements.txt
.PHONY: install build attach deploy run start stop test lint format shell requirements help