Commit Graph

189 Commits

Author SHA1 Message Date
Frederik Rietdijk 5772ac5a75 Removing FRidh as active maintainer of packages
In the past I was very active with Python packaging.
For several years now I was hardly around as maintainer,
so it does not make sense I am listed as a maintainer for
these makes. Looking back, I should have removed myself
as maintainer already much longer ago. Anyway, better late
than never.

It's been a fun ride, and  I do intend to occasionally contribute
to Nixpkgs, but not in the same way it once was.
2024-04-28 12:20:07 +02:00
Sandro Jäckel b3b12c2d08 Revert "Fix venv creation in Python environments"
This commit reverts all python changes from 234bb31f61.
2024-04-11 08:26:39 -07:00
github-actions[bot] 97f05fe383 Merge staging-next into staging 2024-03-23 12:01:37 +00:00
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
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
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
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
Martin Weinelt bc775ec0dd cpython: allow full variant on all platformns where bluez is available
Closes: #289113
2024-02-17 14:05:32 +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
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
Adam Joseph bc2d598878 treewide: change pythonForBuild to pythonOnBuildForHost 2023-11-05 17:42:12 -08:00
natsukium 56b570d6af python311Packages.python-docs-theme: rename from python_docs_theme 2023-11-04 12:34:41 +09: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] 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
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
Yureka 1d3c3d4f5b python: simplify ABI name detection 2023-10-09 15:12:20 +00:00
github-actions[bot] d987b47512 Merge master into staging-next 2023-09-08 06:00:58 +00:00
marius david a02761d722 python311: enable cross-compilation to windows 2023-09-07 02:16:21 +03:00
Sandro Jäckel 28c0cd5b17 cpython: remove broken include/python3.X/python3.Xm symlink
The m flag was removed in Python 3.8:
https://docs.python.org/3/whatsnew/3.8.html#build-and-c-api-changes

Co-authored-by: Anders Kaseorg <26471+andersk@users.noreply.github.com>
2023-09-01 02:52:50 +03:00
Ben Wolsieffer 02719f21e6 cpython: fix _PYTHON_SYSCONFIGDATA_NAME on armv7l with musl (#240770)
Python always uses "gnu" prefixed ABI names, and this patch handles this by
doing a musl->gnu string replacement.

With pkgsCross.armv7l-hf-multiplatform.pkgsStatic, the previous name was:
_sysconfigdata__linux_arm-linux-gnu
Now, the corrected name is:
_sysconfigdata__linux_arm-linux-gnueabihf
2023-08-09 07:16:58 +02:00
Sandro Jäckel 4514e57231 cpython: use correct variable to set meta.mainProgram 2023-08-08 17:25:28 +00:00
github-actions[bot] 5827446dce Merge master into staging-next 2023-08-03 00:01:56 +00:00
Robert Hensing 34ee0260ec treewide: Add meta.mainProgram
Based on ofborg feedback.
Part of https://github.com/NixOS/nixpkgs/pull/246386
2023-08-01 12:21:05 +02:00
Sandro ae6388356f Merge pull request #153527 from andersk/python3-symlinks
python3: Add manpage symlink to fix ‘man python’
2023-07-20 22:07:42 +02:00
Anders Kaseorg 9c55f23e53 python3: Add manpage symlink to fix ‘man python’
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-07-19 15:33:47 +02:00
Felix Buehler 6672dde558 treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
Weijia Wang 82e6dcefb9 python311Packages.tkinter: fix runtime error on darwin 2023-06-22 17:52:12 +03:00
Domen Kožar 9f3e0de184 cypthon: moduralize so it can be called with other versions 2023-06-05 17:32:40 +02:00
Domen Kožar b4222d6661 python: add conditionals to be able to compile with 3.6 or older 2023-06-05 17:32:40 +02:00
Dmitry Bogatov 2f181d6f06 python3.doc: build offline documentation
Since python documentation requires Sphinx to build, documentation is built in
separate derivation to avoid hard recursion/bootstrapping questions and plugged
into main derivation. Care is taken that "python3.doc" derivation feels and
looks as close as possible to as if it were main derivation were multi-output
one.

This change does not cause rebuild of python3 itself.
2023-06-03 16:43:46 +02:00
Jonas Chevalier 3d2bdd0788 python: implement PEP 668 (#229166)
Add a marker file to the python outputs that tells pip and other tooling
following PEP 668 that they should not be installing things system-wide.

This provides better feedback to the user and also potentially avoids issues in
single-user installs where the /nix/store is owned by the user.

For more details, see <https://peps.python.org/pep-0668/>

Here is how it currently looks like:

    $ pip install requests
    error: externally-managed-environment

    × This environment is externally managed
    ╰─> This command has been disabled as it tries to modify the immutable
        `/nix/store` filesystem.

        To use Python with Nix and nixpkgs, have a look at the online documentation:
        <https://nixos.org/manual/nixpkgs/stable/#python>.
2023-05-04 18:30:25 +02:00
jackyliu16 df2c2e63f1 cpython: add loongarch triplets
using patch ref on: https://github.com/python/cpython/issues/90656
  to add loongarch triplets for using cpython in loongarch

  Note: This patch is being reviewed by cpython
2023-05-01 05:16:32 +08:00
superherointj b3b4bc0052 Merge pull request #208636 from wegank/python-framework
python3: allow enabling framework on darwin
2023-03-04 07:31:34 -03:00
Martin Weinelt ee90eca180 cpython: Migrate sha256 occurences to hash 2023-02-11 17:50:53 +01:00
superherointj a411b337d6 Merge pull request #209622 from NickCao/python311-cross
python311: fix cross compilation
2023-02-04 18:04:43 -03:00
Minijackson 2b43490121 python: improve ABI name detection 2023-01-19 15:20:31 +01:00
github-actions[bot] ceb05ad4bf Merge master into staging-next 2023-01-13 06:01:09 +00:00
Nick Cao f742c6d443 python311: fix cross compilation 2023-01-08 12:39:02 +08:00
Martin Weinelt e75f5e8efa python37: drop
The package set hasn't been working for a long time now, due to infinite
recursions, that nobody was going to fix.

The release is going to go EOL in 2023/06 and we don't want to ship it
in NixOS 23.05 anyway.
2023-01-05 13:20:49 +01:00
Weijia Wang f6fd1b9a53 python312: fix build on darwin 2023-01-02 13:07:46 +01:00
Weijia Wang a440e955e0 python3: allow enabling framework on darwin 2023-01-01 16:05:48 +01:00