-
Notifications
You must be signed in to change notification settings - Fork 14
Load argument defaults from .githubactivity.json
#93
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
Conversation
To distinguish between default args and CLI args being set to the default value all argparse defaults are set to None, with the actual defaults being set separately
.githubactivity.json file
github_activity/cli.py
Outdated
| The args object is modified in place. | ||
| """ | ||
| try: | ||
| with open("pyproject.toml", "rb") as f: |
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.
This requires being in the root folder, ideally the UX would be to find the relevant pyproject.toml within the local git repo, possibly inside some parent folder or similar.
Im not sure how other tools reading pyproject.toml config does this, black etc - this is a acceptable initial state of things but i can imagine hickups by assuming this works but running it from docs/ or similar if we start relying on it. Ideally there is a common way to get the git repo local pyproject.toml of relevance to read we can re-use from other tools, but we can proceed with this as well - not a blocker!
consideRatio
left a comment
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.
Nice!!! A comment about a possible improvement we don't have to go for - ok to merge!
This project is written in Python, but it can be used with any GitHub repo, so shouldn't rely on pyproject.toml
.githubactivity.json
|
I've switched to using |
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.
Nice!! Time to merge?
|
@consideRatio I think so! |
In most JupyterHub repos we use different defaults, e.g. we using heading-level 3: https://jupyterhub-team-compass.readthedocs.io/en/latest/practices/releases.html
It's normal for people to forget to pass
--heading-level=3when runninggithub-activity.This PR allows some config to be read from a
.githubactivity.jsonfile in the top-level of the Git clone, minimising the number of arguments that are needed. In future this could also make it easier to customise the labels or categories used instead of github-activity having to cater for everyone. Since--sincealready defaults to the most recent tag this potentially means no arguments would be needed when running github-activity in most cases.To distinguish between default argparse arguments and CLI flags being explicitly set to the default value all argparse defaults are now set to None, with the actual defaults being set in
load_config_and_defaults