Loading pkgs/development/python-modules/docformatter/default.nix +24 −3 Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ , buildPythonPackage , pythonOlder , fetchFromGitHub , poetry-core , charset-normalizer , tomli , untokenize , mock , pytestCheckHook Loading @@ -9,20 +12,37 @@ buildPythonPackage rec { pname = "docformatter"; version = "1.5.0"; version = "1.5.1"; disabled = pythonOlder "3.6"; format = "setuptools"; format = "pyproject"; src = fetchFromGitHub { owner = "PyCQA"; repo = pname; rev = "refs/tags/v${version}"; hash = "sha256-GSfsM6sPSLOIH0YJYFVTB3SigI62/ps51mA2iZ7GOEg="; hash = "sha256-r+8FOl9Rrfi3V8f8wD41bRsaqDb+UrOBWuR3goK43xY="; }; patches = [ ./test-path.patch ]; postPatch = '' substituteInPlace pyproject.toml \ --replace 'charset_normalizer = "^2.0.0"' 'charset_normalizer = ">=2.0.0"' substituteInPlace tests/conftest.py \ --subst-var-by docformatter $out/bin/docformatter ''; nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ charset-normalizer tomli untokenize ]; Loading @@ -34,6 +54,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "docformatter" ]; meta = { changelog = "https://github.com/PyCQA/docformatter/blob/${src.rev}/CHANGELOG.md"; description = "Formats docstrings to follow PEP 257"; homepage = "https://github.com/myint/docformatter"; license = lib.licenses.mit; Loading pkgs/development/python-modules/docformatter/test-path.patch 0 → 100644 +29 −0 Original line number Diff line number Diff line diff --git a/tests/conftest.py b/tests/conftest.py index 5f5a9aa..3289222 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -92,21 +92,9 @@ def run_docformatter(arguments, temporary_file): Return subprocess object. """ - if "DOCFORMATTER_COVERAGE" in os.environ and int( - os.environ["DOCFORMATTER_COVERAGE"] - ): - DOCFORMATTER_COMMAND = [ - "coverage", - "run", - "--branch", - "--parallel", - "--omit=*/site-packages/*", - os.environ["VIRTUAL_ENV"] + "/bin/docformatter", - ] - else: - DOCFORMATTER_COMMAND = [ - os.environ["VIRTUAL_ENV"] + "/bin/docformatter", - ] # pragma: no cover + DOCFORMATTER_COMMAND = [ + "@docformatter@" + ] if "-" not in arguments: arguments.append(temporary_file) Loading
pkgs/development/python-modules/docformatter/default.nix +24 −3 Original line number Diff line number Diff line Loading @@ -2,6 +2,9 @@ , buildPythonPackage , pythonOlder , fetchFromGitHub , poetry-core , charset-normalizer , tomli , untokenize , mock , pytestCheckHook Loading @@ -9,20 +12,37 @@ buildPythonPackage rec { pname = "docformatter"; version = "1.5.0"; version = "1.5.1"; disabled = pythonOlder "3.6"; format = "setuptools"; format = "pyproject"; src = fetchFromGitHub { owner = "PyCQA"; repo = pname; rev = "refs/tags/v${version}"; hash = "sha256-GSfsM6sPSLOIH0YJYFVTB3SigI62/ps51mA2iZ7GOEg="; hash = "sha256-r+8FOl9Rrfi3V8f8wD41bRsaqDb+UrOBWuR3goK43xY="; }; patches = [ ./test-path.patch ]; postPatch = '' substituteInPlace pyproject.toml \ --replace 'charset_normalizer = "^2.0.0"' 'charset_normalizer = ">=2.0.0"' substituteInPlace tests/conftest.py \ --subst-var-by docformatter $out/bin/docformatter ''; nativeBuildInputs = [ poetry-core ]; propagatedBuildInputs = [ charset-normalizer tomli untokenize ]; Loading @@ -34,6 +54,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "docformatter" ]; meta = { changelog = "https://github.com/PyCQA/docformatter/blob/${src.rev}/CHANGELOG.md"; description = "Formats docstrings to follow PEP 257"; homepage = "https://github.com/myint/docformatter"; license = lib.licenses.mit; Loading
pkgs/development/python-modules/docformatter/test-path.patch 0 → 100644 +29 −0 Original line number Diff line number Diff line diff --git a/tests/conftest.py b/tests/conftest.py index 5f5a9aa..3289222 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -92,21 +92,9 @@ def run_docformatter(arguments, temporary_file): Return subprocess object. """ - if "DOCFORMATTER_COVERAGE" in os.environ and int( - os.environ["DOCFORMATTER_COVERAGE"] - ): - DOCFORMATTER_COMMAND = [ - "coverage", - "run", - "--branch", - "--parallel", - "--omit=*/site-packages/*", - os.environ["VIRTUAL_ENV"] + "/bin/docformatter", - ] - else: - DOCFORMATTER_COMMAND = [ - os.environ["VIRTUAL_ENV"] + "/bin/docformatter", - ] # pragma: no cover + DOCFORMATTER_COMMAND = [ + "@docformatter@" + ] if "-" not in arguments: arguments.append(temporary_file)