From e59f9a72fbbd04375dde75fb6d8badf48356c25b03aa2afe8309b7fb52ab6f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 5 Mar 2019 09:59:08 +0000 Subject: [PATCH] Accepting request 681588 from home:jayvdb:coala:python3-bears - Fix %check to run the tests from GitHub tarball, and use integration-tests-invocation.patch to invoke pycodestyle using sys.executable, and do not install and uninstall pip during tests. - Fix line endings and remove hashbangs - Update to v3.0.0, including support for Python 3.7 OBS-URL: https://build.opensuse.org/request/show/681588 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydocstyle?expand=0&rev=9 --- integration-tests-invocation.patch | 44 ++++++++++++++++++++++++++++++ pydocstyle-2.1.1.tar.gz | 3 -- pydocstyle-3.0.0.tar.gz | 3 ++ python-pydocstyle.changes | 27 ++++++++++++++++++ python-pydocstyle.spec | 41 +++++++++++++++------------- 5 files changed, 96 insertions(+), 22 deletions(-) create mode 100644 integration-tests-invocation.patch delete mode 100644 pydocstyle-2.1.1.tar.gz create mode 100644 pydocstyle-3.0.0.tar.gz diff --git a/integration-tests-invocation.patch b/integration-tests-invocation.patch new file mode 100644 index 0000000..22b3394 --- /dev/null +++ b/integration-tests-invocation.patch @@ -0,0 +1,44 @@ +--- 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 @@ + 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) + 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}. + diff --git a/pydocstyle-2.1.1.tar.gz b/pydocstyle-2.1.1.tar.gz deleted file mode 100644 index ff37c63..0000000 --- a/pydocstyle-2.1.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4d5bcde961107873bae621f3d580c3e35a426d3687ffc6f8fb356f6628da5a97 -size 28542 diff --git a/pydocstyle-3.0.0.tar.gz b/pydocstyle-3.0.0.tar.gz new file mode 100644 index 0000000..9cf86b9 --- /dev/null +++ b/pydocstyle-3.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99d4c0b584eca25a179766a1e4c7e69284bc94eb9abf6d8e010d69b5a22596ec +size 57749 diff --git a/python-pydocstyle.changes b/python-pydocstyle.changes index a9a280f..f74b689 100644 --- a/python-pydocstyle.changes +++ b/python-pydocstyle.changes @@ -1,9 +1,36 @@ ------------------------------------------------------------------- + +Mon Mar 3 15:20:38 UTC 2019 - John Vandenberg + +- Fix %check to run the tests from GitHub tarball, and use + integration-tests-invocation.patch to invoke pycodestyle using + sys.executable, and do not install and uninstall pip during tests. +- Fix line endings and remove hashbangs +- Update to v3.0.0 + + Major Updates + * Support for Python 3.3 has been dropped + * Added support for Python 3.7 + + New features + * Violations are now reported on the line where the docstring starts, not + the line of the def/class it corresponds to + * Updated description of pep257 and numpy conventions + * __all__ parsing is now done on a best-effort basis - if __all__ can't + be statically determined, it will be ignored + + Bug Fixes + * Fixed a false-positive recognition of section names causing D405 to be + reported + * Fixed a bug where functions that don't end with a newline will sometimes + raise an exception +- Set six minimum version to v1.10.0 + +------------------------------------------------------------------- + Fri Mar 1 11:13:40 UTC 2019 - Hans-Peter Jansen - don't run tests, if they're disabled from build conditional ------------------------------------------------------------------- + Tue Dec 4 12:52:06 UTC 2018 - Matej Cepl - Remove superfluous devel dependency for noarch package diff --git a/python-pydocstyle.spec b/python-pydocstyle.spec index c52f6b7..e04490d 100644 --- a/python-pydocstyle.spec +++ b/python-pydocstyle.spec @@ -17,24 +17,29 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%bcond_without test Name: python-pydocstyle -Version: 2.1.1 +Version: 3.0.0 Release: 0 Summary: Python docstring style checker License: MIT Group: Development/Languages/Python Url: https://github.com/PyCQA/pydocstyle/ -Source: https://files.pythonhosted.org/packages/source/p/pydocstyle/pydocstyle-%{version}.tar.gz +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. +Patch0: integration-tests-invocation.patch +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pathlib} +# Tests invoke pip +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} -BuildRequires: python-rpm-macros -%if %{with test} -BuildRequires: %{python_module six} +BuildRequires: %{python_module six > 1.10.0} BuildRequires: %{python_module snowballstemmer} -BuildRequires: python-configparser -%endif +BuildRequires: dos2unix BuildRequires: fdupes -Requires: python-six +BuildRequires: python-configparser +BuildRequires: python-rpm-macros +Requires: python-six > 1.10.0 Requires: python-snowballstemmer %ifpython2 Requires: python-configparser @@ -58,27 +63,25 @@ conventions. %prep %setup -q -n pydocstyle-%{version} +%patch0 -p1 +dos2unix README.rst %build %python_build %install %python_install +%{python_expand # +sed -i -e '/^#! \//, 1d' %{buildroot}%{$python_sitelib}/pydocstyle/__main__.py +dos2unix %{buildroot}%{$python_sitelib}/pydocstyle/__main__.py +} %python_expand %fdupes %{buildroot}%{$python_sitelib} -%if %{with test} %check -mkdir empty -pushd empty -%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib} -$python -c "import pydocstyle" -$python -c "from pydocstyle import *" -} -popd -%endif +export PYTHONPATH=$(pwd)/src +%python_exec -m pytest %files %{python_files} -%defattr(-,root,root,-) %doc README.rst %license LICENSE-MIT %python3_only %{_bindir}/pydocstyle