mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 09:27:56 -04:00
poetry
This commit is contained in:
49
Makefile
49
Makefile
@@ -12,9 +12,9 @@ GIT_COMMIT ?= $(shell git rev-parse HEAD)
|
||||
.PHONY: bootstrap
|
||||
bootstrap: ## Set up everything to run the app
|
||||
make generate-version-file
|
||||
pipenv install --dev
|
||||
poetry install --dev
|
||||
createdb notification_api || true
|
||||
(pipenv run flask db upgrade) || true
|
||||
(poetry run flask db upgrade) || true
|
||||
|
||||
.PHONY: bootstrap-with-docker
|
||||
bootstrap-with-docker: ## Build the image to run the app in Docker
|
||||
@@ -22,26 +22,26 @@ bootstrap-with-docker: ## Build the image to run the app in Docker
|
||||
|
||||
.PHONY: run-procfile
|
||||
run-procfile:
|
||||
pipenv run honcho start -f Procfile.dev
|
||||
poetry run honcho start -f Procfile.dev
|
||||
|
||||
.PHONY: avg-complexity
|
||||
avg-complexity:
|
||||
echo "*** Shows average complexity in radon of all code ***"
|
||||
pipenv run radon cc ./app -a -na
|
||||
poetry run radon cc ./app -a -na
|
||||
|
||||
.PHONY: too-complex
|
||||
too-complex:
|
||||
echo "*** Shows code that got a rating of C, D or F in radon ***"
|
||||
pipenv run radon cc ./app -a -nc
|
||||
poetry run radon cc ./app -a -nc
|
||||
|
||||
.PHONY: run-flask
|
||||
run-flask: ## Run flask
|
||||
pipenv run newrelic-admin run-program flask run -p 6011 --host=0.0.0.0
|
||||
poetry run newrelic-admin run-program flask run -p 6011 --host=0.0.0.0
|
||||
|
||||
.PHONY: run-celery
|
||||
run-celery: ## Run celery, TODO remove purge for staging/prod
|
||||
pipenv run celery -A run_celery.notify_celery purge -f
|
||||
pipenv run newrelic-admin run-program celery \
|
||||
poetry run celery -A run_celery.notify_celery purge -f
|
||||
poetry run newrelic-admin run-program celery \
|
||||
-A run_celery.notify_celery worker \
|
||||
--pidfile="/tmp/celery.pid" \
|
||||
--loglevel=INFO \
|
||||
@@ -50,17 +50,17 @@ run-celery: ## Run celery, TODO remove purge for staging/prod
|
||||
|
||||
.PHONY: dead-code
|
||||
dead-code:
|
||||
pipenv run vulture ./app --min-confidence=100
|
||||
poetry run vulture ./app --min-confidence=100
|
||||
|
||||
.PHONY: run-celery-beat
|
||||
run-celery-beat: ## Run celery beat
|
||||
pipenv run celery \
|
||||
poetry run celery \
|
||||
-A run_celery.notify_celery beat \
|
||||
--loglevel=INFO
|
||||
|
||||
.PHONY: cloudgov-user-report
|
||||
cloudgov-user-report:
|
||||
@pipenv run python -m terraform.ops.cloudgov_user_report
|
||||
@poetry run python -m terraform.ops.cloudgov_user_report
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@@ -73,28 +73,29 @@ generate-version-file: ## Generates the app version file
|
||||
.PHONY: test
|
||||
test: export NEW_RELIC_ENVIRONMENT=test
|
||||
test: ## Run tests and create coverage report
|
||||
pipenv run black .
|
||||
pipenv run flake8 .
|
||||
pipenv run isort --check-only ./app ./tests
|
||||
pipenv run coverage run -m pytest -vv --maxfail=10
|
||||
pipenv run coverage report -m --fail-under=95
|
||||
pipenv run coverage html -d .coverage_cache
|
||||
poetry self add poetry-dotenv-plugin
|
||||
poetry run black .
|
||||
poetry run flake8 .
|
||||
poetry run isort --check-only ./app ./tests
|
||||
poetry run coverage run -m pytest -vv --maxfail=10
|
||||
poetry run coverage report -m --fail-under=95
|
||||
poetry run coverage html -d .coverage_cache
|
||||
|
||||
.PHONY: freeze-requirements
|
||||
freeze-requirements: ## Pin all requirements including sub dependencies into requirements.txt
|
||||
pipenv lock
|
||||
pipenv requirements
|
||||
poetry lock
|
||||
poetry requirements
|
||||
|
||||
.PHONY: audit
|
||||
audit:
|
||||
pipenv requirements > requirements.txt
|
||||
pipenv requirements --dev > requirements_for_test.txt
|
||||
pipenv run pip-audit -r requirements.txt
|
||||
-pipenv run pip-audit -r requirements_for_test.txt
|
||||
poetry requirements > requirements.txt
|
||||
poetry requirements --dev > requirements_for_test.txt
|
||||
poetry run pip-audit -r requirements.txt
|
||||
-poetry run pip-audit -r requirements_for_test.txt
|
||||
|
||||
.PHONY: static-scan
|
||||
static-scan:
|
||||
pipenv run bandit -r app/
|
||||
poetry run bandit -r app/
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
||||
Reference in New Issue
Block a user