summaryrefslogtreecommitdiff
path: root/pkgs/development/interpreters/python/tests.nix
AgeCommit message (Collapse)Author
13 daystreewide: change 'format = "other";' to 'pyproject = false;'Michael Daniels
Entirely find-and-replace based. A few usages that would cause rebuilds if changed remain. This PR should have 0 rebuilds.
2025-10-05treewide: remove unused withWolfgang Walther
Auto-fixed by nixf-diagnose.
2025-07-24treewide: run nixfmt 1.0.0Wolfgang Walther
2025-07-23python3: fix passthru tests after b937eacMartin Weinelt
2025-05-09pypy.tests: disable broken testFliegendeWurst
2025-04-01treewide: Format all Nix filesSilvan Mosberger
Format all Nix files using the officially approved formatter, making the CI check introduced in the previous commit succeed: nix-build ci -A fmt.check This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153) of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166). This commit will lead to merge conflicts for a number of PRs, up to an estimated ~1100 (~33%) among the PRs with activity in the past 2 months, but that should be lower than what it would be without the previous [partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537). Merge conflicts caused by this commit can now automatically be resolved while rebasing using the [auto-rebase script](https://github.com/NixOS/nixpkgs/tree/8616af08d915377bd930395f3b700a0e93d08728/maintainers/scripts/auto-rebase). If you run into any problems regarding any of this, please reach out to the [formatting team](https://nixos.org/community/teams/formatting/) by pinging @NixOS/nix-formatting.
2024-10-08python3.tests: remove unnecessary condition and disable failing tests on 3.13natsukium
2024-09-25treewide: replace `stdenv.is` with `stdenv.hostPlatform.is`Artturin
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
2024-09-08python3Packages.mkPythonEditablePackage: initadisbladis
2024-04-11Revert "Fix venv creation in Python environments"Sandro Jäckel
This commit reverts all python changes from 234bb31f611f43f8b744b305ab82035de637aaca.
2024-04-10cpython: disable failing passthru tests on darwinMartin Weinelt
```` usage: virtualenv [--version] [--with-traceback] [-v | -q] [--read-only-app-data] [--app-data APP_DATA] [--reset-app-data] [--upgrade-embed-wheels] [--discovery {builtin}] [-p py] [--try-first-with py_exe] [--creator {builtin,cpython3-posix,venv}] [--seeder {app-data,pip}] [--no-seed] [--activators comma_sep_list] [--clear] [--no-vcs-ignore] [--system-site-packages] [--symlinks | --copies] [--no-download | --download] [--extra-search-dir d [d ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip] [--no-setuptools] [--no-wheel] [--no-periodic-update] [--symlink-app-data] [--prompt prompt] [-h] dest virtualenv: error: argument dest: the destination . is not write-able at /nix/store SystemExit: 2 ````
2024-03-21Fix venv creation in Python environmentsColin Putney
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-01-09pythonInterpreters.pypy39_prebuilt: fix `tests` eval (#278950)Sergei Trofimovich
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.
2023-09-25python27: disable tests that expect Python 3+Thiago Kenji Okada
2023-08-19python.tests.tkinter: initDoron Behar
2023-02-12python3.tests.nixenv-virtualenv: Fix on darwinMartin Weinelt
The virtualenv mode is trying to be smart and checks whether it can write to $out, which for some reason fails on darwin. > virtualenv: error: argument dest: the destination . is not write-able at /nix/store But what does work is creating it in the pwd and moving it to $out, because mv just does what it is told.
2023-02-11python3.tests.condaExamplePackage: Exclude on non-linuxMartin Weinelt
Allow python3.tests to eval on other platforms than linux, by excluding conda tests when not on linux, because they include alsa-lib, which is linux-only.
2022-08-06pythonPackagesExtensions: override all Python package sets at onceFrederik Rietdijk
Python package sets can be overridden by overriding an interpreter and passing in `packageOverrides = self: super: {...};`. This is fine in case you need a single interpreter, however, it does not help you when you want to override all sets. With this change it is possible to override all sets at once by appending a list of "extensions" to `pythonPackagesExtensions`. From reading the implementation you might wonder why a list is used, and not `lib.composeExtensions`? The reason is the latter requires knowledge of the library function. This approach should be easier for most users as it is similar to how we append to lists of e.g. inputs or patches when overriding a derivation.
2021-12-18python2.tests.nixenv-virtualenv: fix testFrederik Rietdijk
by using a python env that ignores collisions in the backports packages.
2021-08-19python3.tests: add cpython-gdb testRobert Scott
2021-05-28buildPythonPackage: add support for condaDavHau
2021-02-19python.tests: test overriding functionsFrederik Rietdijk
2021-02-13python.tests: add some comments to the testsFrederik Rietdijk
2021-01-23pkgs/development/interpreters: stdenv.lib -> libBen Siraphob
2020-11-23python.tests: not when cross-compilingFrederik Rietdijk
Running the tests is not possible when cross-compiling.
2020-08-30python.tests: don't mix the two types of testsFrederik Rietdijk
The integration tests code was included in the environment tests. After this commit it is hopefully clearer what belongs together.
2020-05-24Python: fix virtualenv with Python 2Frederik Rietdijk
2020-05-24Python tests: fix use of is_virtualenvFrederik Rietdijk
Too many tests set it.
2020-05-23python.tests: also test virtualenvFrederik Rietdijk
Test whether creating a virtualenv functions.
2020-04-25Python integration tests: disable for older python 3 versionsFrederik Rietdijk
because the package that is used as part of the test does not support older versions.
2020-04-25Python tests: test venv from a nix env with Python 3.8Frederik Rietdijk
This test was disabled because it did not function yet, however, apparently it does with 3.8.
2020-03-14Python: Add integration test verifying NIX_PYTHONPATH with Mypyadisbladis
2020-03-14Python Add test for NIX_PYTHONPREFIXadisbladis
2020-03-14Python: introduce tests for interpretersFrederik Rietdijk
This adds tests to the passthru of all Python interpreters.