Commit Graph

737 Commits

Author SHA1 Message Date
Frederik Rietdijk
79217339d2 Merge master into staging-next 2020-02-29 15:29:11 +01:00
Emily
6d3fc35620 pypy{,3}: use openssl_1_1
"We now support building PyPy with OpenSSL 1.1 in our built-in _ssl
module, as well as maintaining support for previous versions."
-- https://pypy.readthedocs.io/en/latest/release-pypy2.7-v5.6.0.html
2020-02-28 16:06:20 +00:00
Jonathan Ringer
cd97c055a0 python: execute pythonImportsCheckPhase in subshell
Execute in subshell so that the cwd returns back
to the original directory. This is important as
it enables pythonImportsCheck to work with checkPhase
2020-02-19 22:30:50 -08:00
Frederik Rietdijk
38cf6eac19 Merge master into staging-next 2020-02-06 19:43:36 +01:00
Frederik Rietdijk
9827e4994b python39: 3.9.0a2 -> 3.9.0a3 2020-02-06 10:25:18 +01:00
Maximilian Bosch
6b0cd9ad47
Merge branch 'staging' into glibc230
Conflicts:
	pkgs/applications/misc/vit/default.nix
2020-01-28 14:54:51 +01:00
Frederik Rietdijk
dce0ca29d9 Merge master into staging-next 2020-01-28 10:46:13 +01:00
Maximilian Bosch
eddfcc32b4
Merge branch 'staging' into glibc230 2020-01-23 11:31:13 +01:00
Frederik Rietdijk
bc18cc72dd
Merge pull request #77610 from LnL7/darwin-stdenv-python3
darwin-stdenv: bootstrap with python3
2020-01-15 09:24:57 +01:00
Frederik Rietdijk
eba1f79418 pythonPackages.venvShellHook: init
This is a hook that loads a virtualenv from the specified `venvDir`
location. If the virtualenv does not exist, it is created.
2020-01-14 22:36:21 +01:00
Luka Blaskovic
76d90cf1f5 cpython: fetch darwin-libutil.patch to nixpkgs
python3 is now required buildInput for glibc>=2.29.
Remove fetchpatch to solve infinite recursion in
glibc bootstrap process.
2020-01-14 08:26:58 +00:00
Daiderd Jordan
6328518e98
stdenv: bootstrap darwin with python3
- Replaced python override from the final stdenv, instead we
  propagate our bootstrap python to stage4 and override both
  CF and xnu to use it.

- Removed CF argument from python interpreters, this is redundant
  since it's not overidden anymore.

- Inherit CF from stage4, making it the same as the stdenv.
2020-01-13 11:34:36 +01:00
adisbladis
2d6f1ff4dd
python: Add support for installing Python eggs 2020-01-08 13:59:04 +00:00
Jan Tojnar
f4e74edd8c python.pkgs.wrapPython: get rid of warning
When `makeWrapperArgs` variable is not set, `declare -p makeWrapperArgs`
will return with 1 and print an error message to stderr.

I did not handle the non-existence case in b0633406cb
because I thought `mk-python-derivation` will always define `makeWrapperArgs`
but `wrapProgram` can be called independently. And even with `mk-python-derivation`,
`makeWrappers` will not be set unless explicitly declared in the derivation
because of https://github.com/NixOS/nix/issues/1461.

I was lead to believe that because the builds were succeeding and I confirmed
that the mechanism fails when the variable is not defined and `-o nounset` is enabled.
It appears that `wrapPython` setup hook is not running under `-o nounset`, though,
invaldating the assumption.

Now we are checking that the variable exists before checking its type, which
will get rid of the warning and also prevent future error when `-o nounset`
is enabled in the setup hook.

For more information, see the discussion at
https://github.com/NixOS/nixpkgs/commit/a6bb2ede232940a96150da7207a3ecd15eb6328
2019-12-30 16:46:55 +01:00
Jan Tojnar
a6bb2ede23
python.pkgs.wrapPython: fix string makeWrapperArgs
Bash takes an assignment of a string to an array variable:

local -a user_args
user_args="(foo bar)"

to mean appending the string to the array, not parsing the string into
an array as is the case when on the same line as the declaration:

local -a user_args="(foo bar)"

b0633406cb extracted the declaration before
the newly branched code block, causing string makeWrapperArgs being added
to the array verbatim.

Since local is function scoped, it does not matter if we move it inside
each of the branches so we fix it this way.
2019-12-28 22:23:36 +01:00
worldofpeace
4a2621da53
Merge pull request #76283 from jtojnar/python-mwa
python.pkgs.wrapPython: fix makeWrapperArgs
2019-12-26 19:21:37 -05:00
Jan Tojnar
4bbc6cc66f
Merge branch 'staging-next' into staging 2019-12-25 05:18:52 +01:00
Jan Tojnar
ca39dd3a8a
Merge branch 'master' into staging-next 2019-12-25 05:15:06 +01:00
Jan Tojnar
b0633406cb
python.pkgs.wrapPython: fix makeWrapperArgs
When `makeWrapperArgs` is a Bash array, we only passed the first
item to `wrapProgram`. We need to use `"${makeWrapperArgs[@]}"`
to extract all the items. But that breaks the common string case so
we need to handle that case separately.
2019-12-23 18:02:44 +01:00
Frederik Rietdijk
ad733b5505 python37: 3.7.5 -> 3.7.6 2019-12-19 17:37:02 +01:00
Frederik Rietdijk
c0c65fe83c python39: 3.9.0a1 -> 3.9.0a2 2019-12-19 17:36:21 +01:00
Frederik Rietdijk
2012dd5734 python38: 3.8.0 -> 3.8.1 2019-12-19 17:36:21 +01:00
Frederik Rietdijk
5796029c5d python36: 3.6.9 -> 3.6.10 2019-12-19 17:36:20 +01:00
Andreas Rammhold
e9f522eee1
python: remove _manylinux.py
This will turn manylinux support back on by default.

