Commit Graph

157 Commits

Author SHA1 Message Date
Vladimír Čunát
e757404555 Merge branch 'master' into staging
Hydra nixpkgs: ?compare=1279790
2016-06-19 12:33:04 +02:00
Domen Kožar
3ea8068181 buildPythonPackage: be able to disable package conflict check 2016-06-16 11:49:19 +01:00
Frederik Rietdijk
9f2699fd30 Python: fix the wheel package 2016-06-16 11:36:10 +02:00
Vladimír Čunát
cec03a8ecd Merge #14753: makeWrapper: allow spaces in variables 2016-06-09 13:09:43 +02:00
Domen Kožar
b49bf121b8 rename iElectric to domenkozar to match GitHub 2016-05-17 13:00:47 +01:00
Vladimír Čunát
6c2fbfbd77 Merge branch 'master' into staging 2016-05-12 04:53:38 +02:00
Frederik Rietdijk
3beda443bc Python: re-enable default testing
In 303e976 default testing of setuptools packages was accidentally
disabled.
2016-05-09 18:33:43 +02:00
Frederik Rietdijk
303e976245 Python: allow installing wheels
By passing `format="wheel"` it is now possible to install a wheel.
It's not recommended, but it can be useful.
2016-05-09 13:17:42 +02:00
Nikolay Amiantov
97e4c19fca wrapPython: drop python suffixes 2016-04-22 20:57:15 +03:00
Marius Bakke
28919e5bfa wrapPythonPrograms: preserve quoted strings from makeWrapperArgs
Currently, if a user tries to to set a variable that contains
spaces, it will be broken up before being passed to wrapProgram.

This commit resolves that by converting makeWrapperArgs to an
array that preserves any quoted elements using bash's parser.
2016-04-16 02:58:02 +01:00
Nikolay Amiantov
895f51222e buildPythonPackage: add installFlags 2016-02-21 12:20:51 +01:00
Vladimír Čunát
e4ab8aee62 add ensureNewerSourcesHook and apply to all python
Fixes #12663: problems in python stuff due to old timestamps in sources.
- Files in sources older than a certain year are set to that year.
- Applied with 1980 for all python packages due to the way it often uses zip.
2016-02-03 10:21:16 +01:00
Domen Kožar
07049a7edf python generic builder: fix typos 2016-01-27 13:11:20 +01:00
Domen Kožar
7a3b518d62 buildPythonPackage: fix a regression #11303 2015-11-27 11:44:34 +01:00
Domen Kožar
0c772699ba buildPythonPackage: write some comments 2015-11-26 17:31:10 +01:00
Domen Kožar
cf5984e4bf buildPythonPackage: fix support for pypy 2015-11-23 17:47:35 +01:00
Rok Garbas
d82f55aead pythonPackages: shellHook of buildPythonPackages needs tmp_path to have lib/pythonX.Y/site-packages folder 2015-11-23 17:43:32 +01:00
Domen Kožar
90f97c125d buildPythonPackage: use pip for development also 2015-11-21 22:17:04 +01:00
Domen Kožar
c6c58dc92d release-python.nix: automatically detect buildPythonPackage 2015-11-21 21:44:12 +01:00
Domen Kožar
9bf99a5a4d buildPythonPackage: don't do build_ext if not needed 2015-11-21 21:44:12 +01:00
Domen Kožar
127a20f8da buildPythonPackage: sadly, checkPhase is too often installPhase in python 2015-11-21 21:44:12 +01:00
Domen Kožar
6ba529277a buildPythonPackage: catch_conflicts should ignore pip 2015-11-21 21:44:12 +01:00
Domen Kožar
1029db9024 buildPythonPackage: fix do_conflict.py on python 3 2015-11-21 21:44:12 +01:00
Domen Kožar
a912c45ee2 buildPythonPackage: get rid of setupPyInstallFlags since there is no such thing 2015-11-21 21:44:12 +01:00
Domen Kožar
42acb5dc55 buildPythonPackage: fix pypy 2015-11-21 21:44:12 +01:00
Domen Kožar
f900231042 buildPythonPackage: fail if two packages with the same name are in closure 2015-11-21 21:44:12 +01:00
Domen Kožar
f3092d6446 buildPythonPackage: use a separate file to fire off setup.py 2015-11-21 21:44:12 +01:00
Domen Kožar
960274fc7c wrapPython: use $out/bin also for $PATH (fixes pyramid pserve --reload) 2015-11-21 21:44:12 +01:00
Domen Kožar
a2a6f60b5a WIP: buildPythonPackages now uses wheels internally 2015-11-21 21:44:12 +01:00
Domen Kožar
b666ac3e9f Revert "python: skip build at install phase"
This reverts commit d34f5b6570.

PIL and NumPy don't like this change and I'd rather spend time on
bringing wheels to Nix than fixing old infrastructure.
2015-11-15 13:50:04 +01:00
Domen Kožar
5a16c0e6e4 buildPythonPackage: clean up shellHook 2015-11-15 13:50:04 +01:00
Domen Kožar
d34f5b6570 python: skip build at install phase
"python setup.py install" will also run "python setup.py build"
which we've already done in buildPhase.
2015-11-04 11:40:09 +01:00
Domen Kožar
0509252e28 python: don't pass disabled to derivation 2015-10-30 11:31:19 +01:00
Vladimír Čunát
8f33b8cc93 mass rewrite of find parameters to cross-platform style
Fixes #9044, close #9667. Thanks to @taku0 for suggesting this solution.
Now we have no modes starting with `/` or `+`.

Rewrite the `-perm` parameters of find:
 - completely safe: rewrite `/0100` and `+100` to `-0100`,
 - slightly semantics-changing: rewrite `+111` to `-0100`.
I cross-verified the `find` manual pages for Linux, Darwin, FreeBSD.
2015-09-06 10:26:30 +02:00
Vladimír Čunát
862900e42e mass-replace deprecated usage of find -perm (Fixes #9044)
sed 's|-perm +0|-perm /0|g'
It's a mass-rebuild due to usage in stdenv's default setup hooks.
2015-07-30 10:30:17 +02:00
aszlig
b028c14256
python-wrapper: Fix variable name for sed expr.
Regression introduced by 5f55788531.

The commit not only changes documentation, but also changed a few
variable names. One of them is $i which now is $f and it contains the
name of the file to wrap.

This was accidentally found by @Profpatsch (thanks!) who found himself
getting the basename of the last patch file to end up in sys.argv[0].
The reason for this is that $i is used in the for loop of the generic
patchPhase and thus is reused later when the Python file is to be
wrapped.

I have also added a small comment noting about this, to be sure that
this won't accidentally occur the next time someone changes variable
names.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-07-07 18:25:10 +02:00
Allen Nelson
6bb2e47abf using makeWrapperArgs instead of setEnvVars 2015-05-24 10:21:33 -05:00
Allen Nelson
bf1a16bbea removing superfluous lets 2015-05-24 10:21:33 -05:00
Allen Nelson
06ff4af597 Adding documentation to wrap.sh, added ability to retain any desired environment variables. 2015-05-24 10:21:33 -05:00
Allen Nelson
5f55788531 adding docs to python wrap.sh 2015-05-24 04:55:24 -05:00
aszlig
311aa5d8d9
python-wrapper: Handle strings at the beginning.
This should fix #7366 for now, but using the (IMHO) pragmatic approach
of extending the sed expression to recognize strings.

However, this approach is obviously not parsing the full AST, nor does
it wrap Python itself (as pointed out by @spwhitt in #7366) but tries to
match Python strings as best as possible without getting TOO unreadable.

We also use a little bit of Nix to help generating the SED expression,
because doing the whole quote matching block over and over again would
be quite repetitious and error-prone to change. The reason why I'm using
imap here is that we need to have unique labels to avoid jumping into
the wrong branch.

So the new expression is not only able to match continous regions of
triple-quoted strings, but also regions with only one quote character
(even with escaped inner quotes) and empty strings.

However, what it doesn't correctly recognize is something like this:

"string1" "string2" "multi
line
string"

Which is very unlikely that we'll find something like this in the wild.
Of course, we could handle it as well, but it would mean that we need to
substitute the current line into hold space until we're finished parsing
the strings, branch off to another label where we match multiline
strings of all sorts and swap hold/pattern space and finally print the
result. So to summarize: The SED expression would be 3 to 4 times bigger
than now and we gain very little from that.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-04-14 07:13:15 +02:00
Domen Kožar
c6512f7df3 buildPythonPackage: propagate setuptools 2015-04-12 21:15:36 -04:00
Domen Kožar
0fd3db4ba1 fix #6548 2015-03-07 22:31:40 +01:00
Domen Kožar
b653e3f661 Revert "python-generic: set meta.broken for disabled packages instead of raising an error during evaluation"
This reverts commit 79a5fec9c0.

meta.broken uses 'throw' under the hood so it can not improve the
current situation. Reverting to previous behaviour gives us correct
error message to the user indicating that interpreter is not supported.

Correcting Hydra output is out of scope of Python packaging.
2015-02-25 09:23:31 +01:00
Peter Simons
27b57469e8 python-generic: cosmetic 2015-02-13 10:37:46 +01:00
Peter Simons
79a5fec9c0 python-generic: set meta.broken for disabled packages instead of raising an error during evaluation
We have tons of evaluation errors on Hydra because it tries to build
known broken packages. Re-using meta.broken makes sure these packages
aren't evaluated in the first place.
2015-02-12 20:07:56 +01:00
Domen Kožar
9a33fbb52d python: don't propagate installed packages into userenv, refs #4949
Propagation is not needed anymore, as we have more powerful apis today
than this dirty hack. See nix-shell tool and python.buildEnv function
in nixpkgs manual.
2015-01-17 14:19:29 +01:00
Domen Kožar
ab423e6367 buildPythonPackage: add python to propagatedBuildInputs
Doing:

$ nix-shell -p pythonPackage.pyramid

now also sets $PYTHONPATH. Previously you'd have to do:

$ nix-shell -p pythonPackage.pyramid python
2014-11-13 21:04:13 +01:00
Rok Garbas
602f7e5aa4 python: collision in names when developing 2 and more python packages with nix
when you run nix-shell 2 times at the same time of project (but different
branches) you get collision in names inside /tmp folder. i solved this by
hashing current path of developing folder and using that as indentifier while
still keeping name at the end.

diff --git a/pkgs/development/python-modules/generic/default.nix
b/pkgs/development/python-modules/generic/default.nix index 4c9c53a..6ec7934
100644 --- a/pkgs/development/python-modules/generic/default.nix +++
b/pkgs/development/python-modules/generic/default.nix @@ -161,11 +161,12 @@ if
disabled then throw "${name} not supported for interpreter ${python.executabl

   shellHook = attrs.shellHook or ''
     if test -e setup.py; then
-       mkdir -p /tmp/$name/lib/${python.libPrefix}/site-packages
+       tmp_path=/tmp/`pwd | md5sum | cut -f 1 -d " "`-$name
+       mkdir -p $tmp_path/lib/${python.libPrefix}/site-packages
        ${preShellHook}
-       export PATH="/tmp/$name/bin:$PATH"
-       export PYTHONPATH="/tmp/$name/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
-       ${python}/bin/${python.executable} setup.py develop --prefix /tmp/$name
+       export PATH="$tmp_path/bin:$PATH"
+       export PYTHONPATH="$tmp_path/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
+       ${python}/bin/${python.executable} setup.py develop --prefix $tmp_path
        ${postShellHook}
     fi
   '';
2014-09-19 14:23:45 +02:00
Michael Raskin
76f4eb5f93 Revert "python-wrapper: fix wrapped argv[0] w/o sed, maybe"
This reverts commit a6dd9bd0cb.
2014-09-02 20:45:41 +04:00