nixpkgs/pkgs/development/python-modules/pytest-console-scripts/default.nix
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

49 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
mock,
fetchPypi,
pytestCheckHook,
python,
setuptools-scm,
setuptools,
}:
buildPythonPackage rec {
pname = "pytest-console-scripts";
version = "1.4.1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-WoJu2EzAr6IC655EOB19di973ajgwj+feafx9Ez0qJU=";
};
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ setuptools ];
nativeCheckInputs = [
mock
pytestCheckHook
];
postPatch = ''
# Patch the shebang of a script generated during test.
substituteInPlace tests/test_run_scripts.py \
--replace "#!/usr/bin/env python" "#!${python.interpreter}"
'';
pythonImportsCheck = [ "pytest_console_scripts" ];
meta = {
description = "Pytest plugin for testing console scripts";
longDescription = ''
Pytest-console-scripts is a pytest plugin for running python scripts from within tests.
It's quite similar to subprocess.run(), but it also has an in-process mode, where the scripts are executed by the interpreter that's running pytest (using some amount of sandboxing).
'';
homepage = "https://github.com/kvas-it/pytest-console-scripts";
license = lib.licenses.mit;
maintainers = [ ];
};
}