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

Extend version.bump() to allow bumping minor|major|patch #449

Closed
hadim opened this issue Dec 19, 2023 · 5 comments
Closed

Extend version.bump() to allow bumping minor|major|patch #449

hadim opened this issue Dec 19, 2023 · 5 comments

Comments

@hadim
Copy link
Contributor

hadim commented Dec 19, 2023

See prefix-dev/pixi#579 (comment) for context.

API could be one of those:

  • version.bump_{minor|major|patch}()
  • version.bump(BumpType::{Major|Minor|Patch|Last})

Any preference?

@hadim
Copy link
Contributor Author

hadim commented Dec 19, 2023

(happy to work on it myself)

@baszalmstra
Copy link
Collaborator

Hey @hadim ! This is not completely trivial. For instance how would you bump: 1a.2b.3c? When you add this I think you need lots of tests. :)

I have no strong preference for either API!

@hadim
Copy link
Contributor Author

hadim commented Dec 19, 2023

Indeed, it is not! But supporting something like 1.1.1 would probably cover already many cases' no? And maybe we can just raise an error for the remaining?

@hadim
Copy link
Contributor Author

hadim commented Dec 19, 2023

I gave it a first try: #452

baszalmstra pushed a commit that referenced this issue Jan 2, 2024
…last` (#452)

See #449 for context.

- [x] add new enum `VersionBumpType`
- [x] refactor `Version.bump()` to `Version.bump(bump_type:
VersionBumpType)`
- [x] add unit tests
- [x] adapt the python binding

This PR is breaking backward compat but since rust does not support
overloading or default args, I could not find a more creative way to
keep backward compat. That being said, it might not be that much of a
problem. If it is, please let me know, and I can always keep `bump()` as
it is and create a new function.

---------

Co-authored-by: Tarun Pratap Singh <[email protected]>
@baszalmstra
Copy link
Collaborator

Closed by #452

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

No branches or pull requests

2 participants