Commit Graph

1529 Commits

Author SHA1 Message Date
Martin Weinelt
faadcf03b6
Merge pull request #289531 from mweinelt/python312full-bluez
cpython: allow full variant on all platformns where bluez is available
2024-02-22 16:37:11 +01:00
github-actions[bot]
ba5eeff4f5
Merge master into staging-next 2024-02-20 06:01:15 +00:00
Martin Weinelt
fa83add1b9
Merge pull request #271597 from adisbladis/python-runtime-build-time-sep
python3.pkgs.buildPythonPackage: Separate runtime & build time dependencies
2024-02-20 05:05:20 +01:00
github-actions[bot]
68a2e7449b
Merge staging-next into staging 2024-02-18 06:01:34 +00:00
adisbladis
4d0cca4654 mk-python-derivation: Add build-system argument
Much like the previous commit that adds dependencies &
optional-dependencies this aligns PEP-517 build systems with how they
are defined in PEP-518/PEP-621.

The naming `build-system` (singular) is aligned with upstream Python standards.
2024-02-18 17:40:42 +13:00
adisbladis
b9138b7c07 mk-python-derivation: Add dependencies & optional-dependencies arguments
Since https://github.com/NixOS/nixpkgs/pull/161835 we've had the
concept of `passthru.optional-dependencies` for Python optional deps.

Having to explicitly put optional-dependencies in the passthru attrset
is a bit strange API-wise, even though it semantically makes sense.

This change unifies the handling of non-optional & optional Python
dependencies using the names established from PEP-621 (standardized pyproject.toml project metadata).
2024-02-18 17:40:42 +13:00
Martin Weinelt
bc775ec0dd
cpython: allow full variant on all platformns where bluez is available
Closes: #289113
2024-02-17 14:05:32 +01:00
adisbladis
e23b901321 python3.hooks: Dont completely overwrite passthru when creating setup hook 2024-02-17 21:19:26 +13:00
adisbladis
48a49f76d7 python3.pkgs.pypaBuildHook: Fix passthru.tests 2024-02-17 21:19:24 +13:00
DavHau
ffa815958e pythonCatchConflictsHook: make compatible to all python 3 versions 2024-02-13 11:15:41 +07:00
DavHau
0cbd114d41 pythonCatchConflictsHook: improve and add tests 2024-02-13 11:15:41 +07:00
phaer
2651ddc7b0 python/catch_conflicts: scan $out, not sys.path
This changes the non-legacy version of pythonCatchConflictsHook
to recursively scan the output of the target derivation  as well
as its propagatedBuildInputs for duplicate dependencies.

Previously, we did scan sys.path but did prove problematic as it
produced false positives i.e. when build-time dependencies of
hooks - such as setuptools in pythonCatchConflictsHook itself -
where mistakenly flagged as duplicates; even though the are
not included in the outputs of the target dervation.

As all python runtime-dependencies are currently passed via
propagatedBuildInputs in nixpkgs, scanning that plus
site-packages seems sufficient to catch all conflicts that
matter at runtime and less likely to produce false positives.

