python3Packages.pytest-isort: switch to GitHub as source
This commit is contained in:
parent
d123039b2e
commit
44318a9e10
|
@ -1,26 +1,64 @@
|
||||||
{ lib, buildPythonPackage, fetchPypi, isPy27, mock, pytest, isort }:
|
{ lib
|
||||||
|
, buildPythonPackage
|
||||||
|
, fetchFromGitHub
|
||||||
|
, fetchpatch
|
||||||
|
, importlib-metadata
|
||||||
|
, isort
|
||||||
|
, poetry-core
|
||||||
|
, pytest
|
||||||
|
, pytestCheckHook
|
||||||
|
, pythonOlder
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "pytest-isort";
|
pname = "pytest-isort";
|
||||||
version = "3.0.0";
|
version = "3.0.0";
|
||||||
|
format = "pyproject";
|
||||||
|
|
||||||
src = fetchPypi {
|
disabled = pythonOlder "3.7";
|
||||||
inherit pname version;
|
|
||||||
sha256 = "sha256-T+Sybq0q93ZzDsI/WHDXQh81qs4ipBxOk4WG702Hh8s=";
|
src = fetchFromGitHub {
|
||||||
|
owner = "stephrdev";
|
||||||
|
repo = pname;
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-gbEO3HBDeZ+nUACzpeV6iVuCdNHS5956wFzIYkbam+M=";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = [ isort ];
|
nativeBuildInputs = [
|
||||||
|
poetry-core
|
||||||
|
];
|
||||||
|
|
||||||
checkInputs = [ pytest ]
|
buildInputs = [
|
||||||
++ lib.optionals isPy27 [ mock ];
|
pytest
|
||||||
|
];
|
||||||
|
|
||||||
checkPhase = ''
|
propagatedBuildInputs = [
|
||||||
py.test -vs --cache-clear
|
isort
|
||||||
'';
|
] ++ lib.optionals (pythonOlder "3.8") [
|
||||||
|
importlib-metadata
|
||||||
|
];
|
||||||
|
|
||||||
|
checkInputs = [
|
||||||
|
pytestCheckHook
|
||||||
|
];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# Can be removed with the next release, https://github.com/stephrdev/pytest-isort/pull/44
|
||||||
|
(fetchpatch {
|
||||||
|
name = "switch-to-poetry-core.patch";
|
||||||
|
url = "https://github.com/stephrdev/pytest-isort/commit/f17ed2d294ae90e415d051e1c720982e3dd01bff.patch";
|
||||||
|
sha256 = "sha256-PiOs0c61BNx/tZN11DYblOd7tNzGthNnlkmYMTI9v18=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
"pytest_isort"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Pytest plugin to perform isort checks (import ordering)";
|
description = "Pytest plugin to perform isort checks (import ordering)";
|
||||||
homepage = "https://github.com/moccu/pytest-isort/";
|
homepage = "https://github.com/moccu/pytest-isort/";
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
|
maintainers = with maintainers; [ ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue