diff --git a/integration-tests-invocation.patch b/integration-tests-invocation.patch index 22b3394..0a58b5c 100644 --- a/integration-tests-invocation.patch +++ b/integration-tests-invocation.patch @@ -1,44 +1,39 @@ ---- pydocstyle-3.0.0-orig/src/tests/test_integration.py 2018-10-14 17:54:04.000000000 +0700 -+++ pydocstyle-3.0.0/src/tests/test_integration.py 2019-02-22 03:23:27.301363601 +0700 -@@ -80,8 +80,9 @@ +From 9379ef5b73a8a07a6e8c95185db33b849a9d015f Mon Sep 17 00:00:00 2001 +From: John Vandenberg +Date: Sun, 15 Sep 2019 14:13:44 +0700 +Subject: [PATCH] test_integration: Use sys.executable + +Literal `python` is often `python2` and may not be present at all. + +Closes https://github.com/PyCQA/pydocstyle/issues/177 +--- + src/tests/test_integration.py | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/tests/test_integration.py b/src/tests/test_integration.py +index d4ee72b..1f9507f 100644 +--- a/src/tests/test_integration.py ++++ b/src/tests/test_integration.py +@@ -80,9 +80,10 @@ def invoke(self, args="", target=None): run_target = self.tempdir if target is None else \ os.path.join(self.tempdir, target) - cmd = shlex.split("{} {} {}" - .format(self.script_name, run_target, args), -+ cmd = shlex.split("{} -m {} {} {}" -+ .format(sys.executable, self.script_name, -+ run_target, args), - posix=False) +- posix=False) ++ cmd = shlex.split( ++ ('"{}" -m {} {} {}' if sys.platform == "nt" else '{} -m {} {} {}') ++ .format(sys.executable, self.script_name, run_target, args), ++ posix=False) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, -@@ -102,19 +103,6 @@ - pass - - --@pytest.yield_fixture(scope="module") --def install_package(request): -- """Install the package in development mode for the tests. -- -- This is so we can run the integration tests on the installed console -- script. -- """ -- cwd = os.path.join(os.path.dirname(__file__), '..', '..') -- subprocess.check_call(shlex.split("pip install -e ."), cwd=cwd) -- yield -- subprocess.check_call(shlex.split("pip uninstall -y pydocstyle"), cwd=cwd) -- -- - @pytest.yield_fixture(scope="function") - def env(request): - """Add a testing environment to a test method.""" -@@ -122,9 +110,6 @@ - yield test_env - - --pytestmark = pytest.mark.usefixtures("install_package") -- -- - def parse_errors(err): - """Parse `err` to a dictionary of {filename: error_codes}. - + stderr=subprocess.PIPE) +@@ -203,7 +204,7 @@ def test_run_as_named_module(): + return + # Add --match='' so that no files are actually checked (to make sure that + # the return code is 0 and to reduce execution time). +- cmd = shlex.split("python -m pydocstyle --match=''") ++ cmd = shlex.split("\"{}\" -m pydocstyle --match=''".format(sys.executable)) + p = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) diff --git a/pydocstyle-3.0.0.tar.gz b/pydocstyle-3.0.0.tar.gz deleted file mode 100644 index 9cf86b9..0000000 --- a/pydocstyle-3.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:99d4c0b584eca25a179766a1e4c7e69284bc94eb9abf6d8e010d69b5a22596ec -size 57749 diff --git a/pydocstyle-4.0.1.tar.gz b/pydocstyle-4.0.1.tar.gz new file mode 100644 index 0000000..85f04c8 --- /dev/null +++ b/pydocstyle-4.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15cda50d4ede4a90e8ceb53c42234408d7e6b5e73914c5ccbb55556e7b28e914 +size 61440 diff --git a/python-pydocstyle.changes b/python-pydocstyle.changes index 9d50f80..0169107 100644 --- a/python-pydocstyle.changes +++ b/python-pydocstyle.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Sun Sep 15 07:26:46 UTC 2019 - John Vandenberg + +- Update integration-tests-invocation.patch to match PR submitted + upstream, including an additional use of sys.executable in tests, + and move disabling of problematic fixture to the .spec +- Update to v4.0.1 + * D401: Fixed a false positive where one stem had multiple + imperative forms, e.g., init and initialize / initiate + * Fix parser hanging when there's a comment directly after ``__all__`` + * Fixed RST error in table which resulted in the online + documentation missing the violation code table + * Fixed IndentationError when parsing function arguments +- from v4.0.0 + * Support for Python 2.x and PyPy has been dropped + * Added initial support for Google convention + * Added pre-commit hook (#346) + * Fix parsing tuple syntax ``__all__`` (#355, #352). + ------------------------------------------------------------------- Tue Mar 5 09:59:41 UTC 2019 - Tomáš Chvátal diff --git a/python-pydocstyle.spec b/python-pydocstyle.spec index e04490d..f6f201f 100644 --- a/python-pydocstyle.spec +++ b/python-pydocstyle.spec @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pydocstyle -Version: 3.0.0 +Version: 4.0.1 Release: 0 Summary: Python docstring style checker License: MIT @@ -26,6 +26,7 @@ Group: Development/Languages/Python Url: https://github.com/PyCQA/pydocstyle/ Source: https://github.com/PyCQA/pydocstyle/archive/%{version}.tar.gz#/pydocstyle-%{version}.tar.gz # Tests invoke pip and pycodestyle directly, when they should use sys.executable. +# https://github.com/PyCQA/pydocstyle/pull/403 Patch0: integration-tests-invocation.patch BuildRequires: %{python_module mock} BuildRequires: %{python_module pathlib} @@ -66,6 +67,9 @@ conventions. %patch0 -p1 dos2unix README.rst +# Disable pip fixture +sed -i /^pytestmark/d src/tests/test_integration.py + %build %python_build @@ -74,8 +78,8 @@ dos2unix README.rst %{python_expand # sed -i -e '/^#! \//, 1d' %{buildroot}%{$python_sitelib}/pydocstyle/__main__.py dos2unix %{buildroot}%{$python_sitelib}/pydocstyle/__main__.py +%fdupes %{buildroot}%{$python_sitelib} } -%python_expand %fdupes %{buildroot}%{$python_sitelib} %check export PYTHONPATH=$(pwd)/src