-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintenance week updates #552
Conversation
* Replace setup.cfg with pyproject.toml * Install pre-commit hook and add pre-commit-config.yaml * Update Makefile * Add new linting commands * Add command to install pre-commit hook * Clean up comments and 'help' description * Update dependencies in Pipfile * Remove coverage, flake8, and isort * Add coveralls, pre-commit, ruff
c91895b
to
f3ed426
Compare
Pull Request Test Coverage Report for Build 7479069181
💛 - Coveralls |
af58897
to
312b5ee
Compare
* Add detailed description * Add templates for 'Required' and 'Optional' environment variables * Update 'Development' section to provide more details on testing * Add new section: CLI commands * Update CLI function 'help' descriptions * Use noun phrases for command arguments (excl. date and boolean command args)
312b5ee
to
6cca678
Compare
Why these changes are being introduced: * Streamline logging configuration and environment variable management How this addresses that need: * Create Config class * Clearly identify required vs. optional env vars * Update dependent modules to use Config * Replace os.getenv() calls with Config.<ENV-VAR> * Update unit tests in test_config Side effects of this change: * None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks great! Thanks for this work.
I appreciate that you took the time to investigate the Config
class approach. And, I think it probably would make sense for newer projects (like GeoHarvester) to emulate this approach of putting configure_logger()
and configure_sentry()
as methods on the class.
Also, README looks much better, with lots of helpful information.
I also agree about leaving setup.py
as-is for now, and having a team discussion. As we discussed, definitely pros and cons to having the application installed "globally" in the docker container, or invoked via a virtual environment. I think maybe this was one of the earlier CLI apps, so maybe that explains it's difference here? Either way, even if they aren't all identical, a discussion would be nice.
All in all, looks like a nice freshen up, and able to run locally and via the StepFunction in Dev1 successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, excellent improvements to the documentation!
Purpose and background context
Update apps according to DataEng Application Maintenance document
Learnings/updates worth noting:
Set permission on
cli.py
as not executable: During initial linting with Ruff, the error code EXE002 was thrown for theharvester.cli
. After some investigation (with @ghukill), it turned out thatharvester.cli
was set as an executable (i.e.,chmod +x cli.py
was run at some point). Rather than having Ruff ignore errorEXE002
, I decided to update the permission so that it is no longer executable. Why:Why does the repo have
setup.py
: Discussed this with @ghukill as well! There are some repos that continue to have and usesetup.py
, have but NOT usesetup.py
, or don't havesetup.py
at all. For this repo,setup.py
is used in the second stage of the Dockerfile (lines 4-7) to build the oai-pmh-harvester as a package, which allows us to directly calloai
in theENTRYPOINT
of the Docker container. Decided to leave it as-is for now but would be nice to have a team discussion at some point to figure out how/whether we should standardize this!Encapsulate configuration functions in a class
Update README: I referenced
geo-harvester/README
while making updates!How can a reviewer manually see the effects of these changes?
make lint
to verify repo passes all linters.make test
to verify all unit tests pass.Includes new or updated dependencies?
YES
Changes expectations for external applications?
NO
Developer
Code Reviewer(s)