Skip to content

Python: use buildEnv for application, remove PYTHONPATH wrapper - #16668

Closed
FRidh wants to merge 1 commit into
NixOS:masterfrom
FRidh:buildapplication
Closed

FRidh wants to merge 1 commit into
NixOS:masterfrom
FRidh:buildapplication

Conversation

@FRidh

@FRidh FRidh commented Jul 2, 2016

Copy link
Copy Markdown
Member
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 the buildEnv. This works because python.buildEnv sets PYTHONHOME.

Eventually, I will want to put this function in the passthru of the interpreter.

Things done
  • Tested using sandboxing
    (nix.useChroot on NixOS,
    or option build-use-chroot in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • OS X
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@RonnyPfannschmidt this might be of interest to you.

@FRidh FRidh added 6.topic: python Python is a high-level, general-purpose programming language. 2.status: work-in-progress labels Jul 2, 2016
@FRidh FRidh self-assigned this Jul 2, 2016
@mention-bot

Copy link
Copy Markdown

@FRidh, thanks for your PR! By analyzing the annotation information on this pull request, we identified @domenkozar, @offlinehacker and @adnelson to be potential reviewers


propagatedBuildInputs = [ env ];

# Create symbolic links to the scripts provided our package

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by our

@FRidh

FRidh commented Jul 2, 2016

Copy link
Copy Markdown
Member Author

hmm, should have tested this better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants