summaryrefslogtreecommitdiff
path: root/pkgs/development/interpreters/python (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make venv change work on DarwinAlex O'Brien2024-03-011-1/+1
| | | | | | | | | | | | | | | | | | This patch builds on the previous to make prefix resolution work correctly inside virtual environments on Darwin. The --inherit-argv0 mechanism is insufficient, as on Darwin, Python uses the _NSGetExecutablePath() call to work out the actual path to its binary. Since this resolves to the real unwrapped binary, --inherit-argv0 is little use. This patch adds a new variant, --inherit-argv0-path, which resolves the full path before passing it to argv[0]. On Darwin this is done using _NSGetExecutablePath(), on Linux by reading /proc/self/exe. This bypasses the real_executable lookup, as Python gives precedence to argv[0] when it appears to be a path (contains a slash). While not strictly necessary on Linux (as --inherit-argv0 works anyway), the change is made to both for consistency.
* Fix venv creation in Python environmentsColin Putney2024-03-019-57/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 set argv0 to the full path of 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. * When building the 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. 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.
* Merge branch 'master' into staging-nextWeijia Wang2024-02-231-3/+0
|\
| * Merge pull request #289531 from mweinelt/python312full-bluezMartin Weinelt2024-02-221-3/+0
| |\ | | | | | | cpython: allow full variant on all platformns where bluez is available
| | * cpython: allow full variant on all platformns where bluez is availableMartin Weinelt2024-02-171-3/+0
| | | | | | | | | | | | Closes: #289113
* | | Merge master into staging-nextgithub-actions[bot]2024-02-201-14/+34
|\| |
| * | Merge pull request #271597 from adisbladis/python-runtime-build-time-sepMartin Weinelt2024-02-201-14/+34
| |\ \ | | | | | | | | python3.pkgs.buildPythonPackage: Separate runtime & build time dependencies
| | * | mk-python-derivation: Add build-system argumentadisbladis2024-02-181-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | mk-python-derivation: Add dependencies & optional-dependencies argumentsadisbladis2024-02-181-13/+27
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Merge staging-next into staginggithub-actions[bot]2024-02-181-3/+5
|\| |
| * | python3.hooks: Dont completely overwrite passthru when creating setup hookadisbladis2024-02-171-1/+3
| | |
| * | python3.pkgs.pypaBuildHook: Fix passthru.testsadisbladis2024-02-171-2/+2
| |/
* | pythonCatchConflictsHook: make compatible to all python 3 versionsDavHau2024-02-132-11/+14
| |
* | pythonCatchConflictsHook: improve and add testsDavHau2024-02-133-19/+192
| |
* | python/catch_conflicts: scan $out, not sys.pathphaer2024-02-121-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | python312: 3.12.1 -> 3.12.2Martin Weinelt2024-02-081-2/+2
| | | | | | | | https://docs.python.org/release/3.11.8/whatsnew/changelog.html
* | python311: 3.11.7 -> 3.11.8Martin Weinelt2024-02-071-2/+2
|/ | | | https://docs.python.org/release/3.11.8/whatsnew/changelog.html
* Merge master into staging-nextgithub-actions[bot]2024-02-071-4/+7
|\
| * mk-python-derivation: fix passthru.updateScript being merged into the ↵Sandro2024-02-071-4/+7
| | | | | | | | | | | | derivation (#241922) Before updateScript was being merged to pdm.updateScript. With this commit it is being moved to the expected location pdm.passthru.updateScript
* | python312: use vendored mpdecimal library on darwinMartin Weinelt2024-02-061-0/+3
| | | | | | | | | | Building with --with-system-mpdecimal fails on both darwin architectures, independent of the mpdecimal version used.
* | cpython: build with our own libmpdecimalMartin Weinelt2024-02-021-0/+3
| |
* | cpython: refactor & clean upMartin Weinelt2024-02-022-83/+137
| | | | | | | | | | | | | | | | | | - 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
* | cpython: prune patches and configure flagsMartin Weinelt2024-02-022-622/+1
| | | | | | | | - Using the system-provided ffi has been the default since 3.6
* | cpython: resolve substituteStream --replace deprecationMartin Weinelt2024-02-021-7/+8
| |
* | cpython: unpin legacy opensslMartin Weinelt2024-02-021-9/+4
|/ | | | | Various packages failed to build due to the removal of hashes like MD5, but they now work or have been dropped.
* python311Packages.recursive-pth-loader: rename from recursivePthLoaderFelix Buehler2024-01-251-4/+0
|
* python313: 3.13.0a2 -> 3.13.0a3Martin Weinelt2024-01-191-2/+2
| | | | https://docs.python.org/3.13/whatsnew/changelog.html#python-3-13-0-alpha-3
* Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt2024-01-101-9/+10
|\ | | | | | | | | Conflicts: - pkgs/development/python-modules/types-setuptools/default.nix
| * update-python-libraries: support applications outside python-modulesWim de With2024-01-101-9/+10
| |
* | Merge remote-tracking branch 'origin/master' into staging-nextK9002024-01-091-1/+7
|\|
| * pythonInterpreters.pypy39_prebuilt: fix `tests` eval (#278950)Sergei Trofimovich2024-01-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'origin/master' into staging-nextMartin Weinelt2024-01-081-1/+1
|\| | | | | | | | | Conflicts: - pkgs/development/python-modules/aiohappyeyeballs/default.nix
| * python2.7: remove thiagokokada from maintainersThiago Kenji Okada2024-01-071-1/+1
| |
* | Merge branch 'master' into staging-nextWeijia Wang2024-01-031-1/+1
|\|
| * pythonInterpreters.pypy39_prebuilt: fix eval (#277543)Sergei Trofimovich2024-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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?
* | Merge master into staging-nextgithub-actions[bot]2023-12-291-1/+2
|\|
| * python/hooks: fix `test` attribute evalSergei Trofimovich2023-12-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | python311: 3.11.6 -> 3.11.7Martin Weinelt2023-12-201-2/+2
| | | | | | | | https://docs.python.org/release/3.11.7/whatsnew/changelog.html
* | pythonRelaxDepsHook: make distribution name matching case insensitiveMartin Weinelt2023-12-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* | python3.pkgs.pythonRuntimeDepsCheckHook: initMartin Weinelt2023-12-204-0/+135
| | | | | | | | | | | | | | | | 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.
* | Merge remote-tracking branch 'origin/staging-next' into stagingMartin Weinelt2023-12-121-5/+0
|\|
| * python3.pkgs.buildsetupcfg: Remove function from python-packages-base.nixadisbladis2023-12-121-5/+0
| | | | | | | | | | | | | | 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.
* | pypy: add option to change optimization level, update homepage, cleanupSandro Jäckel2023-12-101-6/+11
|/
* python312: 3.12.0 -> 3.12.1Martin Weinelt2023-12-081-2/+2
| | | | | | https://docs.python.org/release/3.12.1/whatsnew/changelog.html Fixes: CVE-2023-6507
* update-python-libraries: quiet nix stderr outputMartin Weinelt2023-12-021-1/+2
| | | | | We query lots of derivation attributes, most of which do not exist, so logging stderr causes a lot of noise for no gain.
* update-python-libraries: format with black/isortMartin Weinelt2023-12-021-125/+164
|
* update-python-libraries: add package changelog to commit messageMartin Weinelt2023-12-021-0/+3
|
* update-python-libraries: don't update packages with cargoDepsMartin Weinelt2023-12-021-0/+2
| | | | This is unsupported and breaks packages on update.
* cpython: restore passthru.testsMartin Weinelt2023-11-281-1/+3
| | | | | Fixes a regression from #261323, where all `passthru.tests` were overwritten.
* Merge pull request #269255 from prusnak/rustpython-darwinPavol Rusnak2023-11-261-0/+5
|\ | | | | rustpython: mark broken on x86_64-darwin