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

Enable explicitly specifying pre-releases without enabling pre-releases #110

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

MHendricks
Copy link
Member

Currently forcing a pre-release version to hab without enabling prereleases in the site/cli causes an InvalidRequirementError error. Hab should handle this in the same way as pip does.

Normally it should ignore pre-release versions unless you pass the --pre flag to the cli(or enable prereleases in your site). However if you pass an <=, >=: inclusive ordered comparison specifier that specific specifier, that specific specifier should enable pre-releases without affecting the other requirements.

Checklist

  • I have read the CONTRIBUTING.md document
  • I formatted my changes with black
  • I linted my changes with flake8
  • I have added documentation regarding my changes where necessary
  • Any pre-existing tests continue to pass
  • Additional tests were made covering my changes

Types of Changes

  • Bugfix (change that fixes an issue)
  • New Feature (change that adds functionality)
  • Documentation Update (if none of the other choices apply)

Proposed Changes

You can replicate this issue by including the pre-release distros from this pull request. Run the command hab -r "pre-release<=1.dev9" dump not_set/empty_lists.

If you don't include the changes to distro.py you will replicate the current problem where hab raises:

hab.errors.InvalidRequirementError: Unable to find a valid version for "pre-release<=1.dev9" in versions [1.0.dev1, 1.0, 1.1.dev2]

But if you include the changes to distro.py it will resolve the distro pre-release==1.0.dev1.

This preserves the existing use of --pre. If you run hab -r "pre-release" dump not_set/empty_lists -vvv it will resolve pre-release==1.0. Adding the flag --pre will resolve the pre-release version pre-release==1.1.dev2.

Sorry, something went wrong.

This makes it so the resulting json data is consistently ordered.
@MHendricks MHendricks merged commit 6d3b79d into main Nov 6, 2024
31 checks passed
@MHendricks MHendricks deleted the mikeh/pre-req branch November 6, 2024 00:03
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.

None yet

1 participant