Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-gp-libs for openSUSE:Factory checked in at 2024-01-03 12:24:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-gp-libs (Old) and /work/SRC/openSUSE:Factory/.python-gp-libs.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-gp-libs" Wed Jan 3 12:24:48 2024 rev:2 rq:1135655 version:0.0.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-gp-libs/python-gp-libs.changes 2023-11-24 23:33:51.077349544 +0100 +++ /work/SRC/openSUSE:Factory/.python-gp-libs.new.28375/python-gp-libs.changes 2024-01-03 12:24:55.051322751 +0100 @@ -1,0 +2,7 @@ +Fri Dec 29 12:45:26 UTC 2023 - Dirk Müller <dmueller@suse.com> + +- update to 0.0.5: + * Move CodeQL from advanced configuration file to GitHub’s default + * Add docstrings to functions, methods, classes, and packages + +------------------------------------------------------------------- Old: ---- gp_libs-0.0.4.tar.gz New: ---- gp_libs-0.0.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gp-libs.spec ++++++ --- /var/tmp/diff_new_pack.nI1OLw/_old 2024-01-03 12:24:55.611343212 +0100 +++ /var/tmp/diff_new_pack.nI1OLw/_new 2024-01-03 12:24:55.615343359 +0100 @@ -17,18 +17,18 @@ Name: python-gp-libs -Version: 0.0.4 +Version: 0.0.5 Release: 0 Summary: Internal utilities for projects following git-pull python package spec License: MIT URL: https://gp-libs.git-pull.com Source: https://files.pythonhosted.org/packages/source/g/gp-libs/gp_libs-%{version}.tar.gz -BuildRequires: python-rpm-macros -BuildRequires: %{python_module pip} -BuildRequires: %{python_module wheel} -BuildRequires: %{python_module poetry-core >= 1.0.0} BuildRequires: %{python_module docutils} BuildRequires: %{python_module myst-parser} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module poetry-core >= 1.0.0} +BuildRequires: %{python_module wheel} +BuildRequires: python-rpm-macros # SECTION test BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytest-rerunfailures} ++++++ gp_libs-0.0.4.tar.gz -> gp_libs-0.0.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/PKG-INFO new/gp_libs-0.0.5/PKG-INFO --- old/gp_libs-0.0.4/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/gp_libs-0.0.5/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: gp-libs -Version: 0.0.4 +Version: 0.0.5 Summary: Internal utilities for projects following git-pull python package spec Home-page: https://gp-libs.git-pull.com License: MIT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/pyproject.toml new/gp_libs-0.0.5/pyproject.toml --- old/gp_libs-0.0.4/pyproject.toml 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/pyproject.toml 2023-12-03 10:54:20.496441600 +0100 @@ -1,6 +1,6 @@ [tool.poetry] name = "gp-libs" -version = "0.0.4" +version = "0.0.5" description = "Internal utilities for projects following git-pull python package spec" license = "MIT" authors = ["Tony Narlock <tony@git-pull.com>"] @@ -99,6 +99,7 @@ "TRY", # Trycertatops "PERF", # Perflint "RUF", # Ruff-specific rules + "D", # pydocstyle ] [tool.ruff.isort] @@ -112,6 +113,9 @@ ] combine-as-imports = true +[tool.ruff.pydocstyle] +convention = "numpy" + [tool.ruff.per-file-ignores] "*/__init__.py" = ["F401"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/doctest_docutils.py new/gp_libs-0.0.5/src/doctest_docutils.py --- old/gp_libs-0.0.4/src/doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/src/doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,3 +1,4 @@ +"""Doctest module for docutils.""" import doctest import functools import linecache @@ -30,23 +31,24 @@ def is_allowed_version(version: str, spec: str) -> bool: """Check `spec` satisfies `version` or not. + This obeys PEP-440 specifiers: https://peps.python.org/pep-0440/#version-specifiers + Some examples: - >>> is_allowed_version('3.3', '<=3.5') - True - >>> is_allowed_version('3.3', '<=3.2') - False - >>> is_allowed_version('3.3', '>3.2, <4.0') - True + + >>> is_allowed_version('3.3', '<=3.5') + True + >>> is_allowed_version('3.3', '<=3.2') + False + >>> is_allowed_version('3.3', '>3.2, <4.0') + True """ return Version(version) in SpecifierSet(spec) class TestDirective(Directive): - """ - Base class for doctest-related directives. - """ + """Base class for doctest-related directives.""" has_content = True required_arguments = 0 @@ -62,6 +64,7 @@ node.source, node.line = self.get_source_info() def run(self) -> t.List[Node]: + """Run docutils test directive.""" # use ordinary docutils nodes for test code: they get special attributes # so that our builder recognizes them, and the other builders are happy. code = "\n".join(self.content) @@ -135,14 +138,20 @@ class TestsetupDirective(TestDirective): + """Test setup directive.""" + option_spec: t.ClassVar[OptionSpec] = {"skipif": directives.unchanged_required} class TestcleanupDirective(TestDirective): + """Test cleanup directive.""" + option_spec: t.ClassVar[OptionSpec] = {"skipif": directives.unchanged_required} class DoctestDirective(TestDirective): + """Doctest directive.""" + option_spec: t.ClassVar[OptionSpec] = { "hide": directives.flag, "no-trim-doctest-flags": directives.flag, @@ -154,6 +163,8 @@ class MockTabDirective(TestDirective): + """Mock tab directive.""" + def run(self) -> t.List[Node]: """Parse a mock-tabs directive.""" self.assert_has_content() @@ -164,6 +175,7 @@ def setup() -> t.Dict[str, t.Any]: + """Configure doctest for doctest_docutils.""" directives.register_directive("testsetup", TestsetupDirective) directives.register_directive("testcleanup", TestcleanupDirective) directives.register_directive("doctest", DoctestDirective) @@ -181,6 +193,8 @@ class DocTestFinderNameDoesNotExist(ValueError): + """Raised with doctest lookup name not provided.""" + def __init__(self, string: str): return super().__init__( "DocTestFinder.find: name must be given " @@ -189,11 +203,11 @@ class DocutilsDocTestFinder: - """ - A class used to extract the DocTests that are relevant to a given - docutils file. Doctests can be extracted from the following directive - types: doctest_block (doctest), DocTestDirective. Myst-parser is also - supported for parsing markdown files. + """DocTestFinder for doctest-docutils. + + Class used to extract the DocTests relevant to a docutils file. Doctests are + extracted from the following directive types: doctest_block (doctest), + DocTestDirective. Myst-parser is also supported for parsing markdown files. """ def __init__( @@ -201,13 +215,11 @@ verbose: bool = False, parser: "doctest.DocTestParser" = parser, ): - """ - Create a new doctest finder. + """Create a new doctest finder. - The optional argument `parser` specifies a class or - function that should be used to create new DocTest objects (or - objects that implement the same interface as DocTest). The - signature for this factory function should match the signature + The optional argument `parser` specifies a class or function that should be used + to create new DocTest objects (or objects that implement the same interface as + DocTest). The signature for this factory function should match the signature of the DocTest constructor. """ self._parser = parser @@ -220,20 +232,14 @@ globs: t.Optional[t.Dict[str, t.Any]] = None, extraglobs: t.Optional[t.Dict[str, t.Any]] = None, ) -> t.List[doctest.DocTest]: - """ - Return a list of the DocTests that are defined by the given - string (its parsed directives). - - The globals for each DocTest is formed by combining `globs` - and `extraglobs` (bindings in `extraglobs` override bindings - in `globs`). A new copy of the globals dictionary is created - for each DocTest. If `globs` is not specified, then it - defaults to the module's `__dict__`, if specified, or {} - otherwise. If `extraglobs` is not specified, then it defaults - to {}. + """Return list of the DocTests defined by given string (its parsed directives). + The globals for each DocTest is formed by combining `globs` and `extraglobs` + (bindings in `extraglobs` override bindings in `globs`). A new copy of the + globals dictionary is created for each DocTest. If `globs` is not specified, + then it defaults to the module's `__dict__`, if specified, or {} otherwise. + If `extraglobs` is not specified, then it defaults to {}. """ - # If name was not specified, then extract it from the string. if name is None: name = getattr(string, "__name__", None) @@ -272,9 +278,7 @@ seen: t.Dict[int, int], source_path: t.Optional[pathlib.Path] = None, ) -> None: - """ - Find tests for the given string, and add them to `tests`. - """ + """Find tests for the given string, and add them to `tests`.""" if self._verbose: print("Finding tests in %s" % name) @@ -369,10 +373,12 @@ def _from_module( self, module: t.Optional[t.Union[str, types.ModuleType]], object: object ) -> bool: - """`cached_property` objects are never considered a part + """Return true if the given object lives in the given module. + + `cached_property` objects are never considered a part of the 'current module'. As such they are skipped by doctest. Here we override `_from_module` to check the underlying - function instead. https://github.com/python/cpython/issues/107995 + function instead. https://github.com/python/cpython/issues/107995. """ if isinstance(object, functools.cached_property): object = object.func @@ -394,10 +400,7 @@ globs: t.Dict[str, t.Any], source_lines: t.List[str], ) -> doctest.DocTest: - """ - Return a DocTest for the given string, if it defines a docstring; - otherwise, return None. - """ + """Return a DocTest for given string, or return None.""" lineno = int(source_lines[0]) # Return a DocTest for this string. @@ -405,6 +408,8 @@ class TestDocutilsPackageRelativeError(Exception): + """Raise when doctest_docutils is called for package not relative to module.""" + def __init__(self) -> None: return super().__init__( "Package may only be specified for module-relative paths." @@ -476,7 +481,9 @@ def _test() -> int: - """Changes from standard library at 3.10 + """Execute doctest module via CLI. + + Port changes from standard library at 3.10: - Sets up logging.basicLogging(level=logging.DEBUG) w/ args.verbose """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/gp_libs.py new/gp_libs-0.0.5/src/gp_libs.py --- old/gp_libs-0.0.4/src/gp_libs.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/src/gp_libs.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,7 +1,8 @@ +"""Metadata package for gp-libs.""" __title__ = "gp-libs" __package_name__ = "gp_libs" __description__ = "Internal utilities for git-pull projects" -__version__ = "0.0.4" +__version__ = "0.0.5" __author__ = "Tony Narlock" __github__ = "https://github.com/git-pull/gp-libs" __docs__ = "https://gp-libs.git-pull.com" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/linkify_issues.py new/gp_libs-0.0.5/src/linkify_issues.py --- old/gp_libs-0.0.4/src/linkify_issues.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/src/linkify_issues.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,3 +1,4 @@ +"""Autolinking extension for Sphinx.""" import re import typing as t @@ -12,9 +13,12 @@ class LinkifyIssues(SphinxTransform): + """Autolink references for Sphinx.""" + default_priority = 999 def apply(self) -> None: + """Apply Sphinx transform.""" config = self.document.settings.env.config issue_re: re.Pattern[str] = ( re.compile(config.issue_re) @@ -58,12 +62,15 @@ class SetupDict(t.TypedDict): + """Setup mapping for Sphinx app.""" + version: str parallel_read_safe: bool parallel_write_safe: bool def setup(app: Sphinx) -> SetupDict: + """Initialize Sphinx extension for linkify_issues.""" app.add_transform(LinkifyIssues) app.add_config_value("issue_re", re.compile(DEFAULT_ISSUE_RE), "env") app.add_config_value( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/src/pytest_doctest_docutils.py new/gp_libs-0.0.5/src/pytest_doctest_docutils.py --- old/gp_libs-0.0.4/src/pytest_doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/src/pytest_doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,6 +1,4 @@ -"""pytest_doctest_docutils - -pytest plugin for doctest w/ reStructuredText and markdown +"""pytest plugin for doctest w/ reStructuredText and markdown. .. seealso:: @@ -40,6 +38,7 @@ def pytest_addoption(parser: "Parser") -> None: + """Add options to py.test for doctest_doctests.""" group = parser.getgroup("collect") group.addoption( "--doctest-docutils-modules", @@ -66,6 +65,7 @@ def pytest_unconfigure() -> None: + """Unconfigure hook for pytest-doctest-docutils.""" global RUNNER_CLASS RUNNER_CLASS = None @@ -74,6 +74,7 @@ def pytest_collect_file( file_path: pathlib.Path, parent: pytest.Collector ) -> t.Optional[t.Union["DocTestDocutilsFile", "_pytest.doctest.DoctestModule"]]: + """Test collector for pytest-doctest-docutils.""" config = parent.config if file_path.suffix == ".py": if config.option.doctestmodules and not any( @@ -179,9 +180,12 @@ class DocutilsDocTestRunner(doctest.DocTestRunner): + """DocTestRunner for doctest_docutils.""" + def summarize( # type: ignore self, out: "_Out", verbose: t.Optional[bool] = None ) -> t.Tuple[int, int]: + """Summarize the test runs.""" string_io = io.StringIO() old_stdout = sys.stdout sys.stdout = string_io @@ -211,7 +215,10 @@ class DocTestDocutilsFile(pytest.Module): + """Pytest module for doctest_docutils.""" + def collect(self) -> t.Iterable["DoctestItem"]: + """Collect tests for pytest module.""" setup() encoding = self.config.getini("doctest_encoding") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/__init__.py new/gp_libs-0.0.5/tests/__init__.py --- old/gp_libs-0.0.4/tests/__init__.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/tests/__init__.py 2023-12-03 10:54:20.496441600 +0100 @@ -0,0 +1 @@ +"""Tests for gp_libs package.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/conftest.py new/gp_libs-0.0.5/tests/conftest.py --- old/gp_libs-0.0.4/tests/conftest.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/tests/conftest.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,3 +1,12 @@ +"""Conftest.py (root-level). + +We keep this in root pytest fixtures in pytest's doctest plugin to be available, as well +as avoiding conftest.py from being included in the wheel, in addition to pytest_plugin +for pytester only being available via the root directory. + +See "pytest_plugins in non-top-level conftest files" in +https://docs.pytest.org/en/stable/deprecations.html +""" import pathlib import typing as t @@ -10,6 +19,8 @@ class MakeAppParams(t.Protocol): + """Typing protocol for sphinx make_app_params.""" + def __call__( self, #: index content @@ -17,6 +28,7 @@ *args: object, **kwargs: t.Any, ) -> AppParams: + """Create Sphinx App factory with params.""" ... @@ -26,6 +38,8 @@ app_params: AppParams, tmp_path: pathlib.Path, ) -> t.Generator[t.Callable[[t.Any], AppParams], None, None]: + """Return Sphinx App factory, accepts custom params.""" + def fn( #: index content index: t.Optional[t.Union[t.IO[str], str]] = None, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/test_doctest_docutils.py new/gp_libs-0.0.5/tests/test_doctest_docutils.py --- old/gp_libs-0.0.4/tests/test_doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/tests/test_doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,3 +1,4 @@ +"""Tests for doctest_docutils.""" import doctest import pathlib import textwrap @@ -10,6 +11,8 @@ class DocTestFinderFixture(t.NamedTuple): + """Test fixture for doctest_docutils.""" + # pytest test_id: str @@ -185,6 +188,8 @@ class FilePathModeNotImplemented(Exception): + """Raised if file_path_mode not supported.""" + def __init__(self, file_path_mode: str) -> None: return super().__init__(f"No file_path_mode supported for {file_path_mode}") @@ -201,6 +206,7 @@ tests_found: int, file_path_mode: str, ) -> None: + """Test for doctest_docutils.""" # Initialize variables tests_path = tmp_path / "tests" first_test_key = next(iter(files.keys())) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/test_linkify_issues.py new/gp_libs-0.0.5/tests/test_linkify_issues.py --- old/gp_libs-0.0.4/tests/test_linkify_issues.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/tests/test_linkify_issues.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,3 +1,4 @@ +"""Tests for linkify_issues extension for sphinx.""" import pathlib import typing as t @@ -9,6 +10,8 @@ class LinkTestFixture(t.NamedTuple): + """Pytest fixtures for linkify_issues.""" + # pytest test_id: str @@ -47,6 +50,7 @@ text: str, issue_id: str, ) -> None: + """Test linkification of issues.""" args, kwargs = make_app_params( index=text, confoverrides={"issue_url_tpl": issue_url_tpl, "extensions": "linkify_issues"}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gp_libs-0.0.4/tests/test_pytest_doctest_docutils.py new/gp_libs-0.0.5/tests/test_pytest_doctest_docutils.py --- old/gp_libs-0.0.4/tests/test_pytest_doctest_docutils.py 2023-11-19 12:12:35.132315900 +0100 +++ new/gp_libs-0.0.5/tests/test_pytest_doctest_docutils.py 2023-12-03 10:54:20.496441600 +0100 @@ -1,3 +1,4 @@ +"""Test pytest plugin for doctest_docutils.""" import textwrap import typing as t @@ -8,6 +9,8 @@ class PytestDocTestFinderFixture(t.NamedTuple): + """Pytest fixture for DocTestFinder.""" + # pytest test_id: str @@ -199,6 +202,7 @@ files: FixtureFileDict, tests_found: int, ) -> None: + """Verify DocTestFinder's collection of doctests.""" # Initialize variables pytester.plugins = ["pytest_doctest_docutils"] pytester.makefile( @@ -233,6 +237,7 @@ pytester: _pytest.pytester.Pytester, monkeypatch: pytest.MonkeyPatch, ) -> None: + """Test pytest plugin with python file doctests.""" # Initialize variables pytester.plugins = ["pytest_doctest_docutils"] pytester.makefile( @@ -304,6 +309,7 @@ pytester: _pytest.pytester.Pytester, monkeypatch: pytest.MonkeyPatch, ) -> None: + """Test pytest plugin with doctests in markdown.""" # Initialize variables pytester.plugins = ["pytest_doctest_docutils"] pytester.makefile(