-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
Building a PEX for multiple platforms doesn't affect sys.platform
in extras_require
#455
Comments
respecting these extras environmental markers is a known gap in most interactions with because of these age old assumptions, this is a semi-hard problem to solve for generally - and for not much benefit. you'd effectively have to emulate a platform to the best of your ability - stubbing out all of the environmental markers/ an interesting datapoint here would be to know whether or not e.g. |
there's also no exclude syntax that I'm aware of for python requirements, tho that'd be nice in cases like this and could be worth pursuing. beyond that, it seems like the only way to make this particular package cross-platform-resolver friendly would be to drop the env marker extras in favor of making users explicitly define those (e.g. an inversion of that idea that may be a viable escape hatch in the longer term on a per-platform axis tho, could be to implement a so yeah, a harder problem than it appears on the surface. |
I just noticed this issue. AFAICT it has since been ~solved on all points:
All that said, the OP use case fails still - as it should. The Command line explicitly requests 2 platforms are satisfied in the PEX and, since both MacFSEvents and pyinotify are sdist only (on PyPI), this cannot be done. One of the 2 requested platform's sdists will always fail to build:
I tried out the newish |
Thank you, @jsirois, I have also spent a few hours trying to get Pants pass the I attempt to exclude
and it fails with
It would be superb to be able to ask PEX not to search for a package in a lockfile. The use case is that one may have most packages resolved in the lockfile, but there will be a few that are not there (but will be available on the PATH at runtime). |
Unless I have overseen something, this applies also to running pex without a lockfile:
|
@AlexTereshenkov it would be really useful if you could provide full info (the lock file in question). As it stands it's not clear to me your report is totally germane to this particular issue. You seem to be describing wanting the ability to pass |
Oh great to catch up again, John :) thanks for taking a look! I have a PR https://github.com/AlexTereshenkov/cheeseshop-query/pull/39/files in case you want to run things locally for yourself. In this PR AlexTereshenkov/cheeseshop-query#40 I have everything just as in the first one except the lockfile is left as is (automatically generated). |
FWIW I am actually fine to run the commands with no / empty lockfile - the primary use case is that none of the dependencies are going to be provided via Python packages, so all of them will be available only at runtime. I'd love pex to totally ignore any 3rd party requirements, similar to how it's done for the |
@AlexTereshenkov your primary use case is tortured via Pants as far as I can tell. IIUC you want a PEX of only your 1st party code (since all 3rdparty code will be provided by pre-installed packages visible to the host interpreter). That's trivial: I will look at the info you provided above when I get back to a keyboard on the 19th, but I suggest opening a dedicated issue if needed. |
I have fixed up exclude in this way, but it still does not solve the OP case fully since pyinotify uses an aggressive setup.py that
To get around this sort of aggressive behavior in a |
pyinotify has been a thorn in my side for years. If there's something PEX could do to work around that awful (or "aggressive" as you put it so nicely) |
@cognifloyd you can always use a vcs requirement pointing to your fork + patch. Since pyinotify is a sdist anyhow, this is next to no skin off your back IIUC - you just need to add a top-level fake requirement. |
Alright @cognifloyd b3695e1 makes this so. The same trick should make it easy to implement |
Filed #2425 to track |
Previously, `--exclude`s were processed after all resolution was complete. Not only was this sub-optimal, incurring more resolution work (downloads, backtracks, etc.), but it also could lead to failed interactions (metadata extraction & wheel builds) with excluded distributions. Fix this by plumbing `--exclude`s all the way through the Pip resolve process. Additionally, fix the existing plumbing through the two other resolve processes: PEX repository resolution and lock file resolution. Fixes #455 Fixes #2097
Alrighty, at long last I think this can be considered complete. With the improved |
I'm trying to build a cross-platform (Mac and Linux) PEX that contains the
doit
library, but it seems as ifpex
is not doing anything to make the target platform be respected by the usages ofsys.platform
in the conditions of theextras_require
dictionary in itssetup.py
file.The following command results in the failure I'm running into on my Mac (running 10.12.6):
It appears as if
pex
is succeeding in building the part of the PEX formacosx_10.12-x86_64
(makes sense since that's my host OS), but failing on the part forlinux-x86_64
.Shouldn't
pex
not try to useMacFSEvents
for thelinux-x86_64
platform since the choice betweenMacFSEvents
andpyinotify
is guarded by checkingsys.platform
in theextras_require
dictionary?I also don't actually need either
MacFSEvents
norpyinotify
for my purposes, so alternatively is there a way to tellpex
to ignore theextras_require
dictionary?If instead this is something that should be fixed/adjusted in the
doit
library, what do you recommend I change in a potential pull request for that library?The text was updated successfully, but these errors were encountered: