Enable explicitly specifying pre-releases without enabling pre-releases #110
+566
−282
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Types of Changes
Proposed Changes
You can replicate this issue by including the
pre-release
distros from this pull request. Run the commandhab -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:
But if you include the changes to
distro.py
it will resolve the distropre-release==1.0.dev1
.This preserves the existing use of
--pre
. If you runhab -r "pre-release" dump not_set/empty_lists -vvv
it will resolvepre-release==1.0
. Adding the flag--pre
will resolve the pre-release versionpre-release==1.1.dev2
.