3
0
Fork 0
forked from mirrors/nixpkgs

python3Packages.setuptools-scm: 6.0.1 -> 6.3.1, enable tests

This commit is contained in:
Martin Weinelt 2021-09-04 01:28:18 +02:00
parent a3786b8b62
commit 8fa32dafcc
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
2 changed files with 54 additions and 14 deletions

View file

@ -1,29 +1,36 @@
{ lib, buildPythonPackage, fetchPypi, toml, tomli }:
{ buildPythonPackage
, callPackage
, fetchPypi
, packaging
, tomli
, lib
}:
buildPythonPackage rec {
pname = "setuptools-scm";
# don't update to 6.1.0 or 6.2.0, releases were pulled because of regression
# https://github.com/pypa/setuptools_scm/issues/615
version = "6.0.1";
version = "6.3.1";
src = fetchPypi {
pname = "setuptools_scm";
inherit version;
sha256 = "sha256-0ZJaacsH6bKUFqJ1ufrbAJojwUis6QWy+yIGSabBjpI=";
sha256 = "sha256-D2omORKxN5jAKLmicdka873g5CeECRx5fezMOtOn9ZY=";
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "tomli~=1.0.0" "tomli>=1.0.0"
'';
propagatedBuildInputs = [
packaging
tomli
];
# TODO: figure out why both toml and tomli are needed when only tomli is listed in setuptools-scm
# if not both are listed some packages like zipp silently fallback to a 0.0.0 version number and break version pins in other packages
propagatedBuildInputs = [ toml tomli ];
pythonImportsCheck = [
"setuptools_scm"
];
# Requires pytest, circular dependency
# check in passhtru.tests.pytest to escape infinite recursion on pytest
doCheck = false;
pythonImportsCheck = [ "setuptools_scm" ];
passthru.tests = {
pytest = callPackage ./tests.nix { };
};
meta = with lib; {
homepage = "https://github.com/pypa/setuptools_scm/";

View file

@ -0,0 +1,33 @@
{ lib
, buildPythonPackage
, setuptools-scm
, pytestCheckHook
, git
, mercurial
, pip
, virtualenv
}:
buildPythonPackage rec {
pname = "setuptools-scm-tests";
inherit (setuptools-scm) version;
src = setuptools-scm.src;
dontBuild = true;
dontInstall = true;
checkInputs = [
pytestCheckHook
setuptools-scm
pip
virtualenv
git
mercurial
];
disabledTests = [
# network access
"test_pip_download"
];
}