-
Notifications
You must be signed in to change notification settings - Fork 22
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
incremental CLI script #113
Conversation
The `incremental update` command replaces `python -m incremental.update`. It otherwise has the same behavior. I also switched off of Click because, though it is nicer than argparse, it complicates the UX to have to install `incremental[scripts]` to get a working CLI.
@@ -71,7 +71,7 @@ def test_create(self): | |||
""" | |||
|
|||
# This file is auto-generated! Do not edit! | |||
# Use `python -m incremental.update inctestpkg` to change this file. | |||
# Use `incremental` to change this file. |
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 dropped the package name here because I plan to make it optional in #111 and didn't want to ask someone to review all these test cases twice.
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.
Thanks. Changes looks good.
Removing the click
dependency makes sense.
I only did a quick code review, without running any manual tests.
|
||
If you don't expose this object publicly, nor make use of it within your package, |
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.
Just asking ?
If you don't make use of incremental
inside your package, what's the point of using incremental
?
I find that incremental
is usefull to track NEXT
version to make it easy to do relase candidates and autoamtically have the version updated in your codebase.
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.
You have it exactly right — in 2024 Incremental's value is:
- Managing CalVer versions
- Updating indeterminate versions within the codebase
I view the runtime API (incremental.Version
) as a legacy feature. There's no need to remove or deprecate it (it's part of the public API of a bunch of Twisted packages, that would just cause churn) but I don't want to advise new users adopt it as a matter of course. importlib.metadata
is a better solution.
Here I'm trying to rework the docs to emphasize the new way.
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 don't think there's anything wrong with not caring about Version
, but does importlib.metadata
even provide a version object somewhere? It looks like it just returns strings.
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 this is a closer analogue: https://packaging.pypa.io/en/stable/version.html#packaging.version.Version.__init__
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.
Yeah, importlib.metadata
is just strings AFAIK. There are use cases that only need strings, though, like displaying the versions of everything installed, so I think that's a reasonable way to scope it. If you want a Version
of whatever flavor it's easy enough to parse the string.
Thank you for the review @adiroiban! (FTR I changed the branch protection rules to not require resolution of each comment, since I think that collapsing discussions like the one above is not useful.) |
The
incremental update
command replacespython -m incremental.update
. It otherwise has the same behavior. I made it a subcommand to allow for future extraction ofincremental create
(and maybe anincremental tag
? 🤔).I also switched off of Click because, though it is nicer than argparse, it complicates the UX to have to install
incremental[scripts]
to get a working CLI.