✅ Ready to clone and code.
This commit is contained in:
committed by
github-actions[bot]
parent
7dcf36df6d
commit
e4f251f138
20
Makefile
20
Makefile
@@ -26,20 +26,20 @@ install: ## Install the project in dev mode.
|
||||
|
||||
.PHONY: fmt
|
||||
fmt: ## Format code using black & isort.
|
||||
$(ENV_PREFIX)isort project_name/
|
||||
$(ENV_PREFIX)black -l 79 project_name/
|
||||
$(ENV_PREFIX)isort python/
|
||||
$(ENV_PREFIX)black -l 79 python/
|
||||
$(ENV_PREFIX)black -l 79 tests/
|
||||
|
||||
.PHONY: lint
|
||||
lint: ## Run pep8, black, mypy linters.
|
||||
$(ENV_PREFIX)flake8 project_name/
|
||||
$(ENV_PREFIX)black -l 79 --check project_name/
|
||||
$(ENV_PREFIX)flake8 python/
|
||||
$(ENV_PREFIX)black -l 79 --check python/
|
||||
$(ENV_PREFIX)black -l 79 --check tests/
|
||||
$(ENV_PREFIX)mypy --ignore-missing-imports project_name/
|
||||
$(ENV_PREFIX)mypy --ignore-missing-imports python/
|
||||
|
||||
.PHONY: test
|
||||
test: lint ## Run tests and generate coverage report.
|
||||
$(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=project_name -l --tb=short --maxfail=1 tests/
|
||||
$(ENV_PREFIX)pytest -v --cov-config .coveragerc --cov=python -l --tb=short --maxfail=1 tests/
|
||||
$(ENV_PREFIX)coverage xml
|
||||
$(ENV_PREFIX)coverage html
|
||||
|
||||
@@ -78,9 +78,9 @@ virtualenv: ## Create a virtual environment.
|
||||
release: ## Create a new tag for release.
|
||||
@echo "WARNING: This operation will create s version tag and push to github"
|
||||
@read -p "Version? (provide the next x.y.z semver) : " TAG
|
||||
@echo "$${TAG}" > project_name/VERSION
|
||||
@echo "$${TAG}" > python/VERSION
|
||||
@$(ENV_PREFIX)gitchangelog > HISTORY.md
|
||||
@git add project_name/VERSION HISTORY.md
|
||||
@git add python/VERSION HISTORY.md
|
||||
@git commit -m "release: version $${TAG} 🚀"
|
||||
@echo "creating git tag : $${TAG}"
|
||||
@git tag $${TAG}
|
||||
@@ -101,7 +101,7 @@ switch-to-poetry: ## Switch to poetry package manager.
|
||||
@poetry init --no-interaction --name=a_flask_test --author=rochacbruno
|
||||
@echo "" >> pyproject.toml
|
||||
@echo "[tool.poetry.scripts]" >> pyproject.toml
|
||||
@echo "project_name = 'project_name.__main__:main'" >> pyproject.toml
|
||||
@echo "python = 'python.__main__:main'" >> pyproject.toml
|
||||
@cat requirements.txt | while read in; do poetry add --no-interaction "$${in}"; done
|
||||
@cat requirements-test.txt | while read in; do poetry add --no-interaction "$${in}" --dev; done
|
||||
@poetry install --no-interaction
|
||||
@@ -109,7 +109,7 @@ switch-to-poetry: ## Switch to poetry package manager.
|
||||
@mv requirements* .gitea/backup
|
||||
@mv setup.py .gitea/backup
|
||||
@echo "You have switched to https://python-poetry.org/ package manager."
|
||||
@echo "Please run 'poetry shell' or 'poetry run project_name'"
|
||||
@echo "Please run 'poetry shell' or 'poetry run python'"
|
||||
|
||||
.PHONY: init
|
||||
init: ## Initialize the project based on an application template.
|
||||
|
||||
Reference in New Issue
Block a user