Commit Graph

1355 Commits

Author SHA1 Message Date
Theodore Ni
dd1256d2ca python3.pkgs.pythonRelaxDepsHook: don't propagate wheel
The usage of wheel should be restricted to the hook. I discovered this
when trying to remove wheel from the Python bootstrap. Some packages
that needed wheel did not need it added explicitly because they use this
hook. This implicit change to the dependency tree shouldn't happen (even
though it is mostly harmless).
2023-08-20 11:00:51 +02:00
Theodore Ni
4e7188c39a python3.pkgs.buildPythonPackage: disable conflict check for setuptools and wheel
We can do this automatically for packages we know cannot use the
conflict check hook when it would lead to infinite recursion.
2023-08-20 10:59:47 +02:00
Theodore Ni
6c85fff302 python3.pkgs.buildPythonPackage: switch to PyPA build and installer 2023-08-20 10:59:47 +02:00
Theodore Ni
e8cca499a8 python2.{buildPythonPackage,buildPythonApplication}: extract into its own file
As we continue iterating on Python infrastructure for Python 3, some
code is starting to diverge for Python 2. If we copy the current state
of mk-python-derivation.nix and freeze it for Python 2, we can iterate
on it for Python 3 with more freedom.
2023-08-20 10:59:46 +02:00
Theodore Ni
93d25dda84 python3.pkgs.pypaBuildHook: switch to pyproject-build
Upstream's recommended "python -m build" way of invoking build fails
when the working directory contains a file named "build.py". This is
common for poetry projects that build C extensions.
2023-08-20 10:59:46 +02:00
Theodore Ni
a4d66bcc5f python3.pkgs.pypaInstallHook: init 2023-08-20 10:59:46 +02:00
github-actions[bot]
bb1bf988bc
Merge staging-next into staging 2023-08-19 12:01:31 +00:00
github-actions[bot]
d3b2560b73
Merge master into staging-next 2023-08-19 12:01:03 +00:00
Theodore Ni
4ed77bebec
Merge pull request #247868 from doronbehar/pkg/python-tk-test
python.tests.tkinter: init
2023-08-19 04:04:24 -07:00
Doron Behar
ca499f6965 python.tests.tkinter: init 2023-08-19 14:00:56 +03:00
Theodore Ni
ece0953571
Merge branch 'staging-next' into staging 2023-08-18 16:02:27 -07:00
github-actions[bot]
03146a5454
Merge master into staging-next 2023-08-18 06:01:01 +00:00
Nick Cao
e19e2222d7
python3Packages.pythonNamespacesHook: use findutils from buildPackages (#249864) 2023-08-18 07:39:36 +02:00
Thiago Kenji Okada
5dda73a162
Merge pull request #248516 from thiagokokada/remove-version-from-python-relax-deps-hook
pythonRelaxDepsHook: remove version from pkg_name
2023-08-12 00:57:55 +00:00
Thiago Kenji Okada
98de48fc8f pythonRelaxDepsHook: remove version from pkg_name
Since the wheel file name is based on the package metadata instead of
what we set in the derivation, if you set the version as `unstable-YYYYMMDD`,
for example, the hook would silently fail. We will ignore the version
now and just use a glob instead to match anything that has the package
name in its path.

Fixes #248185.
2023-08-11 14:56:14 +01:00
github-actions[bot]
80be812da1
Merge staging-next into staging 2023-08-09 06:01:27 +00: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
github-actions[bot]
792f4d7934
Merge staging-next into staging 2023-08-08 18:01:27 +00:00
Sandro Jäckel
4514e57231 cpython: use correct variable to set meta.mainProgram 2023-08-08 17:25:28 +00:00
Adam Joseph
e67ff6614b
Merge pull request #247245 from Artturin/passthrufunthng1
Revert "Revert "python3: splice python within python3Packages.callPackage""
2023-08-05 21:33:38 +00:00
Artturin
8eff2eea8c Revert "Revert "python3: splice python within python3Packages.callPackage""
This reverts commit 2ffca30cde.

`793cc9d982415b71cdba729cf779bfc49e9d2ae7` `python3: splice python within python3Packages.callPackage`
Was reverted because it broke
`pkgsCross.aarch64-multiplatform.python3Packages.cryptography`

But by reverting the revert `pkgsCross.aarch64-multiplatform.python3Packages.cryptography` still builds.

I tried reverting the 2 cryptography update commits, and it still
worked, so I do not know why this would work now.
2023-08-05 02:37:16 +03: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
Silvan Mosberger
a0b8caf3bc
Revert "lib.customisation: uncurry makeScopeWithSplicing" 2023-07-28 23:04:09 +02:00
Artturin
3716ef19d8 lib.makeScopeWithSplicing: provide default for keep,extra
These are often unneeded by the user.
2023-07-28 17:41:01 +03:00
Doron Behar
6560d0086c python3.pkgs.pypaBuildHook: init 2023-07-28 12:13:25 +02:00
Doron Behar
1298c367b1 pip-build-hook.sh: Support $pipBuildFlags 2023-07-28 12:13:25 +02:00
Adam Joseph
52d3944057
Merge pull request #212795 from Cynerd/setuptools-rust-hook
Setuptools rust hook for cross compilation
2023-07-28 06:53:09 +00:00
Adam Joseph
cb13669b00 lib.customisation: uncurry makeScopeWithSplicing
Deeply-curried functions are pretty error-prone in untyped languages
like Nix.  This is a particularly bad case because
`top-level/splice.nix` *also* declares a makeScopeWithSplicing, but
it takes *two fewer arguments*.

Let's switch to attrset-passing form, to provide some minimal level
of sanity-checking.
2023-07-27 21:31:59 -07:00
github-actions[bot]
d1b1f7fda7
Merge staging-next into staging 2023-07-27 06:01:53 +00:00
Adam Joseph
2ffca30cde
Revert "python3: splice python within python3Packages.callPackage" 2023-07-27 01:42:35 +00:00
github-actions[bot]
dc058faf6b
Merge staging-next into staging 2023-07-27 00:02:38 +00:00
Artturi
906f999a2f
Merge pull request #245475 from Artturin/splicepython1 2023-07-26 22:43:37 +03:00
github-actions[bot]
bbfd40bb37
Merge staging-next into staging 2023-07-26 06:01:54 +00:00
Artturin
793cc9d982 python3: splice python within python3Packages.callPackage
`lib.extends hooks pythonPackagesFun` includes python which we want to
splice

what this fixes:
```
nix-repl> lib.elemAt pkgsCross.aarch64-multiplatform.python3Packages.xpybutil.nativeBuildInputs 0
«derivation /nix/store/39dkb51rciw6zwg0c2c44gpmpjapddxc-python3-aarch64-unknown-linux-gnu-3.10.12.drv»
```
to
```
nix-repl> lib.elemAt pkgsCross.aarch64-multiplatform.python3Packages.xpybutil.nativeBuildInputs 0
«derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»
```

Before https://github.com/NixOS/nixpkgs/pull/194205 The keep python used to work by accident because self was passed from
__splicedPackages https://github.com/NixOS/nixpkgs/pull/196052/files#diff-44ce3495c4f983ce64dd47c86a9d3e77bad210b2709c098a3806998dcd9b000bR213
But now it does not work because overrideAttrs is used on python in
python-packages-base.nix

Preferably we would [ splice the hooks too ](https://github.com/NixOS/nixpkgs/pull/228139) but we cannot do that until [Package sets within derivations (i.e. python3.pkgs) are not spliced](https://github.com/NixOS/nixpkgs/issues/211340) is fixed, because people often use `python3.pkgs.wrapPython` in `nativeBuildInputs` (it's correct but python3.pkgs should be python3Packages to get splicing.
2023-07-26 06:15:26 +03:00
Nick Cao
4570f7fc58
Merge pull request #243074 from mweinelt/cpython-3.12.0b4
python312: 3.12.0b3 -> 3.12.0b4
2023-07-25 19:03:08 -06:00
github-actions[bot]
941ae3102b
Merge staging-next into staging 2023-07-22 12:02:07 +00:00
Felix Bühler
0a2745684e
Merge pull request #239624 from Stunkymonkey/use-optionalString-then
treewide: use optionalString instead of 'then ""'
2023-07-22 13:02:47 +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
Martin Weinelt
6245a65b02
python312: 3.12.0b3 -> 3.12.0b4
https://docs.python.org/3.12/whatsnew/changelog.html#python-3-12-0b4

Fixes: CVE-2023-27043
2023-07-12 15:38:34 +02:00
Janik
7939b3db22
Merge pull request #196802 from jneem/manylinux 2023-07-02 23:23:55 +02:00
Joe Neeman
38d66c2984 pythonManylinuxPackages: add libz and expat
These libs aren't mentioned in PEP 513, but auditwheel allows them
(https://github.com/pypa/auditwheel/issues/152) and so built wheels
may depend on them.
2023-07-02 22:52:11 +07:00
Karel Kočí
9d663f7fcd
setuptools-rust: fix cross compilation
The setuptools-rust requires some environment variables to really
perform cross build, otherwise it just builds for build platform.

This adds setup hook that introduces these environment variables.

There are three variables.
The PYO3_CROSS_LIB_DIR has to point to the target's Python library
directory. This has to be directory for the target not for the build or
host. We have to choose the correct target Python. I am unsure how to do
that simply in nixpkgs and this this implementations just delays this
and waits for the correct Python when package using this hook is build.
The CARGO_BUILD_TARGET triggers cross compilation in setuptools-rust.
This is simply the Rust target specification.
The CARGO_TARGET_*_LINKER variable should not be essentially required
but setuptools-rust probably mangles the Rust build environment somewhat
and that results to the missing linker. By explicitly specifying it
using the environment variable we force the correct linker.
2023-06-30 14:52:25 +02:00
Felix Buehler
6672dde558 treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
Felix Buehler
f3719756b5 treewide: use optionalString instead of 'then ""' 2023-06-24 20:19:19 +02:00
Weijia Wang
82e6dcefb9 python311Packages.tkinter: fix runtime error on darwin 2023-06-22 17:52:12 +03:00
Martin Weinelt
cea1c49331
python312: 3.12.0b2 -> 3.12.0b3
https://docs.python.org/3.12/whatsnew/changelog.html#python-3-12-0b3
2023-06-21 02:31:58 +02:00
github-actions[bot]
622850f61f
Merge staging-next into staging 2023-06-09 18:01:50 +00:00
Martin Weinelt
342ba7d647
python311: 3.11.3 -> 3.11.4
https://docs.python.org/release/3.11.4/whatsnew/changelog.html

Fixes: CVE-2023-24329
2023-06-07 14:41:15 +02:00