-
Notifications
You must be signed in to change notification settings - Fork 52
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
CLI to install to Python running installer #94
Conversation
Signed-off-by: Filipe Laíns <lains@riseup.net>
for more information, see https://pre-commit.ci
Two major concerns:
|
I agree, I don't think For bytecode compilation, you can technically tell it not to by passing Do you want bytecode generation to be on by default, with separate arguments to disable it ( |
How about:
Have the metavar be |
I think that should implement what you suggested. I still need to get to writing some tests. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
Apparently I have review comments that I haven't posted?
I like your tweak better! :) |
I gave this a try in Nixpkgs, and it seems the path to the interpreter is always prefixed. What we get
What we should have
Building wheels is done with
and installing using
|
My understanding is that NixOS specifically does not use DESTDIR because every package already has its own unique PREFIX. No idea how you handle sysconfig paths though (which contain the PREFIX). |
Correct, every package has a prefix. Without setting
Here it indeed takes the prefix corresponding to the interpreter, and that is not OK for us. With pip we use
What we need is like other build systems the ability to set a |
To be 100% clear, I floated the idea of a prefix option on #66 (the predecessor to this PR), but @FFY00 and @eli-schwartz argued strongly against it. I get the sense they've spent more time than me thinking about these things, so I deferred to them. But I can't see a way to achieve what you want without a prefix option, short of messing around with sysconfig (which seems like a workaround to me). One other way to approach this could be through the lower-level 'give us explicit target paths' interface (as in #93), and leave it to you to construct paths like @pradyunsg any preferences? |
Right.
My understanding is that @FFY00 indeed suggests adding a sysconfig scheme:
Adding a scheme might be a possibility. We now use the
Just to compare, a virtualenv, constructed from that env, looks like
I don't know how the interpreter would behave though if we would make this custom prefix the default prefix. It would run with something looking like
but that would then have to use |
Since So IMO |
I've just gotten a report that the install doesn't make scripts (as in normal scripts, not entry points) executable. I'm not sure if this is something to tackle as part of this PR or separately (#90 might be relevant). |
It should install the script files to the correct location, but I don't think it treats them specially at all - rewriting shebangs, setting the execute bit for Unix, or making exe wrappers for Windows. Entry points became the de facto standard for installing executable commands, so the old mechanism to include script files doesn't get much love (see e.g. pypa/pip#2596 ). The wheel spec is silent, as far as I can see, on whether it's the responsibility of the code building the wheel to set the executable bit, or whether the code installing it should make anything in the scripts directory executable. In any case, any special handling for script files is orthogonal to adding a CLI (the existing Python API has the same limitation), so I think it should be addressed separately. |
(My mistake, I see it does have special handling for setting the shebang. In that case, I suspect #90 will fix the problem you describe) |
#90 is the right thing for that. :) |
@takluyver, could you update your patch following the changes in main? Not sure if rebasing or merging is the right thing for this repo. |
I've merged master in for now - Github makes that easy. @pradyunsg I can rebase it if you prefer. |
Thank you. I suppose I'll just switch Gentoo to your fork rather than trying to apply this PR as a patch ;-). |
I'm gonna squash-merge this one, since it's decently atomic on the whole and I don't find it particularly interesting to have the entire history of the evolution of this PR, recorded on |
Thanks @takluyver for taking this over the line, @FFY00 for starting us down this path and everyone else for engaging in this discussion! ^>^ |
This starts from #66, and moves the added functionality for destdir & bytecode compilation into the Python API (
SchemeDictionaryDestination
), so the CLI is a thinner wrapper over the Python API. It also drops the compatibility checks, soinstaller
once again has no dependencies.Alternative to #92, for consideration.
Closes #93