The legacyHook in catch_conflicts_py2.py needs to be migrated
as well, if it's still needed.
2024-02-12 19:52:28 +07:00
Martin Weinelt
45fd60685f
python312: 3.12.1 -> 3.12.2
https://docs.python.org/release/3.11.8/whatsnew/changelog.html
2024-02-08 00:54:57 +01:00
Martin Weinelt
8751812a3b
python311: 3.11.7 -> 3.11.8
https://docs.python.org/release/3.11.8/whatsnew/changelog.html
2024-02-07 18:49:49 +01:00
github-actions[bot]
03dd2b9470
Merge master into staging-next 2024-02-07 12:01:11 +00:00
Sandro
d5917b14b3
mk-python-derivation: fix passthru.updateScript being merged into the derivation (#241922)
Before updateScript was being merged to pdm.updateScript.
With this commit it is being moved to the expected location pdm.passthru.updateScript
2024-02-07 08:14:34 +01:00
Martin Weinelt
76f6ad253d
python312: use vendored mpdecimal library on darwin
Building with --with-system-mpdecimal fails on both darwin architectures,
independent of the mpdecimal version used.
2024-02-06 20:44:08 +01:00
Martin Weinelt
9b516e4288
cpython: build with our own libmpdecimal 2024-02-02 12:28:09 +01:00
Martin Weinelt
2d6fa6f35d
cpython: refactor & clean up
- group dependencies logically
- remove `? null` fallback value
- remove redundant isPy3k conditions
- remove overly broad `with lib` import
- more assertion messages
- move python310 out of sources attrset
2024-02-02 12:28:09 +01:00
Martin Weinelt
97625d0307
cpython: prune patches and configure flags
- Using the system-provided ffi has been the default since 3.6
2024-02-02 12:28:08 +01:00
Martin Weinelt
f2f4cf0515
cpython: resolve substituteStream --replace deprecation 2024-02-02 12:28:08 +01:00
Martin Weinelt
b22414ea35
cpython: unpin legacy openssl
Various packages failed to build due to the removal of hashes like MD5,
but they now work or have been dropped.
2024-02-02 12:28:07 +01:00
Felix Buehler
d35003e302 python311Packages.recursive-pth-loader: rename from recursivePthLoader 2024-01-25 22:13:17 +01:00
Martin Weinelt
4757e347cf
python313: 3.13.0a2 -> 3.13.0a3
https://docs.python.org/3.13/whatsnew/changelog.html#python-3-13-0-alpha-3
2024-01-19 02:05:51 +01:00
Martin Weinelt
10b01dcc89
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
-	pkgs/development/python-modules/types-setuptools/default.nix
2024-01-10 16:09:52 +01:00
Wim de With
90af01b76c update-python-libraries: support applications outside python-modules 2024-01-10 15:01:54 +01:00
K900
838aefefc3 Merge remote-tracking branch 'origin/master' into staging-next 2024-01-09 22:42:37 +03:00
Sergei Trofimovich
c64c04e8bf
pythonInterpreters.pypy39_prebuilt: fix tests eval (#278950)
Without the change `test-pythonPackagesExtensions` test fails the eval
as:

    $ nix build -f. pythonInterpreters.pypy39_prebuilt.tests --show-trace
    error:
       … while evaluating an attribute name
         at pkgs/development/interpreters/python/tests.nix:151:16:
          150|       });
          151|     in pkgs_.${python.pythonAttr}.pkgs.foo;
             |                ^
          152|   });

       error: value is null while a string was expected

