Merge pull request #154745 from fabaff/fix-semver

python3Packages.semver: exclude documentation from tests
This commit is contained in:
Fabian Affolter 2022-01-12 15:02:42 +01:00 committed by GitHub
commit 3120d901d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,30 +1,46 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytest-cov
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "semver";
version = "2.13.0";
format = "setuptools";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "python-semver";
repo = "python-semver";
rev = version;
sha256 = "sha256-IWTo/P9JRxBQlhtcH3JMJZZrwAA8EALF4dtHajWUc4w=";
hash = "sha256-IWTo/P9JRxBQlhtcH3JMJZZrwAA8EALF4dtHajWUc4w=";
};
checkInputs = [
pytest-cov
pytestCheckHook
];
# Confuses source vs dist imports in pytest
preCheck = "rm -r dist";
postPatch = ''
sed -i "/--cov/d" setup.cfg
sed -i "/--no-cov-on-fail/d" setup.cfg
'';
pythonImportsCheck = [ "semver" ];
preCheck = ''
# Confuses source vs dist imports in pytest
rm -r dist
'';
disabledTestPaths = [
# Don't test the documentation
"docs/*.rst"
];
pythonImportsCheck = [
"semver"
];
meta = with lib; {
description = "Python package to work with Semantic Versioning (http://semver.org/)";