-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Add requirement for more-itertools that works on python 2 #7296
Conversation
See d0432df and #7238 -- we are currently unable to bump the pytest version beyond We probably don't want to land this change as is, for the reasons described in pytest-dev/pytest#4770 (comment) (linked in #7238 -- we don't want to impose requirement constraints on pants users running pytest). It seems like this error would arise if you have overridden the pytest requirement in another repo's However, I might be mistaken -- are you seeing the error described when developing in the pants repo, or is overriding the |
I hadn't seen #7238. I was getting the error on pants 1.13.0. The comment you linked (pytest-dev/pytest#4770) is referring to pinning specific versions of more_itertools in pytest. This change doesn't pin a specific version, it merely limits the version of more_itertools to something that works with whatever version of python you're running. Basically the same thing pytest itself is doing with pytest-dev/pytest#4774. That seems more flexible than pinning pytest to 3.0.7 specifically. |
Ah, I misunderstood! Thank you for describing the difference -- this change sounds right enough to me then, although the specific implementation might be edited. @jsirois might the above^ be a reason to allow |
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.
This looks right to me.
The key detail is python_version<3
. Because more-itertools 6.0+ never will work with Python 2, users don't lose any compatibility here and I believe they can still specify a more specific version <6.0. If running with Python 3, there is no constraint at all. So, this change appears completely safe to make in that we won't be unreasonably constraining users at all.
Thank you for the patch!
--
Is this something we need to cherry-pick? cc @stuhood
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 think this is good to merge once both of the TODOs that @Eric-Arellano pointed out are added! Thanks again for the very specific and useful fix!
Does this make it possible to revert (part of) #7238? |
aabf17b
to
97f60f9
Compare
97f60f9
to
4be4f1c
Compare
Thanks @cheister ! |
Problem
The latest release of more-itertools (6.0.0) only works on Python 3. https://github.com/erikrose/more-itertools/releases. more-itertools is a requirement of pytest.
When running with python2 I get
This has been fixed on the latest version of pytest but I'm not sure if we can update to that version or not? pytest-dev/pytest#4774
Solution
Add requirements where we use pytest so we don't get incompatible versions of more-itertools
Result
pytest invocations continue to work on Python 2