Commit graph

694 commits

Author SHA1 Message Date
Frederik Rietdijk ccf514a61d python35: 3.5.7 -> 3.5.8 2019-10-29 10:39:50 +01:00
Mario Rodas 0f8dc3cc2e
pypy: fix build on darwin 2019-10-26 04:20:00 -05:00
Frederik Rietdijk 43bbecea5e pythonInterpreters.graalpython37: init
Add an interpreter with package set for graalpython 3.7.
2019-10-22 09:16:18 +02:00
Frederik Rietdijk 5b55013aa2 python2: 2.7.16 -> 2.7.17
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
2019-10-20 19:48:32 +02:00
Frederik Rietdijk aedf4fc8fc Revert "update-python-libraries: use version key for latest release (#68857)"
This broke support for --target.

This reverts commit e8c29fa77c.
2019-10-18 09:53:55 +02:00
Frederik Rietdijk 7181aca6d9 update-python-libraries: handle other format 2019-10-18 09:53:55 +02:00
Frederik Rietdijk 12441bdf9f Merge staging-next into staging 2019-10-16 11:17:12 +02:00
Frederik Rietdijk 41abe12bb3 python37: 3.7.4 -> 3.7.5 2019-10-16 09:14:48 +02:00
Matthew Glazar 81d15948cc python38: fix build on macOS
Python 3.8 fails to build on macOS for two reasons:

* python-3.x-distutils-C++.patch fails to apply cleanly.
* An #include for <util.h> is missing, causing a build failure:

    ./Modules/posixmodule.c:6586:9: error: implicit declaration of function 'openpty' is invalid in C99
        if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
            ^