PIP will now do runtime checks against the compatible glibc version to
determine if the current interpreter is compatible with a given
manylinux specification. However it will not check if any of the
required libraries are present.

The motivation here is that we want to support building python packages
with wheels that require manylinux support. There is no real change for
users of source builds as they are still buildings packages from source.

The real noticeable(?) change is that impure usages (e.g. running `pip
install package`) will install manylinux packages that previously
refused to install.
Previously we did claim that we were not compatible with manylinux and
thus they wouldn't be installed at all.

Now impure users will have basically the same situation as before: If
you require some wheel only package it didn't work before and will not
properly work now. Now the program will fail during runtime vs during
installation time.

I think it is a reasonable trade-off since it allows us to install
manylinux packages with nix expressions and enables tools like
poetry2nix.

This should be a net win for users as it allows wheels, that we
previously couldn't really support, to be used.
2019-12-16 16:37:16 +01:00
Tobias Pflug
418ad571c3 Fix manylinux packages
Make sure lib outputs are used where applicable.
2019-12-13 11:40:44 +01:00
Frederik Rietdijk
6530535b20
manylinux packages for Python
This adds three lists with manylinux dependencies as well as three
packages that include all the manylinux dependencies.
2019-12-05 09:56:20 +00:00
Frederik Rietdijk
92d2153e6c pythonInterpreters: remove unnecessary rec 2019-12-02 20:10:51 +01:00
Frederik Rietdijk
1d18c5a0fe Merge staging-next into staging 2019-11-24 10:13:31 +01:00
Frederik Rietdijk
182571cdc3 update-python-libraries: ignore pyproject 2019-11-22 08:37:03 +01:00
Frederik Rietdijk
1939a97811 python3: add pythonForBuild as parameter, fixes python3Minimal
`pythonForBuild` exists for cross-compilation. When one overrides
python, one needs to ensure pythonForBuild matches.
2019-11-21 22:00:23 +01:00
Frederik Rietdijk
ad3ef645b0 python3Minimal: 3.7.4 -> 3.7.5
Base it on python37 so we ensure the package remains up to date.
2019-11-21 15:34:37 +01:00
Frederik Rietdijk
65edeb8633 Merge master into staging-next 2019-11-20 10:01:49 +01:00
Frederik Rietdijk
648152fdbb python39: init at 3.9.0a1
It's a year until the final release but this will give a chance to test
out certain features and how it integrates with other packages.
https://www.python.org/dev/peps/pep-0596/
2019-11-20 09:42:27 +01:00
Jan Tojnar
ae465621ff
pythonPackages.pipBuildHook: fix unbound variable
for compatibility with set -u
2019-11-20 05:06:51 +01:00
Frederik Rietdijk
c4e30cf98c Merge staging-next into staging 2019-11-05 14:18:08 +01:00
Frederik Rietdijk
03a9822405 Merge master into staging-next 2019-11-05 14:17:37 +01:00
John Ericson
acd2d19484
Merge pull request #72347 from NixOS/bash-no-undef-vars
treewide: `set -u` everywhere
2019-11-04 19:52:33 -05:00
Jonathan Ringer
deb201b311 update-python-libraries: update usage comments 2019-11-03 12:03:27 -08:00
Frederik Rietdijk
9d59d57d45 Merge staging-next into staging 2019-11-03 14:01:28 +01:00
Frederik Rietdijk
7827d3f449 python35: 3.5.8 -> 3.5.9
There were no new changes in version 3.5.9; 3.5.9 was released only because of a CDN caching problem,
which resulted in some users downloading a prerelease version of the 3.5.8 .xz source tarball.
Apart from the version number, 3.5.9 is identical to the proper 3.5.8 release.
2019-11-03 11:21:05 +01:00
Dmitry Kalinkin
3466faf9d8 pythonPackages.setuptoolsBuildHook: fix debug message 2019-11-03 10:34:44 +01:00
John Ericson
b7f4bda282 treewide: *Phase(s)? variables are optional
If these aren't defined, the stdenv defaults are used in the `*Phase`
case, or no extra phases are done, in the `*Phases` case.
2019-11-01 14:44:44 -04:00
John Ericson
2811b032d6 treewide: Make still dont* Variables are optional in most cases
Go beyond the obvious setup hooks now, with a bit of sed, with a skipped case:

 - cc-wrapper's `dontlink`, because it already is handled.

Also, in nix files escaping was manually added.

EMP
2019-11-01 14:44:44 -04:00
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