Skip to content
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

Merged
merged 1 commit into from
Aug 12, 2024
Merged

incremental CLI script #113

merged 1 commit into from
Aug 12, 2024

Conversation

twm
Copy link
Contributor

@twm twm commented Aug 11, 2024

The incremental update command replaces python -m incremental.update. It otherwise has the same behavior. I made it a subcommand to allow for future extraction of incremental create (and maybe an incremental 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.

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.
Copy link
Contributor Author

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.

@twm twm requested a review from a team August 11, 2024 05:34
Copy link
Member

@adiroiban adiroiban left a 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,
Copy link
Member

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.

Copy link
Contributor Author

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:

  1. Managing CalVer versions
  2. 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.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.

@twm
Copy link
Contributor Author

twm commented Aug 12, 2024

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.)

@twm twm merged commit 1b600cd into trunk Aug 12, 2024
8 checks passed
@twm twm deleted the 99-cli branch August 12, 2024 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants