Commit Graph

607 Commits

Author SHA1 Message Date
Florian Klink
db087f226d python: allow stripping bytecode 2019-08-18 23:47:44 +02:00
Florian Klink
52fcbbff44 python: make rebuilding bytecode optional 2019-08-18 23:47:44 +02:00
Florian Klink
8335f3dd5c python: allow stripping config 2019-08-18 23:47:43 +02:00
Florian Klink
d03283c029 python: allow stripping tests 2019-08-18 23:47:30 +02:00
Florian Klink
414cde4df4 python: allow stripping IDLE 2019-08-18 23:47:16 +02:00
adisbladis
5c0d493df4
python: Enable building without openssl 2019-08-18 08:18:58 +01:00
Emily
ec07b882b3 pypy{2,27,3,35 -> 36}: 7.0.0 -> 7.1.1 2019-08-13 16:49:27 -07:00
Emily
5638dd55e3 pythonInterpreters.pypy{27,35 -> 36}_prebuilt: 6.0.0 -> 7.1.1 2019-08-13 16:49:27 -07:00
Frederik Rietdijk
658c0f0ce9 python38: 3.8.0b2 -> 3.8.0b3 2019-08-03 08:14:25 +02:00
Michael Weiss
8760c695d4
swiften, pypy: Mark as broken
swiften is broken since 2018-10-18:
x86_64-linux:  https://hydra.nixos.org/build/97180305
aarch64-linux: https://hydra.nixos.org/build/97193043

pypy is broken since 2019-05-29:
x86_64-linux (pypy):  https://hydra.nixos.org/build/97214777
x86_64-linux (pypy3): https://hydra.nixos.org/build/97221287

The builds for swiften and reposurgeon (depends on pypy) regularly fail
during rebuilds for SCons updates (e.g. [0]).

[0]: https://github.com/NixOS/nixpkgs/pull/65392
2019-07-30 19:25:43 +02:00
Frederik Rietdijk
bd47c5721f Python: introduce NIX_PYTHONEXECUTABLE in order to set sys.executable
This is needed in case of `python.buildEnv` to make sure sys.executable
does not point to the unwrapped executable.
2019-07-27 11:52:49 +02:00
Nikolay Amiantov
da295a1206 python2: backport fix for pyc race condition, part 2
Turns out fixing this only in importlib is not sufficient and we
need to backport CPython part of the fix too.

This patch is based on https://hg.python.org/cpython/rev/c16063765d3a
but because the code around is different there are some changes (C-strings
instead of Python objects etc.)

