-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Python: use buildEnv for application, remove PYTHONPATH wrapper #16672
Conversation
@FRidh, thanks for your PR! By analyzing the annotation information on this pull request, we identified @domenkozar, @offlinehacker and @adnelson to be potential reviewers |
|
||
tox = buildApplication { package = pythonPackages.tox; }; | ||
ipython = buildApplication { package = pythonPackages.ipython; }; | ||
|
||
python26 = callPackage ../development/interpreters/python/2.6 { |
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.
these are just examples, I definitely won't keep these here.
Perhaps you could make the |
Indeed. |
or could Python applications also create other output that we'd be interested in? |
I couldn't figure out a way to give outputs to Example:
|
Actually, using multiple-outputs won't work; we don't just want all of |
{stdenv}: | ||
|
||
{ package | ||
}: |
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 seems like sort of non-standard formatting. Perhaps either {package}:
like you have above, or
{
package
}:
Not a big deal but this reads kind of weird to me
@adnelson It can indeed use some cleanup. Note that the intention of this PR was to show how we can solve an issue, not really merging it as is. Implementing certain things takes a lot of time, so I rather get feedback first. Thanks for that. |
In any case, |
I think this would be a really good way to avoid the more or less fragile What can we do about the missing multiple output support? Any new ideas? |
Something like this is also on the todo list of triton: triton/triton#64 |
Not that I can think of. I would prefer if there weren't any wrappers at all, but that would mean copying the contents of After some more thinking about this issue, I think
What do you mean with missing? Why do we need multiple outputs? Are there any specific issues you're facing with the current implementation? That is, what Nixpkgs now uses. |
Exactly! This is what I thought too. Nope! I didn't read all coments carefully enough. Someone mentioned @domenkozar What do you think about it? |
What's the status here? |
I still think this is the way forward, but this won't make it in before 17.09 though. I have no idea when I could continue on this so I'm closing this now. |
This allows to have awscli running both under python 2 and 3 as necessary.
Motivation for this change
I got the following idea to make Python applications work, without wrapping all scripts with a wrapper that sets PYTHONPATH. In this PR I introduce a function that builds a
python.buildEnv
for the chosen Python application, and then another derivation that symlinks only the scripts of the application, but then via thebuildEnv
. This works becausepython.buildEnv
setsPYTHONHOME
.Eventually, I will want to put this function in the
passthru
of the interpreter and have apython.packages
and apython.applications
with the latter mapping this function topython.packages
.Things done
(nix.useChroot on NixOS,
or option
build-use-chroot
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)@RonnyPfannschmidt this might be of interest to you.
Replaces #16668