-
Notifications
You must be signed in to change notification settings - Fork 251
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
Fixing platform_release pep440 #722
Fixing platform_release pep440 #722
Conversation
e7f3881
to
3e16582
Compare
Interesting approach. I'll try to take a closer look later this week. For future reference: #552 is a previous attempt to solve the issue by just making |
Because this addresses some issues for folks using edge devices (my team using
|
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 with some improvements and some more unit tests for the changed methods the PR could be accepted.
One general advice: It makes the review easier if you re-arrange your commits so that there is a corresponding unit test for each change in the same commit. For example:
- In the first commit, you changed the
validate()
method, but you did not extend avalidate
test. - In the second commit, you changed the version constraint parser, but you did not extend
test_parse_constraint
.
If you change a method, please take a look if there is a unit test for this method and extend the test.
Thank you for your review, I will work to fixup my commit flow to match change+unit test and follow up on your comments. |
3e16582
to
ddfc68d
Compare
I have forced pushed over my previous commits with 3 commits hopefully tying change+test into each commit. There might be some overlap between tests. Most of the diff is reorganizing commits and included your suggestions.
I added several more tests to the PR by looking at the methods I modified. Please let me know if there are ones I overlooked or additional test cases you would like to see. |
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.
Thanks for reorganizing the commits. This really makes the review easier. I added some further comments.
The hardest part is to consider all combinations of operators in the methods of Constraint
. I mentioned some examples in the last comments, which can be added in test_constraints
if we can handle them.
Will address comments and fix issues in coming days |
94be7d4
to
157cbe1
Compare
I've updated the |
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 the logic for allows
is not yet completely correct. However, while reviewing it, I noticed that this method had already been quite a mess with a vague interface and some bugs before. I think we have to fix it first for the existing operators (and increase test coverage) before introducing new operators. Therefore, I created #732. I hope it does not take too long until this one gets reviewed so we can proceed here.
In the meantime, please take a look at my other comments concerning the regexes.
I managed to make some changes to the regex and how we represent the marker internally. Now all markers should be correctly represented.
|
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.
Looks good so far.
I think we can drop one regex. (See code comments.)
"tegra" in platform_release
is now"tegra" in
for the single marker instead ofintegra
I wonder if we should use quotes or not because the representation of the non-swapped constraints is without quotes (e.g. !=win32
instead of !="win32"
). However, I understand that there is more ambiguity with in
and not in
so I think it is fine the way it is.
By the way, #732 has been merged into main so you can rebase (sorry for the conflicts) and we can take a closer look at the allows
methods.
126a130
to
8ae3321
Compare
I have hopefully deconflicted correctly the PR that was merged earlier and addressed your comments on the regex. |
I was traveling for work, but now I am getting back to this. I will be asking some clarification questions as I work through you latest comments. |
96087b4
to
9dfa8ba
Compare
I want to get some more test cases in to ensure I have covered edge cases. This topic is indeed finicky |
I added a few more tests, fixed and simplified a few things. I think I will take another look next week and - if everything still makes sense to me - finally merge it. Thanks for your endurance. |
…-poetry#722) This is a precondition to allow markers like `"tegra" in platform_release`. Attention: In contrast to other operators the value comes before the operator (and the marker name after the operator). Co-authored-by: Randy Döring <[email protected]>
) This allows markers like `"tegra" in platform_release`. Co-authored-by: Randy Döring <[email protected]>
…thon-poetry#722) e.g. 'platform_release == "4.9.253-tegra"' Co-authored-by: Randy Döring <[email protected]>
5827647
to
61f1a48
Compare
…-poetry#722) This is a precondition to allow markers like `"tegra" in platform_release`. Attention: In contrast to other operators the value comes before the operator (and the marker name after the operator). Co-authored-by: Randy Döring <[email protected]>
) This allows markers like `"tegra" in platform_release`. Co-authored-by: Randy Döring <[email protected]>
…thon-poetry#722) e.g. 'platform_release == "4.9.253-tegra"' Co-authored-by: Randy Döring <[email protected]>
61f1a48
to
35ae305
Compare
This is a precondition to allow markers like `"tegra" in platform_release`. Attention: In contrast to other operators the value comes before the operator (and the marker name after the operator). Co-authored-by: Randy Döring <[email protected]>
This allows markers like `"tegra" in platform_release`. Co-authored-by: Randy Döring <[email protected]>
Resolves: python-poetry/poetry#7418
Resolves: python-poetry/poetry#9434
Can add more tests if requested. Any feedback welcome as well, attempted to fix with smallest changes and no side effects.
Examples of conditions this should fix
'tegra' in platform_release
'platform_release <= 5.10.123-tegra
'arm' in platform_version
When parsing versions, I added an additional semver-ish regex that will catch patterns that match certain
platform_release
versions that aren't quite pep440 or semver. Examples are either WSL2 builds, raspi builds or nvidia edge device builds5.15.146.1-microsoft-standard-WSL2
6.6.20+rpt-rpi-v8
5.10.120-tegra