Commit Graph

2158 Commits

Author SHA1 Message Date
kirillrdy
b5c54289bb Merge pull request #296225 from oliviacrain/py39-docs-sphinx-fix
python39.doc: fix build with sphinx >= 5.3.0
2024-03-23 20:18:17 +11:00
natsukium
ffdc76613b python310: 3.10.13 -> 3.10.14
https://docs.python.org/release/3.10.14/whatsnew/changelog.html
https://blog.python.org/2024/03/python-31014-3919-and-3819-is-now.html

fixes: CVE-2023-52425, CVE-2024-0450, CVE-2023-6597
2024-03-23 15:58:41 +09:00
natsukium
f99f5b4409 python39: 3.9.18 -> 3.9.19
https://docs.python.org/release/3.9.19/whatsnew/changelog.html
https://blog.python.org/2024/03/python-31014-3919-and-3819-is-now.html

fixes: CVE-2023-52425, CVE-2024-0450, CVE-2023-6597
2024-03-23 15:58:40 +09:00
Martin Weinelt
7c63b00262 Merge pull request #298086 from mweinelt/python-runtime-deps-skip-empty-specifier
python3.pkgs.pythonRuntimeDepsCheckHook: skip empty specifiers
2024-03-22 18:56:07 +01:00
Martin Weinelt
2c68d6b029 python311Packages.packaging: 23.2 -> 24.0
https://github.com/pypa/packaging/blob/24.0/CHANGELOG.rst

The `requires_dist` field now defaults to `None`, if the package does
not specify any requirements.
2024-03-22 16:34:52 +01:00
Martin Weinelt
bcd6e799e0 python3.pkgs.pythonRuntimeDepsCheckHook: skip empty specifiers
Prevent the hook from erroring out on missing specifiers, as reported for
`highspy`, which currently ships with a pre-release version, triggering
the following error message:

  - highspy not satisfied by version 1.7.1.dev1
2024-03-22 16:30:55 +01:00
Domen Kožar
fb884172ab Merge pull request #297628 from cwp/python-env-venv
Fix venv creation in Python environments
2024-03-22 19:17:13 +07:00
github-actions[bot]
8c5e10ca32 Merge staging-next into staging 2024-03-22 06:01:35 +00:00
Martin Weinelt
ebde006977 Merge pull request #289190 from mweinelt/python-3.13.0a4
python313: 3.13.0a3 -> 3.13.0a5
2024-03-22 03:40:42 +01:00
Colin Putney
96118850f3 Unwrap python scripts when building an environment
When building a python environment's bin directory, we now detect
wrapped python scripts from installed packages, and generate unwrapped
copies with the environment's python executable as the interpreter.
2024-03-21 19:27:06 -06:00
Colin Putney
234bb31f61 Fix venv creation in Python environments
The way we build python environments is subtly broken. A python
environment should be semantically identical to a vanilla Python
installation in, say, /usr/local. The current implementation, however,
differs in two important ways. The first is that it's impossible to use
python packages from the environment in python virtual environments. The
second is that the nix-generated environment appears to be a venv, but
it's not.

This commit changes the way python environments are built:

  * When generating wrappers for python executables, we inherit argv[0]
    from the wrapper. This causes python to initialize its configuration
    in the environment with all the correct paths.
  * We remove the sitecustomize.py file from the base python package.
    This file was used tweak the python configuration after it was
    incorrectly initialized. That's no longer necessary.

The end result is that python environments no longer appear to be venvs,
and behave more like a vanilla python installation. In addition it's
possible to create a venv using an environment and use packages from
both the environment and the venv.
2024-03-21 19:26:57 -06:00
Olivia Crain
b51c572c62 python39.doc: fix build with sphinx >= 5.3.0
Backport upstream fix for cpython issue 98366 from 3.10 tree
2024-03-20 10:28:16 -05:00
github-actions[bot]
66eeab8faf Merge staging-next into staging 2024-03-19 06:01:43 +00:00
stuebinm
ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00
Sandro
24fd994fc4 Merge pull request #295562 from SuperSandro2000/python27
python27: 2.7.18.7 -> 2.7.18.8
2024-03-17 08:53:14 +01:00
Sandro Jäckel
61baca011c python27: 2.7.18.7 -> 2.7.18.8
Diff: https://github.com/ActiveState/cpython/compare/v2.7.18.7...v2.7.18.8
2024-03-15 13:13:12 +01:00
Sandro Jäckel
be51056b85 pythonRelaxDepsHook: don't rely on pname as that could be normalized already
according to the language docs
2024-03-15 11:27:27 +01:00
natsukium
8837f2fef2 python313: add a flag to disable GIL 2024-03-13 23:32:38 +09:00
Martin Weinelt
b89f66b768 python313: 3.13.0a3 -> 3.13.0a5
https://docs.python.org/3.13/whatsnew/changelog.html#python-3-13-0-alpha-4
https://docs.python.org/3.13/whatsnew/changelog.html#python-3-13-0-alpha-5
2024-03-13 14:43:51 +01:00
github-actions[bot]
09c267dae0 Merge master into staging-next 2024-03-06 06:01:19 +00:00
adisbladis
de402796a7 mk-python-derivation: Break out attribute set cleaning into a separate function
With precomputed static lists.
2024-03-06 14:22:43 +13:00
adisbladis
1656fe1bf6 mk-python-derivation: Precompute static lists 2024-03-06 14:22:09 +13:00
Martin Weinelt
14a12caecf python38: remove
The end of life for Python 3.8 is scheduled for 2024/10. As such it
cannot be a part of NixOS 24.05, because its support cycle goes past
that.
2024-03-05 11:56:21 +01:00
adisbladis
d77190aeaa mk-python-derivation: Refactor internal function validatePythonMatches
We can avoid recreating the same closure for every call by moving arguments around a little.
2024-03-04 16:04:50 +13:00
adisbladis
fb757e30fa mk-python-derivation: Refactor lib usage 2024-03-04 16:04:50 +13:00
Yarny0
b1bccc25ec pythonCatchConflictsHook: test cyclic dependency
Add test case where a package enlists
itself as propagated build input.
2024-02-25 11:54:49 +01:00
Yarny0
e5d7325166 pythonCatchConflictsHook: avoid infinite recursion
Albeit counter-intutive, the `propagatedBuildInputs`
mechanism and the corresponding package files in
`nix-support/propagated-build-inputs`
can form a dependency cycle.
This can happen if a package adds itself to this file,
or if multiple outputs of one derivation reference each other.

An example for this is the `patchPpdFilesHook`:
In its mission to collect dependency packages with binaries
that might be required by the dependent package to be created,
it sometimes picks up the dependent package itself.
This indicates that if a file of the dependent package
is used, the package itself should also be installed.
In the case of a multiple output package,
it is also possible that two outputs depend on each other,
creating a dependency cycle.

Since commit 2651ddc7b0,
the `find_packages` function in `catch_conflicts.py`
recursively collects all `propagated-build-inputs` files.
If it encounters a dependency cycle, it must not follow the
cycle to avoid infinite recursion (and a stack overflow).

The commit at hand adds a check so that the function skips over
a package that it already encountered and processed earlier.
This does not loosen the script's checks as the script
still recursively collects all propagated build inputs.
2024-02-25 11:54:07 +01:00
Dan Callaghan
fb39dd6f72 update-python-libraries: ignore yanked releases on PyPI 2024-02-25 15:27:31 +11:00
Weijia Wang
5f5062d1ef Merge branch 'master' into staging-next 2024-02-23 05:09:55 +01:00
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