Use the correct version of python-3.x-distutils-C++.patch, and add a
patch to #include <util.h>.
2019-10-15 13:12:13 +02:00
Frederik Rietdijk 911b053802 python38: 3.8.0rc1 -> 3.8.0 2019-10-15 11:56:01 +02:00
Jan Tojnar 6c8aed6391
Merge branch 'master' into staging-next 2019-10-12 00:50:21 +02:00
Frederik Rietdijk 1b8f8a65ba python38: 3.8.0b3 -> 3.8.0rc1 2019-10-11 13:57:18 +02:00
Frederik Rietdijk 503081fa5b Merge staging into staging-next 2019-09-29 11:05:22 +02:00
Jon 28af6ac647 python3Packages.flit: fix tests and packaging (#69546)
* python3Packages.flit: fix tests

* python: fix flit setup hook
2019-09-26 21:09:03 +00:00
adisbladis 2b2c6e0bc4
pythonPackages.pipBuildHook: Add wheel dependency
And remove missing "options"
2019-09-26 17:17:16 +01:00
Sebastian Jordan 5505d2f036 python: Fix invalid pip call in setuptoolsShellHook 2019-09-22 09:55:13 +02:00
Mario Rodas e8c29fa77c
update-python-libraries: use version key for latest release (#68857)
From warehouse API reference [1]:

     GET /pypi/<project_name>/json

     Returns metadata (info) about an individual project at the latest
     version […]

[1] https://warehouse.pypa.io/api-reference/json/#project
2019-09-16 17:34:15 -05:00
Frederik Rietdijk c99529a4b6 python.pkgs.wheelUnpackHook: propagate wheel
This was accidentally removed when buildPython* was rewritten as hooks.
2019-09-10 22:26:20 +02:00
volth 7b8fb5c06c treewide: remove redundant quotes 2019-09-08 23:38:31 +00:00
Frederik Rietdijk 9894a70299 Merge staging into staging-next 2019-09-06 22:47:40 +02:00
Frederik Rietdijk 66bc7fc1b3 Merge master into staging-next 2019-09-06 22:46:05 +02:00
Frederik Rietdijk b75f9a5f6d pythonInterpreters.pypy*prebuilt: use openssl 1.0 2019-09-06 21:45:10 +02:00
Frederik Rietdijk f7e28bf5d8 Split buildPythonPackage into setup hooks
This commit splits the `buildPythonPackage` into multiple setup hooks.

Generally, Python packages are built from source to wheels using `setuptools`.
The wheels are then installed with `pip`. Tests were often called with
`python setup.py test` but this is less common nowadays. Most projects
now use a different entry point for running tests, typically `pytest`
or `nosetests`.

Since the wheel format was introduced more tools were built to generate these,
e.g. `flit`. Since PEP 517 is provisionally accepted, defining a build-system
independent format (`pyproject.toml`), `pip` can now use that format to
execute the correct build-system.

In the past I've added support for PEP 517 (`pyproject`) to the Python
builder, resulting in a now rather large builder. Furthermore, it was not possible
to reuse components elsewhere. Therefore, the builder is now split into multiple
setup hooks.

The `setuptoolsCheckHook` is included now by default but in time it should
be removed from `buildPythonPackage` to make it easier to use another hook
(curently one has to pass in `dontUseSetuptoolsCheck`).
2019-09-06 15:18:45 +02:00
Matthew Bauer 98662eba0e python: enable loadable sqlite extensions (#67472)
Our sqlite supports it, so might as well make use of it.

Fixes #66526
2019-08-31 07:59:00 -04:00
volth 08f68313a4 treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
Frederik Rietdijk 98640fd482 Merge master into staging-next 2019-08-27 16:36:47 +02:00
Marek Mahut ee62ec62ec python2: CVE-2018-20852
Fixes #67200

(cherry picked from commit 302cac35f5)
2019-08-27 10:04:55 +02:00
Matthew Bauer 48d0e9401e cpython: skip macOS system frameworks
We don’t want cpython picking up /Library/Frameworks and
/System/Library/Frameworks which contains Tcl.framework. Instead it
should use the one provided by Nix. this would not be an issue if
sandboxing was enabled, but unfortunately that has its own issues.

Fixes #66647
2019-08-25 20:35:19 -04:00
Vladimír Čunát 2e6bf42a22
Merge branch 'master' into staging-next
There ver very many conflicts, basically all due to
name -> pname+version.  Fortunately, almost everything was auto-resolved
by kdiff3, and for now I just fixed up a couple evaluation problems,
as verified by the tarball job.  There might be some fallback to these
conflicts, but I believe it should be minimal.

Hydra nixpkgs: ?compare=1538299
2019-08-24 08:55:37 +02:00
Robin Gloster c7e75df21f
Merge remote-tracking branch 'upstream/master' into openssl-1.1 2019-08-23 02:00:31 +02:00
adisbladis 99e6ca2bdc python3Minimal: Add top-level for a minimal Python 3 build
This builds Python without optional dependencies.

We can't just use python3.override, as things like
python3Minimal.withPackages would pass the wrong python derivation into
these modules.
2019-08-21 14:52:49 +02:00
Robin Gloster f4fc845e5b
Merge remote-tracking branch 'upstream/master' into openssl-1.1 2019-08-21 14:25:13 +02:00
Florian Klink 100eae3b77 python: allow stripping tkinter 2019-08-19 00:11:17 +02:00
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
Frederik Rietdijk f65aa21bb2 Merge master into staging-next 2019-08-18 12:53:44 +02:00
adisbladis 5c0d493df4
python: Enable building without openssl 2019-08-18 08:18:58 +01:00
volth 46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +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
Robin Gloster 30969073f0
Merge remote-tracking branch 'upstream/master' into openssl-1.1 2019-08-02 03:01:30 +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
Andreas Rammhold d80649d2a3
pypy: use openssl 1.0.2
While upstream claims support of OpenSSL 1.1 the test suite fails.
2019-07-29 21:25:13 +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
Frederik Rietdijk 2cc6444113 python35 -> 3.5.6 -> 3.5.7 2019-03-23 09:17:35 +01:00
Wael M. Nasreddine 5af0780492
Merge remote-tracking branch 'origin/master' into staging
* origin/master: (693 commits)
  buildGoModule: use go_1_12 instead of go_1_11 (#58103)
  gitAndTools.lab: 0.15.2 -> 0.15.3 (#58091)
  signal-desktop: 1.22.0 -> 1.23.0
  added missing semicolon to documentation
  terminus_font_ttf: 4.46.0 -> 4.47.0
  buildGoModule: remove SSL env vars in favor of cacert in buildInputs (#58071)
  dav1d: init at 0.2.1
  dropbox-cli: 2018.11.28 -> 2019.02.14
  atlassian-confluence: 6.14.1 -> 6.14.2
  maintainers: update email for dywedir
  python.pkgs.hglib: use patch to specify hg path (#57926)
  chkrootkit: 0.52 -> 0.53
  radare2-cutter: 1.7.2 -> 1.8.0
  autorandr: 1.7 -> 1.8
  pythonPackages.pyhepmc: fix build
  llvm-polly/clang-polly: use latest llvm
  apulse: 0.1.11.1 -> 0.1.12, cleanup
  factorio: experimental 0.17.14 → 0.17.16 (#58000)
  sequeler: 0.6.7 -> 0.6.8
  nasc: 0.5.1 -> 0.5.2
  ...
2019-03-21 21:01:25 -07:00
Matthew Glazar 0bf2d63366 python35: fix build on macOS
The upstream patch for distutils does not apply cleanly to Python 3.5's
sources. Fix the patch to make python35 build on macOS.
2019-03-10 13:38:43 +01:00
Vladimír Čunát 8d502fd425
Merge branch 'staging-next' into staging 2019-03-10 08:05:27 +01:00
Frederik Rietdijk a2736d27d1 buildPythonPackage: fix building with flit 2019-03-06 13:42:46 +01:00
Frederik Rietdijk 347680df96 python: 2.7.15 -> 2.7.16 2019-03-05 08:30:04 +01:00
Frederik Rietdijk c2eac6741b Merge master into staging-next 2019-02-24 09:19:12 +01:00
Frederik Rietdijk 1fccd25595 buildPythonPackage: always export LANG=C.UTF-8 2019-02-23 20:08:26 +01:00
Frederik Rietdijk e7b4608d02 buildPythonPackage: initial support for PEP 517 2019-02-23 20:05:19 +01:00
Florian Friesdorf fbef5ab82f Remove myself as maintainer from packages
I'm currently not maintaining any packages.
2019-02-22 16:14:13 +01:00
Frederik Rietdijk b4acd97729 buildPython*: enable strictDeps 2019-02-17 14:40:48 +01:00
Averell Dalton 91aeda1432 python: sysconfig: fix paths 2019-02-07 18:52:08 +01:00
Frederik Rietdijk 9cfae76fc5 Merge staging-next into staging 2019-01-17 09:21:29 +01:00