This happens because `pypy39_prebuilt` exposes `pythonAttr` attribute,
but it has a `null` value. Fix the test to filter out prebuilt pypy.
2024-01-09 18:46:49 +01:00
Martin Weinelt
ef1898454c
Merge remote-tracking branch 'origin/master' into staging-next
Conflicts:
-	pkgs/development/python-modules/aiohappyeyeballs/default.nix
2024-01-08 16:34:52 +01:00
Thiago Kenji Okada
a1f364d694 python2.7: remove thiagokokada from maintainers 2024-01-07 21:36:14 +00:00
Weijia Wang
eb5334c27d Merge branch 'master' into staging-next 2024-01-03 03:22:40 +01:00
Sergei Trofimovich
29a2c82603
pythonInterpreters.pypy39_prebuilt: fix eval (#277543)
Without the change the eval fails as:

    $ nix build --no-link -f. pythonInterpreters.pypy39_prebuilt.buildEnv
    error:
       error: attribute 'pypy38_prebuilt' missing
          208|     # Not included at top-level
          209|     self = __splicedPackages.pythonInterpreters.pypy38_prebuilt;
             |            ^
          210|     sourceVersion = {
       Did you mean one of pypy39_prebuilt or pypy27_prebuilt?
2024-01-02 17:20:05 +01:00
github-actions[bot]
f50aae4fb1
Merge master into staging-next 2023-12-29 18:00:57 +00:00
Sergei Trofimovich
089b731d87 python/hooks: fix test attribute eval
Without the change `tests` attribute fails the eval as:

    $ nix build --no-link -f. pypy27Packages.pypaBuildHook.tests
    error:
           69|       #   versions of this hook's dependencies.
           70|       passthru.tests = import ./pypa-build-hook-tests.nix {
             |                        ^

Fixed file name and added missing runCommand import.
2023-12-29 11:27:59 +00:00
Martin Weinelt
1128c5bfed
python311: 3.11.6 -> 3.11.7
https://docs.python.org/release/3.11.7/whatsnew/changelog.html
2023-12-20 20:46:22 +01:00
Martin Weinelt
48b43e51e5
pythonRelaxDepsHook: make distribution name matching case insensitive
Is it PyOpenSSL or pyOpenSSL or pyopenssl? With this change you don't
have to care. Write it as pYoPeNSsL for all I care¹.

Can we do it like that? Yes, we can. Distribution names should be matched
with `re.IGNORECASE` according to the wheel specification².

[1] https://packaging.python.org/en/latest/specifications/core-metadata/#name
[2] Just kidding, please make it look sane.
2023-12-20 20:46:12 +01:00
Martin Weinelt
8f3162f83f
python3.pkgs.pythonRuntimeDepsCheckHook: init
Implements a hook, that checks whether all dependencies, as specified by
the wheel manifest, are present in the current environment.

Complains about missing packages, as well as version specifier
mismatches.
2023-12-20 20:10:22 +01:00
Martin Weinelt
e8dd1cf066 Merge remote-tracking branch 'origin/staging-next' into staging 2023-12-12 14:13:07 +01:00
adisbladis
6b9f45ae37 python3.pkgs.buildsetupcfg: Remove function from python-packages-base.nix
This function is not, and never have been, used anywhere inside nixpkgs, outside of bootstrapping setupcfg2nix itself.
It was added in https://github.com/NixOS/nixpkgs/pull/38778 by @shlevy.

It has no out-of-tree users on Github either. External breakage is not expected.
2023-12-12 12:21:38 +13:00
Sandro Jäckel
904e7ce05b
pypy: add option to change optimization level, update homepage, cleanup 2023-12-10 03:10:47 +01:00
Martin Weinelt
a3feaa36a0
python312: 3.12.0 -> 3.12.1
https://docs.python.org/release/3.12.1/whatsnew/changelog.html

Fixes: CVE-2023-6507
2023-12-08 17:03:13 +01:00
Martin Weinelt
ac82700414
update-python-libraries: quiet nix stderr output
We query lots of derivation attributes, most of which do not exist, so
logging stderr causes a lot of noise for no gain.
2023-12-02 03:29:43 +01:00
Martin Weinelt
50311a8d07
update-python-libraries: format with black/isort 2023-12-02 03:22:02 +01:00
Martin Weinelt
180ccef717
update-python-libraries: add package changelog to commit message 2023-12-02 03:22:02 +01:00
Martin Weinelt
929da50216
update-python-libraries: don't update packages with cargoDeps
This is unsupported and breaks packages on update.
2023-12-02 03:22:01 +01:00
Martin Weinelt
f69da37098
cpython: restore passthru.tests
Fixes a regression from #261323, where all `passthru.tests` were
overwritten.
2023-11-28 02:09:29 +01:00
Pavol Rusnak
b608fc233c
Merge pull request #269255 from prusnak/rustpython-darwin
rustpython: mark broken on x86_64-darwin
2023-11-26 18:46:09 +01:00
Alexandre Macabies
fc235bb0fc python/hooks: use python.pythonVersion to support PyPy
f292ef4 introduced a check for the Python version but uses `.version`,
which isn't friendly to other Pythons like PyPy which use versions
strings like 7.3, failing the >=3.10 check.

Using `.pythonVersion` fixes this check.

Co-authored-by: Pierre Bourdon <delroth@gmail.com>
2023-11-25 13:38:39 +01:00
Martin Weinelt
0818809eae
python313: 3.13.0a1 -> 3.13.0a2
https://www.python.org/downloads/release/python-3130a2/
2023-11-23 13:27:19 +01:00
Pavol Rusnak
b27c3af657
rustpython: mark broken on x86_64-darwin 2023-11-22 19:20:39 +01:00
Gaetan Lepage
f99f9ced56 rustpython: 0.2.0 -> 0.3.0 2023-11-22 17:08:07 +01:00
Martin Weinelt
d9327a53de Revert "python2/mk-python-derivation: disable catchConflictsHook"
This reverts commit 397a8fd06b.

The hook now uses the old implementation based on the deprecated
pkg_resources library provided by setuptools again.
2023-11-18 12:58:15 +01:00
Martin Weinelt
f292ef4958
python/hooks: restore catchConflictHook for python<3.10
By restoring and diverting to the old version.

Previously the newer language features and use of more modern stdlib
imports broke the hook on Python<3.10.
2023-11-18 12:57:18 +01:00
K900
397a8fd06b python2/mk-python-derivation: disable catchConflictsHook
It's broken on Py2. Hopefully people still using 2 know what they're doing?
2023-11-17 07:48:13 +03:00
github-actions[bot]
6a7c026ba7
Merge master into staging-next 2023-11-14 06:01:03 +00:00
Silvan Mosberger
7eddbf5690
Merge pull request #265710 from ShamrockLee/lib-copy-function-args
lib.mirrorFunctionArgs: init
2023-11-14 05:33:40 +01:00
github-actions[bot]
5725d489f3
Merge staging-next into staging 2023-11-09 12:01:36 +00:00
Alyssa Ross
e3e57b8f18 lib.systems: elaborate Rust metadata
We need this stuff to be available in lib so make-derivation.nix can
access it to construct the Meson cross file.

This has a couple of other advantages:

 - It makes Rust less special.  Now figuring out what Rust calls a
   platform is the same as figuring out what Linux or QEMU call it.

 - We can unify the schema used to define Rust targets, and the schema
   used to access those values later.  Just like you can set "config"
   or "system" in a platform definition, and then access those same
   keys on the elaborated platform, you can now set "rustcTarget" in
   your crossSystem, and then access "stdenv.hostPlatform.rustcTarget"
   in your code.

"rustcTarget", "rustcTargetSpec", "cargoShortTarget", and
"cargoEnvVarTarget" have the "rustc" and "cargo" prefixes because
these are not exposed to code by the compiler, and are not
standardized.  The arch/os/etc. variables are all named to match the
forms in the Rust target spec JSON.

The new rust.target-family only takes a list, since we don't need to
worry about backwards compatibility when that name is used.

The old APIs are all still functional with no warning for now, so that
it's possible for external code to use a single API on both 23.05 and
23.11.  We can introduce the warnings once 23.05 is EOL, and make them
hard errors when 23.11 is EOL.
2023-11-09 10:02:24 +01:00
Randy Eckenrode
34b48d4af6
python2: fix build with clang 16 on x86_64-darwin
Apply the patch to fix using libutil.h instead of util.h on Darwin for
`forkpty` and `openpty`.
2023-11-08 19:08:48 -05:00
github-actions[bot]
d49b3ff9e3
Merge staging-next into staging 2023-11-08 12:02:19 +00:00
Fabián Heredia Montiel
2188896a57 python3Packages.sphinxHook: fix eval after merge of bc2d598878 2023-11-08 01:51:41 -06:00
Adam Joseph
ba2ed469c2
Merge branch 'master' into staging-next 2023-11-08 06:15:46 +00:00
Weijia Wang
8012034692 Merge branch 'staging-next' into staging 2023-11-07 03:41:49 +01:00
Yueh-Shun Li
b3e2c15000 makeOverridablePythonPackage: preserve function arguments 2023-11-07 01:58:48 +00:00
Adam Joseph
f0011fd103 python: deprecate pythonForBuild in favor of pythonOnBuildForHost 2023-11-07 02:28:58 +02:00
Weijia Wang
32da89a1a1 Merge branch 'master' into staging-next 2023-11-06 14:33:18 +01:00
Adam Joseph
bc2d598878 treewide: change pythonForBuild to pythonOnBuildForHost 2023-11-05 17:42:12 -08:00
Adam Joseph
563a66dc31 python: add python.pythonOnBuildForHost 2023-11-04 21:29:33 -07:00
Weijia Wang
9627659c22 Merge branch 'master' into staging-next 2023-11-04 17:27:09 +01:00
natsukium
56b570d6af
python311Packages.python-docs-theme: rename from python_docs_theme 2023-11-04 12:34:41 +09:00
Martin Weinelt
646c23a2f7
buildPythonPackage: port catch-conflicts to importlib.metadata
To escape the pkg_resources API deprecation:

> catch-conflicts.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html

Also remove exceptions for the previus bootstrap packages.
2023-10-30 12:42:36 +01:00
Frederik Rietdijk
7a0d080298 python3.pkgs.buildPython*: allow overriding of the stdenv
With this change it is possible to pass in `stdenv` directly to
`buildPython*` or override it using e.g.

```
numpy.overridePythonAttrs(_: {
  stdenv = clangStdenv;
})
```
2023-10-19 18:56:47 +02:00
github-actions[bot]
3c8c81154a
Merge staging-next into staging 2023-10-18 12:02:01 +00:00
github-actions[bot]
8e8fc73296
Merge master into staging-next 2023-10-18 12:01:25 +00:00
Martin Weinelt
13c8e4299a
python313: init at 3.13.0a1
https://docs.python.org/3.13/whatsnew/changelog.html#python-3-13-0-alpha-1
2023-10-17 23:06:20 +02:00
github-actions[bot]
ba519bf3b1
Merge staging-next into staging 2023-10-17 00:02:46 +00:00
github-actions[bot]
8c62479810
Merge master into staging-next 2023-10-17 00:02:14 +00:00
Meet Barot
a76390f69c python3*: Add meta.pkgConfigModules and test 2023-10-16 00:36:25 -04:00
github-actions[bot]
c68d98e9d4
Merge staging-next into staging 2023-10-13 18:01:31 +00:00
Yureka
ef60280d57
python311: fix cross to/from musl (#260641)
The situation:

Python <3.11: under Linux the abi string is always -gnu*

Python 3.11-3.12: musl is treated as its own abi in the python build system, but when cross-compiling the build host's libc is used for the target abi string. Cross compiling from glibc to musl gives a -gnu* target abi string and vice versa.

Python >=3.13: musl is treated as its own abi, and when cross-compiling the target libc is used for the target abi string

We backport the fix for python 3.11-3.12, since the intermediate state is almost impossible to model in the nix expression
2023-10-13 17:47:11 +02:00
Artturi
183df628da
Merge pull request #258223 from OroraTech/fix/propagated-sphinx 2023-10-13 07:18:12 +03:00
github-actions[bot]
e1565d6a86
Merge staging-next into staging 2023-10-09 18:01:36 +00:00
github-actions[bot]
75d4639be3
Merge master into staging-next 2023-10-09 18:00:59 +00:00
Yureka
1d3c3d4f5b python: simplify ABI name detection 2023-10-09 15:12:20 +00:00
Martin Weinelt
edd561abce
python311: 3.11.5 -> 3.11.6
https://docs.python.org/release/3.11.6/whatsnew/changelog.html
2023-10-03 10:31:23 +02:00
github-actions[bot]
23a7292114
Merge master into staging-next 2023-10-02 18:01:04 +00:00
Martin Weinelt
1fcb41f796
python312: 3.12.0-rc3 -> 3.12.0
https://docs.python.org/dev/whatsnew/3.12.html
https://docs.python.org/release/3.12.0/whatsnew/changelog.html
2023-10-02 17:47:17 +02:00
Leandro Reina
48f25989c3 python3Packages.sphinxHook: Avoid propagating sphinx
Fixes some side effects of #249157 (see #255810)
2023-09-30 18:21:18 +02:00
natsukium
836da00391 python311: 3.11.4 -> 3.11.5
https://docs.python.org/release/3.11.5/whatsnew/changelog.html

Fixes: CVE-2023-40217
2023-09-27 15:32:44 +02:00
natsukium
6086908c98 python310: 3.10.12 -> 3.10.13
https://docs.python.org/release/3.10.13/whatsnew/changelog.html

Fixes: CVE-2023-40217
2023-09-27 15:32:44 +02:00
Martin Weinelt
d77e13848d python3: 3.10 -> 3.11
Updates the default python version to 3.11, while keeping 3.10 around
until after the NixOS 23.11 release.
2023-09-27 15:32:44 +02:00
github-actions[bot]
cc5ae613ff
Merge master into staging-next 2023-09-26 00:02:17 +00:00
Thiago Kenji Okada
d72b2ed9ac python27: disable tests that expect Python 3+ 2023-09-25 14:51:43 +01:00
github-actions[bot]
3e52e5929d
Merge master into staging-next 2023-09-25 12:01:02 +00:00
Thiago Kenji Okada
795e0c0851 pypy310: init at 3.7.12 2023-09-25 12:21:36 +01:00
Thiago Kenji Okada
2b0c3f0001 pypy39: 3.7.11 -> 3.7.12 2023-09-25 12:07:50 +01:00
Thiago Kenji Okada
e0874acbdd pypy27: 7.3.11 -> 7.3.12 2023-09-25 12:03:58 +01:00
Thiago Kenji Okada
9b15be3aa9 pythonInterpreters.pypy39_prebuilt: 7.3.11 -> 7.3.12 2023-09-25 12:03:19 +01:00
Thiago Kenji Okada
6ae570f76b pythonInterpreters.pypy27_prebuilt: 3.7.11 -> 3.7.12 2023-09-25 11:50:03 +01:00
Peder Bergebakken Sundt
bdda7b0a53 python3Packages.flitBuildHook: remove 2023-09-22 21:11:24 +02:00