-
Notifications
You must be signed in to change notification settings - Fork 2
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 version ranges #16
Conversation
- Update the README with the new feature - Rewrite check-pip-version.sh in python, to support checking a version (19.0) is contained within a version set ('!=19.1,>18.0'). This has a dependency on `packaging` which must be installed in each tox env, unfortunately. - Add `tests/test-version-specifiers/` to test the new version ranges
Your PR intro comment sounds scary -- the dependency on packaging looks like it is only needed for the local tests here... -- or does it need to be installed into venvs in production usage of the plugin? A dependency on packaging should only be in the outer environment. To do that, the parsing needs to be in an earlier phase -- |
@jayvdb The dependency on |
Great. "unfortunately" in the commit message is what triggered me. If it is only a test dependency, it isnt unfortunate ;-) |
README.md
Outdated
version. | ||
- A version with specifiers, like `pip_version = >=19.0`, which installs any | ||
version matching the specifier set. | ||
- A version with specifiers prefixed with "pip", like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why allow a prefix of pip
?
Why should it be prefixed with only pip
? Why not setuptools, etc :P
Does allowing pip
prefix help with anything?
If not, I think you should prevent it in order to avoid misuse, even if it means more work to block that. Extra syntax which achieves nothing invites problems, and forward compatibility problems, in the future.
It does actually make sense to allow setuptools
and wheel
and anything else that could be needed before the testenv:deps
are installed. But that should be a separate enhancement with a bit of design put into it, and potentially the plugin needs a rename then ;-) This plugin is doing a venv prep phase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, agreed. Appreciate the good feedback!
@jayvdb I'm actually leaning in the opposite direction, I think. I prefer using the pip
-ful (including the prefix) syntax, mainly because I think it's slightly more consistent:
pip command | pip -less |
pip -ful |
---|---|---|
pip install -U pip>19.0 |
pip_version = >19.0 |
pip_version = pip>19.0 |
pip install -U pip<19,>18 |
pip_version = <19,>18 |
pip_version = pip<19,>18 |
pip install -U pip |
pip_version = '' pip_version = latest ??? |
pip_version = pip |
That last line in the table is where there was no exact equivalent to a pip install -U pip
and I didn't really like either empty string or latest
to support that (open to suggestions though). It's true that a user can always write >19.0
to get latest, so not a huge practical concern.
In the future, I might expand this to pip_version = <flags> <packages>
and pass those arguments straight to pip install <flags> <packages>
to support other pip flags/options. So this is one step in that direction (and definitely hear you on the package rename, and moving toward treating this as a generic "venv prep" plugin, which makes sense to me).
Anyway, I agree that either the "pip-less" or "pip-ful" syntax should be removed. I don't feel that strongly one or another, but am leaning toward removing the "pip-less" syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other point I missed:
Whichever syntax is settled on in this PR, I did want to keep the pip_version = 19.0
syntax (without any specifiers), for backwards-compatibility for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to removing pip-less
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip_version = >=19.0
is much more useful and expressive than pip_version = pip
, or even pip_version = latest
.
The former creates a log entry in the codebase history of what version was actually required at that time, without needing to see the build logs to know what version was being installed. People will likely only bump it occasionally, because the -U
means they wont notice if the version specified isnt good enough for the usage of pip within the testenv, but it will encourage them to think about it occasionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is an argument one way or another? You will still be able to write pip_version = pip>=19.0
.
In any case, updated to remove the "pip-less" syntax.
(19.0) is contained within a version set ('!=19.1,>18.0'). This has a
dependency on
packaging
which must be installed in each tox env,unfortunately (note: test requirement only, no changes to the setup.py)
tests/test-version-specifiers/
to test the new version rangesFixes #12
Fixes #15