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

Support hatch version --force #1645

Merged
merged 7 commits into from
Aug 17, 2024
Merged

Support hatch version --force #1645

merged 7 commits into from
Aug 17, 2024

Conversation

warsaw
Copy link
Contributor

@warsaw warsaw commented Jul 27, 2024

When downgrading with an explicit version number, normally hatch will raise an error. While validate-bump can be provided in the config file, it's useful to be able to override this check on the command line. This PR implements hatch version --force <downgrade-version>.

Closes: #1458

@ofek
Copy link
Collaborator

ofek commented Aug 17, 2024

Thanks! I pushed a commit to use a slightly different approach in the backend. Rather than a CLI option for Hatchling, I'm using an environment variable as I recommended in a similar change: #1511 (comment)

The benefit is that if the backend happens to be a version before the introduction of the CLI option then nothing would break.

Copy link
Collaborator

@ofek ofek left a comment

Choose a reason for hiding this comment

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

Thanks a lot, good feature!

@ofek ofek merged commit e07d298 into pypa:master Aug 17, 2024
46 checks passed
github-actions bot pushed a commit that referenced this pull request Aug 17, 2024
github-actions bot pushed a commit to DimitriPapadopoulos/hatch that referenced this pull request Aug 20, 2024
@warsaw
Copy link
Contributor Author

warsaw commented Aug 20, 2024

Thanks! I pushed a commit to use a slightly different approach in the backend. Rather than a CLI option for Hatchling, I'm using an environment variable as I recommended in a similar change: #1511 (comment)

The benefit is that if the backend happens to be a version before the introduction of the CLI option then nothing would break.

Thanks, this makes sense! I'll keep that in mind for the future.

Question: are these environment variables documented?

@warsaw warsaw deleted the warsaw/version-cli branch August 20, 2024 15:22
@ofek
Copy link
Collaborator

ofek commented Aug 20, 2024

The other one I mentioned is not because the PR is still open and waiting for the recommendation. However, you're right that I forgot to document this outside of the plugin property!

If you have time, it should be documented here as well. Otherwise, I will make sure to do this before the next release!

github-actions bot pushed a commit to DylanLukes/hatch that referenced this pull request Aug 26, 2024
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.

hatch version should allow for version downgrades
2 participants