With this patch Tensorflow builds successfully on many-core machine.
2019-07-17 10:22:11 +02:00
Frederik Rietdijk
0d832585b7 Merge staging-next into staging 2019-07-17 10:14:29 +02:00
Frederik Rietdijk
7da15d9b36 buildPythonPackage: add support for setupPyGlobalFlags (2) 2019-07-15 17:47:57 +02:00
Mario Rodas
7094a1af0c
python37: fix distutils C++ patch (PR #64758)
Update distutils patch to the upstream changes.
See: 6c0e0d141a
2019-07-15 09:37:43 +02:00
Frederik Rietdijk
271b57c219 Revert "buildPythonPackage: add support for setupPyDistFlags"
I merged this a bit too quick. We need to have a closer look at it.
See the points brought up in https://github.com/NixOS/nixpkgs/pull/64682.

This reverts commit 1e0ebdb8a4.
2019-07-13 13:25:32 +02:00
Kirill Boltaev
1e0ebdb8a4 buildPythonPackage: add support for setupPyDistFlags
Flags passed to the "python setup.py" command.
2019-07-13 09:47:00 +02:00
Frederik Rietdijk
4aee94629d Merge staging-next into staging 2019-07-13 09:46:03 +02:00
Frederik Rietdijk
54065ae20d Merge master into staging-next 2019-07-13 09:45:40 +02:00
Frederik Rietdijk
ec7f569211 python.buildEnv: use NIX_PYTHONPATH 2019-07-13 09:37:33 +02:00
Frederik Rietdijk
46409b5c32 Python: add sitecustomize.py, listen to NIX_PYTHONPATH
This commit adds a Nix-specific module that recursively adds paths that
are on `NIX_PYTHONPATH` to `sys.path`. In order to process possible
`.pth` files `site.addsitedir` is used.

The paths listed in `PYTHONPATH` are added to `sys.path` afterwards, but
they will be added before the entries we add here and thus take
precedence.

The reason for adding support for this environment variable is that we
can set it in a wrapper without breaking support for `PYTHONPATH`.
2019-07-13 09:37:33 +02:00
Frederik Rietdijk
8074133844 pythonPackages.fetchPypi: support SRI hashes 2019-07-11 18:01:04 +02:00
Frederik Rietdijk
30f299027a pythonPackages.fetchPypi: separate url computation from fetchurl 2019-07-11 18:01:04 +02:00
Frederik Rietdijk
f2a8117492 pythonPackages.fetchPypi: put expression in own file
Also fixes an evaluation bug.
2019-07-11 18:01:04 +02:00
Charlie Dyson
0426ae63f8 fix: #64340 building python wheels in non-standard store 2019-07-11 10:27:28 +02:00
Frederik Rietdijk
79a03641d5 Merge staging-next into staging 2019-07-09 15:46:26 +02:00
Frederik Rietdijk
74c24385cb Merge master into staging-next 2019-07-09 15:46:00 +02:00
Frederik Rietdijk
421a87d94c python38: init at 3.8.0b2 2019-07-09 15:31:37 +02:00
Frederik Rietdijk
46d91410af python37: 3.7.3 -> 3.7.4 2019-07-09 10:04:25 +02:00
Frederik Rietdijk
a88e319591 python36: 3.6.8 -> 3.6.9 2019-07-09 10:04:25 +02:00
Timo Kaufmann
9db3a5869e python2: backport fix for pyc race condition
This is python bug https://bugs.python.org/issue13146. Fixed since
python 3.4. It makes pyc creation atomic, preventing a race condition.
The patch has been rebased on our deterministic build patch.

It wasn't backported to python 2.7 because there was a complaint about
changed semantics. Since files are now created in a temporary directory
and then moved, symlinks will be overridden. See
https://bugs.python.org/issue17222.

That is an edge-case however. Ubuntu and debian have backported the fix
in 2013 already, making it mainstream enough for us to adopt.
2019-07-03 08:40:51 +02:00
volth
f3282c8d1e treewide: remove unused variables (#63177)
* treewide: remove unused variables

* making ofborg happy
2019-06-16 19:59:05 +00:00
Matthew Bauer
9f7bb1f512 python27: add override to build statically 2019-06-03 12:28:25 -04:00
Frederik Rietdijk
d801204fdd
Merge pull request #51641 from codedownio/nousersite-master
Allow skipping the use of the PYTHONNOUSERSITE variable
2019-05-13 12:39:25 +02:00
Tom McLaughlin
a3f24daa7b Add flag to disable PYTHONNOUSERSITE for wrapped binaries in python environments 2019-05-13 02:56:56 -07:00
Tom McLaughlin
0045164b15 Add flag to disable PYTHONNOUSERSITE for wrapped python binaries 2019-05-13 02:56:32 -07:00
Frederik Rietdijk
3462fe27d9 Merge staging-next into staging 2019-04-30 15:52:19 +02:00
Ihar Hrachyshka
43f9d5ccaa Generate python3 docs 2019-04-28 09:24:01 +02:00
Daiderd Jordan
a76e11a8c5 python: make it possible to disable the python setup-hook
Without this it's impossible to use a python binary that depends on a
different python version than what's used during the current build.
2019-04-28 09:20:41 +02:00
Dmitry Kalinkin
8fa36fc8a1 python: provide hasCxxDistutils attribute for pythonPackages.numpy
Patching numpy.distutils used to be required for pythonPackages.cython
to build on darwin. It was later accidentally disabled during one of the
refactorings, but that did not break cython. This change reinstantiates
the patch. It still applies, so it should be low maintenance and it can
still be useful.
2019-04-28 09:17:59 +02:00
Jan Tojnar
83914f2c56
buildPython*: allow overriding strictDeps 2019-04-24 22:27:06 +02:00
Frederik Rietdijk
9d87ccabce Merge master into staging-next 2019-04-18 08:25:25 +02:00
bb010g
28ac309309 python3{5,6}: Reintroduce bytecode determinism
Originally introduced in 8970a9c and 1531b5e, these patches were lost in
efbe87f when the CPython version files were merged, likely due to
CPython 3.7 not needing them anymore. These patches should remain
in-tree until CPython 3.5 and 3.6 support is dropped completely.

Found with the diffoscope ( https://diffoscope.org/ ).
2019-04-18 08:12:29 +02:00
Frederik Rietdijk
bae32a9f5c Merge staging-next into staging 2019-04-16 18:54:15 +02:00
Matthew Glazar
fdbcf5ba36 python37: fix build on macOS
The upstream patch for distutils does not apply cleanly to Python
3.7.3's sources. (The patch applies cleanly to Python 3.7.2's sources,
but nixpkgs commit 0ddae82e6a upgraded
Python to 3.7.3.) Fix the patch to make python37 build on macOS.
2019-04-15 10:49:34 -07:00
Corbin
edd5555029 pypy: Disable broken test on 3.x. 2019-04-09 20:41:08 +02:00
Corbin
9c04b75cf9 pypy: 6.0.0 -> 7.0.0
Note that this bumps both the 2.7 and 3.5 flavors of PyPy.
2019-04-09 20:41:08 +02:00
Corbin
5719f892e1 python: Make .isPyPy flag more accurate.
nix-repl> map (s: s.isPyPy) [ python python3 pypy pypy3 ]
[ false false true true ]
2019-04-09 20:41:08 +02:00
Frederik Rietdijk
0ddae82e6a python3: 3.7.2 -> 3.7.3 2019-03-26 16:24:04 +01:00
Frederik Rietdijk
23e431387b Merge staging-next into staging 2019-03-23 09:20:09 +01:00