-
Notifications
You must be signed in to change notification settings - Fork 253
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
fix: Support environment markers in PEP 518 workaround #398
Conversation
Assuming the tests pass, how hard would it be to push it into a 1.5.2 release? |
What about just |
I'll try that to see if it works, but then I'll take a stab at removing the shell + join. Really this should have worked in the original form, it just is tripping up because of the join hack, IIUC, so it's worth testing to see if that's easy to remove. |
Great, that would be even better! Thanks for taking up this annoying job! :-) |
I try some time ago to remove |
I think that says it's still affecting at least Python 3.7, and it's marked as open and languishing so I bet it is true in 3.8 and 3.9. I'm playing around with it, and will see if I can come up with a solution. Using the correct environment is important, so if that's really completely missing when shell=False, then the solution above is probably the only reasonable one. |
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.
Great, things are green! :-)
@@ -172,7 +172,8 @@ def pep_518_cp35_workaround(package_dir: Path, env: Dict[str, str]) -> None: | |||
else [] | |||
) | |||
if requirements: | |||
shell(['pip', 'install'] + requirements, env=env) | |||
escaped_requirements = [f'"{s}"' for s in requirements] |
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.
Thinking out loud: is this something we should do here, or more broadly inside of shell
?
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.
We don't have any protection for quotes inside the string, so I was a little hesitant to add it higher up. If someone wrote "requests==2.22.0; python_version<\"3.6\"",
, in fact, this might not work.
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.
Good point. I suppose we also control most of the other things to not contain spaces?
Though .. what about spaces in CIBW_TEST_EXTRAS
or so?
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.
That can be changed by the cibw user, if something odd happens. You can't change pyproject.toml
(at least you shouldn't in CI).
Don't think this is related, only on Travis. |
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 would be a good candidate for 1.5.2, but #399 would be more of a candidate for 1.6... |
The original version didn't handle environment markers, making the common idiom for supporting all NumPy versions:
fail. Will fix #392.