Skip to content

Commit

Permalink
Maintenance week updates (#95)
Browse files Browse the repository at this point in the history
* Update dependencies and Makefile

* Update config files

* Add .pre-commit-config.yaml and pyproject.toml
* Remove setup.cfg

* Linting updates

* Various changes requested by the linters
* Remove outdated linter ignores
* Reorder functions in patron.py for more logical flow
* Remove unnecessary code from email.py

* Add app description to README.md

* Update pull-request-template.md
  • Loading branch information
ehanson8 committed Mar 7, 2024
1 parent 3bdfb3d commit 2f6c569
Show file tree
Hide file tree
Showing 20 changed files with 1,317 additions and 1,281 deletions.
35 changes: 13 additions & 22 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
### What does this PR do?

Describe the overall purpose of the PR changes. Doesn't need to be as specific as the
individual commits.

### Helpful background context

Describe any additional context beyond what the PR accomplishes if it is likely to be
useful to a reviewer.

Delete this section if it isn't applicable to the PR.
### Purpose and background context
Describe the overall purpose of the PR changes and any useful background context.

### How can a reviewer manually see the effects of these changes?

Explain how to see the proposed changes in the application if possible.

Delete this section if it isn't applicable to the PR.

### Includes new or updated dependencies?
YES | NO

### Changes expectations for external applications?
YES | NO

### What are the relevant tickets?

Include links to Jira Software and/or Jira Service Management tickets here.
- Include links to Jira Software and/or Jira Service Management tickets here.

### Developer

- [ ] All new ENV is documented in README (or there is none)
- [ ] All new ENV is documented in README
- [ ] All new ENV has been added to staging and production environments
- [ ] All related Jira tickets are linked in commit message(s)
- [ ] Stakeholder approval has been confirmed (or is not needed)

### Code Reviewer

- [ ] The commit message is clear and follows our guidelines
(not just this pull request message)
### Code Reviewer(s)
- [ ] The commit message is clear and follows our guidelines (not just this PR message)
- [ ] There are appropriate tests covering any new functionality
- [ ] The documentation has been updated or is unnecessary
- [ ] The changes have been verified
- [ ] The provided documentation is sufficient for understanding any new functionality introduced
- [ ] Any manual tests have been performed and verified
- [ ] New dependencies are appropriate or there were no changes

29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
default_language_version:
python: python3.11 # set for project python version
repos:
- repo: local
hooks:
- id: black-apply
name: black-apply
entry: pipenv run black
language: system
pass_filenames: true
types: ["python"]
- id: mypy
name: mypy
entry: pipenv run mypy
language: system
pass_filenames: true
types: ["python"]
exclude: "tests/"
- id: ruff-apply
name: ruff-apply
entry: pipenv run ruff check --fix
language: system
pass_filenames: true
types: ["python"]
- id: safety
name: safety
entry: pipenv check
language: system
pass_filenames: false
28 changes: 19 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
S3_BUCKET:=shared-files-$(shell aws sts get-caller-identity --query "Account" --output text)
ORACLE_ZIP:=instantclient-basiclite-linux.x64-21.9.0.0.0dbru.zip

help: ## Print this message
@awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \
/^[-_[:alpha:]]+:.?*##/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)

### Dependency commands ###

install: ## Install dependencies and CLI app
pipenv install --dev
pipenv run pre-commit install

update: install ## Update all Python dependencies
pipenv clean
Expand All @@ -31,26 +36,31 @@ test: ## Run tests and print a coverage report
coveralls: test
pipenv run coverage lcov -o ./coverage/lcov.info

### Code quality and safety commands ###

lint: bandit black mypy pylama safety ## Run linting, code quality, and safety checks

bandit:
pipenv run bandit -r patronload
# linting commands
lint: black mypy ruff safety

black:
pipenv run black --check --diff .

mypy:
pipenv run mypy patronload
pipenv run mypy .

pylama:
pipenv run pylama --options setup.cfg
ruff:
pipenv run ruff check .

safety:
pipenv check
pipenv verify

# apply changes to resolve any linting errors
lint-apply: black-apply ruff-apply

black-apply:
pipenv run black .

ruff-apply:
pipenv run ruff check --fix .


### Terraform-generated Developer Deploy Commands for Dev environment ###
dist-dev: ## Build docker container (intended for developer-based manual build)
Expand Down
21 changes: 11 additions & 10 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ verify_ssl = true
name = "pypi"

[packages]
click = "*"
sentry-sdk = "*"
oracledb = "*"
boto3 = "*"
boto3-stubs = {extras = ["essential"], version = "*"}
bs4 = "*"
click = "*"
lxml = "*"
oracledb = "*"
python-dateutil = "*"
boto3 = "*"
boto3-stubs = {extras = ["essential"], version = "*"}
sentry-sdk = "*"

[dev-packages]
bandit = "*"
black = "*"
coverage = "*"
coveralls = "*"
freezegun = "*"
moto = {extras = ["s3", "ses"], version = "*"}
mypy = "*"
pylama = {extras = ["all"], version = "*"}
pre-commit = "*"
pytest = "*"
freezegun = "*"
types-python-dateutil = "*"
ruff = "*"
safety = "*"
types-beautifulsoup4 = "*"
moto = {extras = ["s3", "ses"], version = "*"}
types-python-dateutil = "*"

[requires]
python_version = "3.11"
Expand Down
Loading

0 comments on commit 2f6c569

Please sign in to comment.