python3Packages.pytest-console-scripts: clean-ip

This commit is contained in:
Fabian Affolter 2022-02-25 12:10:11 +01:00 committed by GitHub
parent 777d408f7b
commit 2ebe62c929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,28 +5,41 @@
, python
, mock
, setuptools-scm
, pythonOlder
}:
buildPythonPackage rec {
pname = "pytest-console-scripts";
version = "1.3";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-w8rb9nz7MKHrHMHp5py23kTDpkhCbxub9j6F2XNX/H8=";
hash = "sha256-w8rb9nz7MKHrHMHp5py23kTDpkhCbxub9j6F2XNX/H8=";
};
postPatch = ''
# setuptools-scm is pinned to <6 because it dropped Python 3.5
# support. That's not something that affects us.
substituteInPlace setup.py --replace "'setuptools_scm<6'" "'setuptools_scm'"
# Patch the shebang of a script generated during test.
substituteInPlace tests/test_run_scripts.py --replace "#!/usr/bin/env python" "#!${python.interpreter}"
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [ setuptools-scm ];
checkInputs = [ mock pytestCheckHook ];
nativeBuildInputs = [
setuptools-scm
];
checkInputs = [
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 = with lib; {
description = "Pytest plugin for testing console scripts";