mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
poetry
This commit is contained in:
2
.github/actions/setup-project/action.yml
vendored
2
.github/actions/setup-project/action.yml
vendored
@@ -15,4 +15,4 @@ runs:
|
|||||||
python-version: "3.9"
|
python-version: "3.9"
|
||||||
- name: Install pipenv
|
- name: Install pipenv
|
||||||
shell: bash
|
shell: bash
|
||||||
run: pip install --upgrade pipenv
|
run: pip install --upgrade poetry
|
||||||
|
|||||||
16
.github/workflows/checks.yml
vendored
16
.github/workflows/checks.yml
vendored
@@ -43,17 +43,17 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
|
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
|
||||||
- name: Run style checks
|
- name: Run style checks
|
||||||
run: pipenv run flake8 .
|
run: poetry run flake8 .
|
||||||
- name: Check imports alphabetized
|
- name: Check imports alphabetized
|
||||||
run: pipenv run isort --check-only ./app ./tests
|
run: poetry run isort --check-only ./app ./tests
|
||||||
- name: Check for dead code
|
- name: Check for dead code
|
||||||
run: make dead-code
|
run: make dead-code
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
run: pipenv run coverage run --omit=*/notifications_utils/* -m pytest --maxfail=10
|
run: poetry run coverage run --omit=*/notifications_utils/* -m pytest --maxfail=10
|
||||||
env:
|
env:
|
||||||
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
|
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
|
||||||
- name: Check coverage threshold
|
- name: Check coverage threshold
|
||||||
run: pipenv run coverage report --fail-under=50
|
run: poetry run coverage report --fail-under=50
|
||||||
|
|
||||||
validate-new-relic-config:
|
validate-new-relic-config:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -61,14 +61,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/setup-project
|
- uses: ./.github/actions/setup-project
|
||||||
- name: Install pipenv packages
|
- name: Install poetry packages
|
||||||
run: pipenv install --dev
|
run: poetry install --dev
|
||||||
- name: Validate NewRelic config
|
- name: Validate NewRelic config
|
||||||
env:
|
env:
|
||||||
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
|
||||||
# Need to set a NEW_RELIC_ENVIRONMENT with monitor_mode: true
|
# Need to set a NEW_RELIC_ENVIRONMENT with monitor_mode: true
|
||||||
NEW_RELIC_ENVIRONMENT: staging
|
NEW_RELIC_ENVIRONMENT: staging
|
||||||
run: pipenv run newrelic-admin validate-config $NEW_RELIC_CONFIG_FILE
|
run: poetry run newrelic-admin validate-config $NEW_RELIC_CONFIG_FILE
|
||||||
|
|
||||||
pip-audit:
|
pip-audit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/setup-project
|
- uses: ./.github/actions/setup-project
|
||||||
- name: Create requirements.txt
|
- name: Create requirements.txt
|
||||||
run: pipenv requirements > requirements.txt
|
run: poetry export --format=requirements.txt > requirements.txt
|
||||||
- uses: pypa/gh-action-pip-audit@v1.0.6
|
- uses: pypa/gh-action-pip-audit@v1.0.6
|
||||||
with:
|
with:
|
||||||
inputs: requirements.txt
|
inputs: requirements.txt
|
||||||
|
|||||||
2
.github/workflows/daily_checks.yml
vendored
2
.github/workflows/daily_checks.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: ./.github/actions/setup-project
|
- uses: ./.github/actions/setup-project
|
||||||
- name: Create requirements.txt
|
- name: Create requirements.txt
|
||||||
run: pipenv requirements > requirements.txt
|
run: poetry export --format=requirements.txt > requirements.txt
|
||||||
- uses: pypa/gh-action-pip-audit@v1.0.6
|
- uses: pypa/gh-action-pip-audit@v1.0.6
|
||||||
with:
|
with:
|
||||||
inputs: requirements.txt
|
inputs: requirements.txt
|
||||||
|
|||||||
4
.github/workflows/deploy-demo.yml
vendored
4
.github/workflows/deploy-demo.yml
vendored
@@ -45,8 +45,8 @@ jobs:
|
|||||||
- name: Install application dependencies
|
- name: Install application dependencies
|
||||||
run: make bootstrap
|
run: make bootstrap
|
||||||
|
|
||||||
- name: Create requirements.txt because Cloud Foundry does a weird pipenv thing
|
- name: Create requirements.txt
|
||||||
run: pipenv requirements > requirements.txt
|
run: poetry export --format=requirements.txt > requirements.txt
|
||||||
|
|
||||||
- name: Deploy to cloud.gov
|
- name: Deploy to cloud.gov
|
||||||
uses: 18f/cg-deploy-action@main
|
uses: 18f/cg-deploy-action@main
|
||||||
|
|||||||
4
.github/workflows/deploy-prod.yml
vendored
4
.github/workflows/deploy-prod.yml
vendored
@@ -49,8 +49,8 @@ jobs:
|
|||||||
- name: Install application dependencies
|
- name: Install application dependencies
|
||||||
run: make bootstrap
|
run: make bootstrap
|
||||||
|
|
||||||
- name: Create requirements.txt because Cloud Foundry does a weird pipenv thing
|
- name: Create requirements.txt
|
||||||
run: pipenv requirements > requirements.txt
|
run: poetry export --format=requirements.txt > requirements.txt
|
||||||
|
|
||||||
- name: Deploy to cloud.gov
|
- name: Deploy to cloud.gov
|
||||||
uses: 18f/cg-deploy-action@main
|
uses: 18f/cg-deploy-action@main
|
||||||
|
|||||||
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@@ -50,8 +50,8 @@ jobs:
|
|||||||
- name: Install application dependencies
|
- name: Install application dependencies
|
||||||
run: make bootstrap
|
run: make bootstrap
|
||||||
|
|
||||||
- name: Create requirements.txt because Cloud Foundry does a weird pipenv thing
|
- name: Create requirements.txt
|
||||||
run: pipenv requirements > requirements.txt
|
run: poetry export --format=requirements.txt > requirements.txt
|
||||||
|
|
||||||
- name: Deploy to cloud.gov
|
- name: Deploy to cloud.gov
|
||||||
uses: 18f/cg-deploy-action@main
|
uses: 18f/cg-deploy-action@main
|
||||||
|
|||||||
49
Makefile
49
Makefile
@@ -12,9 +12,9 @@ GIT_COMMIT ?= $(shell git rev-parse HEAD)
|
|||||||
.PHONY: bootstrap
|
.PHONY: bootstrap
|
||||||
bootstrap: ## Set up everything to run the app
|
bootstrap: ## Set up everything to run the app
|
||||||
make generate-version-file
|
make generate-version-file
|
||||||
pipenv install --dev
|
poetry install --dev
|
||||||
createdb notification_api || true
|
createdb notification_api || true
|
||||||
(pipenv run flask db upgrade) || true
|
(poetry run flask db upgrade) || true
|
||||||
|
|
||||||
.PHONY: bootstrap-with-docker
|
.PHONY: bootstrap-with-docker
|
||||||
bootstrap-with-docker: ## Build the image to run the app in 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
|
.PHONY: run-procfile
|
||||||
run-procfile:
|
run-procfile:
|
||||||
pipenv run honcho start -f Procfile.dev
|
poetry run honcho start -f Procfile.dev
|
||||||
|
|
||||||
.PHONY: avg-complexity
|
.PHONY: avg-complexity
|
||||||
avg-complexity:
|
avg-complexity:
|
||||||
echo "*** Shows average complexity in radon of all code ***"
|
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
|
.PHONY: too-complex
|
||||||
too-complex:
|
too-complex:
|
||||||
echo "*** Shows code that got a rating of C, D or F in radon ***"
|
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
|
.PHONY: run-flask
|
||||||
run-flask: ## 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
|
.PHONY: run-celery
|
||||||
run-celery: ## Run celery, TODO remove purge for staging/prod
|
run-celery: ## Run celery, TODO remove purge for staging/prod
|
||||||
pipenv run celery -A run_celery.notify_celery purge -f
|
poetry run celery -A run_celery.notify_celery purge -f
|
||||||
pipenv run newrelic-admin run-program celery \
|
poetry run newrelic-admin run-program celery \
|
||||||
-A run_celery.notify_celery worker \
|
-A run_celery.notify_celery worker \
|
||||||
--pidfile="/tmp/celery.pid" \
|
--pidfile="/tmp/celery.pid" \
|
||||||
--loglevel=INFO \
|
--loglevel=INFO \
|
||||||
@@ -50,17 +50,17 @@ run-celery: ## Run celery, TODO remove purge for staging/prod
|
|||||||
|
|
||||||
.PHONY: dead-code
|
.PHONY: dead-code
|
||||||
dead-code:
|
dead-code:
|
||||||
pipenv run vulture ./app --min-confidence=100
|
poetry run vulture ./app --min-confidence=100
|
||||||
|
|
||||||
.PHONY: run-celery-beat
|
.PHONY: run-celery-beat
|
||||||
run-celery-beat: ## Run celery beat
|
run-celery-beat: ## Run celery beat
|
||||||
pipenv run celery \
|
poetry run celery \
|
||||||
-A run_celery.notify_celery beat \
|
-A run_celery.notify_celery beat \
|
||||||
--loglevel=INFO
|
--loglevel=INFO
|
||||||
|
|
||||||
.PHONY: cloudgov-user-report
|
.PHONY: cloudgov-user-report
|
||||||
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
|
.PHONY: help
|
||||||
help:
|
help:
|
||||||
@@ -73,28 +73,29 @@ generate-version-file: ## Generates the app version file
|
|||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: export NEW_RELIC_ENVIRONMENT=test
|
test: export NEW_RELIC_ENVIRONMENT=test
|
||||||
test: ## Run tests and create coverage report
|
test: ## Run tests and create coverage report
|
||||||
pipenv run black .
|
poetry self add poetry-dotenv-plugin
|
||||||
pipenv run flake8 .
|
poetry run black .
|
||||||
pipenv run isort --check-only ./app ./tests
|
poetry run flake8 .
|
||||||
pipenv run coverage run -m pytest -vv --maxfail=10
|
poetry run isort --check-only ./app ./tests
|
||||||
pipenv run coverage report -m --fail-under=95
|
poetry run coverage run -m pytest -vv --maxfail=10
|
||||||
pipenv run coverage html -d .coverage_cache
|
poetry run coverage report -m --fail-under=95
|
||||||
|
poetry run coverage html -d .coverage_cache
|
||||||
|
|
||||||
.PHONY: freeze-requirements
|
.PHONY: freeze-requirements
|
||||||
freeze-requirements: ## Pin all requirements including sub dependencies into requirements.txt
|
freeze-requirements: ## Pin all requirements including sub dependencies into requirements.txt
|
||||||
pipenv lock
|
poetry lock
|
||||||
pipenv requirements
|
poetry requirements
|
||||||
|
|
||||||
.PHONY: audit
|
.PHONY: audit
|
||||||
audit:
|
audit:
|
||||||
pipenv requirements > requirements.txt
|
poetry requirements > requirements.txt
|
||||||
pipenv requirements --dev > requirements_for_test.txt
|
poetry requirements --dev > requirements_for_test.txt
|
||||||
pipenv run pip-audit -r requirements.txt
|
poetry run pip-audit -r requirements.txt
|
||||||
-pipenv run pip-audit -r requirements_for_test.txt
|
-poetry run pip-audit -r requirements_for_test.txt
|
||||||
|
|
||||||
.PHONY: static-scan
|
.PHONY: static-scan
|
||||||
static-scan:
|
static-scan:
|
||||||
pipenv run bandit -r app/
|
poetry run bandit -r app/
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
2825
Pipfile.lock
generated
2825
Pipfile.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -30,13 +30,13 @@ cd /workspace
|
|||||||
git status
|
git status
|
||||||
|
|
||||||
make generate-version-file
|
make generate-version-file
|
||||||
pipenv install --dev
|
poetry install --dev
|
||||||
|
|
||||||
# Install virtualenv to support running the isolated make freeze-requirements from within the devcontainer
|
# Install virtualenv to support running the isolated make freeze-requirements from within the devcontainer
|
||||||
pip3 install virtualenv
|
pip3 install virtualenv
|
||||||
|
|
||||||
# Upgrade schema of the notification_api database
|
# Upgrade schema of the notification_api database
|
||||||
pipenv run flask db upgrade
|
poetry run flask db upgrade
|
||||||
|
|
||||||
# Run flask server
|
# Run flask server
|
||||||
# make run-flask
|
# make run-flask
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ cd /workspace
|
|||||||
git status
|
git status
|
||||||
|
|
||||||
make generate-version-file
|
make generate-version-file
|
||||||
pipenv install --dev
|
poetry install --dev
|
||||||
|
|
||||||
# Install virtualenv to support running the isolated make freeze-requirements from within the devcontainer
|
# Install virtualenv to support running the isolated make freeze-requirements from within the devcontainer
|
||||||
pip3 install virtualenv
|
pip3 install virtualenv
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ Within GitHub Actions, several scans take place every day to ensure security and
|
|||||||
|
|
||||||
If you're checking out the system locally, you may want to create a user quickly.
|
If you're checking out the system locally, you may want to create a user quickly.
|
||||||
|
|
||||||
`pipenv run flask command create-test-user`
|
`poetry run flask command create-test-user`
|
||||||
|
|
||||||
This will run an interactive prompt to create a user, and then mark that user as active. *Use a real mobile number* if you want to log in, as the SMS auth code will be sent here.
|
This will run an interactive prompt to create a user, and then mark that user as active. *Use a real mobile number* if you want to log in, as the SMS auth code will be sent here.
|
||||||
|
|
||||||
@@ -797,7 +797,7 @@ US_Notify Administrators are responsible for ensuring that remediations for vuln
|
|||||||
|
|
||||||
U.S. Notify DNS records are maintained within [the 18f/dns repository](https://github.com/18F/dns/blob/main/terraform/notify.gov.tf). To create new DNS records for notify.gov or any subdomains:
|
U.S. Notify DNS records are maintained within [the 18f/dns repository](https://github.com/18F/dns/blob/main/terraform/notify.gov.tf). To create new DNS records for notify.gov or any subdomains:
|
||||||
|
|
||||||
1. Update the `notify.gov.tf` terraform to update or create the new records within Route53 and push the branch to the 18f/dns repository.
|
1. Update the `notify.gov.tf` terraform to update oƒr create the new records within Route53 and push the branch to the 18f/dns repository.
|
||||||
1. Open a PR.
|
1. Open a PR.
|
||||||
1. Verify that the plan output within circleci creates the records that you expect.
|
1. Verify that the plan output within circleci creates the records that you expect.
|
||||||
1. Request a PR review from the 18F/tts-tech-portfolio team
|
1. Request a PR review from the 18F/tts-tech-portfolio team
|
||||||
|
|||||||
4254
poetry.lock
generated
Normal file
4254
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,13 @@
|
|||||||
[[source]]
|
[tool.poetry]
|
||||||
url = "https://pypi.org/simple"
|
name = "notifications-api"
|
||||||
verify_ssl = true
|
version = "0.1.0"
|
||||||
name = "pypi"
|
description = "Notify.gov backend"
|
||||||
|
authors = ["Your Name <you@example.com>"]
|
||||||
|
readme = "README.md"
|
||||||
|
packages = [{include = "notifications_api"}]
|
||||||
|
|
||||||
[packages]
|
[tool.poetry.dependencies]
|
||||||
|
python = "^3.9"
|
||||||
alembic = "==1.11.2"
|
alembic = "==1.11.2"
|
||||||
amqp = "==5.1.1"
|
amqp = "==5.1.1"
|
||||||
arrow = "==1.2.3"
|
arrow = "==1.2.3"
|
||||||
@@ -45,12 +49,14 @@ flask-sqlalchemy = "==3.0.5"
|
|||||||
gunicorn = {version = "==21.2.0", extras = ["eventlet"]}
|
gunicorn = {version = "==21.2.0", extras = ["eventlet"]}
|
||||||
iso8601 = "==2.0.0"
|
iso8601 = "==2.0.0"
|
||||||
itsdangerous = "==2.1.2"
|
itsdangerous = "==2.1.2"
|
||||||
jsonschema = {version = "==4.19.0", extras = ["format"]}
|
jsonschema = {version = "==4.17.0", extras = ["format"]}
|
||||||
lxml = "==4.9.3"
|
lxml = "==4.9.3"
|
||||||
marshmallow = "==3.20.1"
|
marshmallow = "==3.20.1"
|
||||||
marshmallow-sqlalchemy = "==0.29.0"
|
marshmallow-sqlalchemy = "==0.29.0"
|
||||||
notifications-python-client = "==6.3.0"
|
notifications-python-client = "==6.3.0"
|
||||||
oscrypto = "==1.3.0"
|
oscrypto = "==1.3.0"
|
||||||
|
poetry = "==1.6.1"
|
||||||
|
poetry-dotenv-plugin = "==0.2.0"
|
||||||
psycopg2-binary = "==2.9.3"
|
psycopg2-binary = "==2.9.3"
|
||||||
pyjwt = "==2.8.0"
|
pyjwt = "==2.8.0"
|
||||||
python-dotenv = "==1.0.0"
|
python-dotenv = "==1.0.0"
|
||||||
@@ -58,12 +64,12 @@ radon = "==6.0.1"
|
|||||||
sqlalchemy = "==1.4.40"
|
sqlalchemy = "==1.4.40"
|
||||||
werkzeug = "~=2.3"
|
werkzeug = "~=2.3"
|
||||||
vulture = "==2.8"
|
vulture = "==2.8"
|
||||||
|
|
||||||
packaging = "==23.1"
|
packaging = "==23.1"
|
||||||
notifications-utils = {editable = true, ref = "main", git = "https://github.com/GSA/notifications-utils.git"}
|
notifications-utils = {git = "https://github.com/GSA/notifications-utils.git", develop = true, rev = "main"}
|
||||||
newrelic = "*"
|
newrelic = "*"
|
||||||
|
|
||||||
[dev-packages]
|
|
||||||
|
[tool.poetry.group.dev.dependencies]
|
||||||
exceptiongroup = "==1.1.2"
|
exceptiongroup = "==1.1.2"
|
||||||
flake8 = "==4.0.1"
|
flake8 = "==4.0.1"
|
||||||
flake8-bugbear = "==23.3.12"
|
flake8-bugbear = "==23.3.12"
|
||||||
@@ -82,5 +88,6 @@ bandit = "*"
|
|||||||
honcho = "*"
|
honcho = "*"
|
||||||
cloudfoundry-client = "*"
|
cloudfoundry-client = "*"
|
||||||
|
|
||||||
[requires]
|
[build-system]
|
||||||
python_version = "3.9"
|
requires = ["poetry-core"]
|
||||||
|
build-backend = "poetry.core.masonry.api"
|
||||||
Reference in New Issue
Block a user