HHS / OPRE-OPS

ACF's OPRE OPS product. Code name Unicorn.
Other
12 stars 3 forks source link

Reminder: Adopt the HyperModern Python Architecture & Tooling #369

Open tdonaworth opened 2 years ago

tdonaworth commented 2 years ago

We need to fold these items into user stories:


Tasks

Additional Context & Resources

The gist of it is HyperModern Python. Open to simply rebasing the project from one of the cookiecutter projects

xlorepdarkhelm commented 1 year ago

Something to note:

The current process we use with nox and precommit puts things like black, mypy, & flake8 (etc) in the nox world. However the HyperModern Python process has those in the precommit. And, has it that when precommit runs, it validates with, let's say, black. Black makes changes, and it kicks back the attempted commit. Re-running the commit then automatically has the newly formatted code and black won't reject it then. And, on commit, you then would need to fix linting errors beforehand.

Currently, it requires an extra step of running nox. Which means the developer has 1 extra thing to remember. Not a huge deal, but when there's a lot of little steps to remember for things (like manually using the docker-compose.e2e.yml when running e2e tests), it can be easy to forget, which can slow down the process of getting a PR ready for review.

I would propose that nox be left for testing, and all linting/code formatting/etc be put into the precommit hooks instead. The template of this exists in the HyperModern Python Cookiecutter. Uses the same tools we basically are now, just organizes it a bit differently.