Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pep440 for openSUSE:Factory checked in at 2022-09-25 15:35:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pep440 (Old) and /work/SRC/openSUSE:Factory/.python-pep440.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pep440" Sun Sep 25 15:35:07 2022 rev:2 rq:1005677 version:0.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pep440/python-pep440.changes 2022-09-19 16:02:55.494084350 +0200 +++ /work/SRC/openSUSE:Factory/.python-pep440.new.2275/python-pep440.changes 2022-09-25 15:35:29.179649415 +0200 @@ -1,0 +2,7 @@ +Fri Sep 16 21:17:55 UTC 2022 - Ben Greiner <[email protected]> + +- Update to 0.1.2 + * update build and test +- Clean specfile + +------------------------------------------------------------------- Old: ---- pep440-0.1.1.tar.gz New: ---- pep440-0.1.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pep440.spec ++++++ --- /var/tmp/diff_new_pack.72sqD4/_old 2022-09-25 15:35:29.811650937 +0200 +++ /var/tmp/diff_new_pack.72sqD4/_new 2022-09-25 15:35:29.811650937 +0200 @@ -16,21 +16,24 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pep440 -Version: 0.1.1 +Version: 0.1.2 Release: 0 Summary: Check whether versions number match PEP 440 License: MIT Group: Development/Languages/Python URL: https://github.com/Carreau/pep440 Source: https://files.pythonhosted.org/packages/source/p/pep440/pep440-%{version}.tar.gz -BuildRequires: %{python_module flit-core} +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module flit-core >= 3.4} BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest-console-scripts} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires(post): update-alternatives +Requires(postun):update-alternatives BuildArch: noarch %python_subpackages @@ -45,14 +48,23 @@ %install %pyproject_install +%python_clone -a %{buildroot}%{_bindir}/pep440 %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %pytest tests +%post +%python_install_alternative pep440 + +%postun +%python_uninstall_alternative pep440 + %files %{python_files} %doc readme.md %license LICENSE -%{python_sitelib}/pep440* +%python_alternative %{_bindir}/pep440 +%{python_sitelib}/pep440 +%{python_sitelib}/pep440-%{version}*-info %changelog ++++++ pep440-0.1.1.tar.gz -> pep440-0.1.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/.github/workflows/ci.yml new/pep440-0.1.2/.github/workflows/ci.yml --- old/pep440-0.1.1/.github/workflows/ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/pep440-0.1.2/.github/workflows/ci.yml 2022-09-13 18:40:40.437512200 +0200 @@ -0,0 +1,89 @@ +name: Run tests + +on: + push: + branches: + - main + - "*.x" + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install and update Python dependencies + run: python -m pip install --upgrade pip build + - name: Build + run: | + export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct) + pyproject-build . --sdist --wheel + cd dist && sha256sum * | tee SHA256SUMS + - name: Upload builds + uses: actions/upload-artifact@v2 + with: + name: pep440 dist ${{ github.run_number }} + path: ./dist + + lint: + needs: [build] + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install and update Python dependencies + run: python -m pip install --upgrade pip build + - name: Download builds + uses: actions/download-artifact@v2 + with: + name: pep440 dist ${{ github.run_number }} + path: ./dist + - name: Install lint dependencies + run: python -m pip install .[lint] + - name: Check builds + run: check-manifest + - name: Type check with mypy + run: mypy --strict pep440 + + test: + runs-on: ${{ matrix.os }} + needs: [build] + strategy: + fail-fast: true + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + python-version: ["3.7", "3.10", "pypy-3.8"] + include: + - os: ubuntu-latest + python-version: "3.11-dev" + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install and update Python dependencies + run: python -m pip install --upgrade pip + - name: Install package and test dependencies + run: python -m pip install -e .[test] + - name: pytest + run: | + pytest --cov=pep440 --cov-branch --cov-report=xml --cov-report=term-missing:skip-covered --no-cov-on-fail --cov-fail-under=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/.gitignore new/pep440-0.1.2/.gitignore --- old/pep440-0.1.1/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/pep440-0.1.2/.gitignore 2022-09-13 18:40:40.437620600 +0200 @@ -0,0 +1,6 @@ +__pycache__ +.coverage +build/ +coverage.xml +dist/ +htmlcov/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/.travis.yml new/pep440-0.1.2/.travis.yml --- old/pep440-0.1.1/.travis.yml 2022-08-16 11:39:07.620183000 +0200 +++ new/pep440-0.1.2/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ - -language: python -python: - - 3.5 - - 3.4 -before_install: - - pip install flit pytest -install: - - flit install -script: - - py.test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/PKG-INFO new/pep440-0.1.2/PKG-INFO --- old/pep440-0.1.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 +++ new/pep440-0.1.2/PKG-INFO 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +1,19 @@ Metadata-Version: 2.1 Name: pep440 -Version: 0.1.1 +Version: 0.1.2 Summary: A simple package with utils to check whether versions number match PEP 440. -Home-page: https://github.com/Carreau/pep440 -Author: Matthias Bussonnier -Author-email: [email protected] +Author-email: Matthias Bussonnier <[email protected]> +Requires-Python: >=3.7 Description-Content-Type: text/markdown Classifier: License :: OSI Approved :: MIT License +Requires-Dist: check-manifest ; extra == "lint" +Requires-Dist: mypy ; extra == "lint" +Requires-Dist: pytest-console-scripts ; extra == "test" +Requires-Dist: pytest-cov ; extra == "test" +Requires-Dist: pytest ; extra == "test" +Project-URL: Homepage, https://github.com/Carreau/pep440 +Provides-Extra: lint +Provides-Extra: test # PEP 440 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/pep440/__init__.py new/pep440-0.1.2/pep440/__init__.py --- old/pep440-0.1.1/pep440/__init__.py 2022-08-16 11:42:18.442524400 +0200 +++ new/pep440-0.1.2/pep440/__init__.py 2022-09-13 18:40:54.166057600 +0200 @@ -14,8 +14,7 @@ False """ -__version__ = "0.1.1" - +__version__ = "0.1.2" from argparse import ArgumentParser import sys @@ -30,7 +29,7 @@ ) -def main(): +def main() -> None: parser = ArgumentParser() parser.add_argument("version", nargs="?") parser.add_argument("--verbose", nargs="?") @@ -45,4 +44,4 @@ sys.exit(not c) parser.print_help() - sys.exit(-1) + sys.exit(2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/pep440/core.py new/pep440-0.1.2/pep440/core.py --- old/pep440-0.1.1/pep440/core.py 2022-08-16 11:42:18.445010400 +0200 +++ new/pep440-0.1.2/pep440/core.py 2022-09-13 18:40:40.438014700 +0200 @@ -1,4 +1,4 @@ -# This fiel is part of the python package pep 440 +# This file is part of the python package ``pep440`` # Feel free to vendor just this file, if should contain all you need. # # Vendored version of commit <put the commit here> @@ -28,26 +28,26 @@ ############################################################################### import re -posint = "(0|[1-9]\d*)" +posint = r"(0|[1-9]\d*)" # 0!0.0.0rc0.post0.dev0 tpl_string_re = ( - "^" # Start - "([1-9]\d*!)?" # [N!] - "{posint}" # N - "(\.{posint})*" # (.N)* - "((a|b|rc){posint})?" # [{a|b|rc}N] - "(\.post{posint})?" # [.postN] - "(\.dev{postdev})?" # [.devN] - "$" + r"^" # Start + r"([1-9]\d*!)?" # [N!] + r"{posint}" # N + r"(\.{posint})*" # (.N)* + r"((a|b|rc){posint})?" # [{a|b|rc}N] + r"(\.post{posint})?" # [.postN] + r"(\.dev{postdev})?" # [.devN] + r"$" ) string_re = tpl_string_re.format(posint=posint, postdev=posint) loose440re = re.compile(tpl_string_re.format(posint=posint, postdev=(posint + "?"))) pep440re = re.compile(string_re) -def is_canonical(version, loosedev=False): +def is_canonical(version: str, loosedev: bool=False) -> bool: """ Return whether or not the version string is canonical according to Pep 440 """ @@ -56,7 +56,7 @@ return pep440re.match(version) is not None -def assert_valid(version): +def assert_valid(version: str) -> None: if not is_canonical(version): raise AssertionError( "Version string {!r} does not match PEP 440 specification".format(version) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/pyproject.toml new/pep440-0.1.2/pyproject.toml --- old/pep440-0.1.1/pyproject.toml 2022-08-16 11:39:41.313952000 +0200 +++ new/pep440-0.1.2/pyproject.toml 2022-09-13 18:40:40.438171600 +0200 @@ -1,14 +1,49 @@ [build-system] -requires = ["flit_core >=2,<4"] +requires = ["flit_core >=3.4,<4"] build-backend = "flit_core.buildapi" -[tool.flit.metadata] -module = "pep440" -author = "Matthias Bussonnier" -author-email = "[email protected]" -home-page = "https://github.com/Carreau/pep440" +[project] +name = "pep440" +authors = [ + {name = "Matthias Bussonnier", email = "[email protected]"}, +] +readme = "readme.md" classifiers = [ "License :: OSI Approved :: MIT License", ] -description-file = "readme.md" +requires-python = ">=3.7" +dynamic = ["version", "description"] + +[project.scripts] +pep440 = "pep440.__main__:main" + +[project.urls] +Homepage = "https://github.com/Carreau/pep440" + +[project.optional-dependencies] +test = [ + "pytest-console-scripts", + "pytest-cov", + "pytest", +] +lint = [ + "check-manifest", + "mypy", +] +[tool.flit.sdist] +include = [ + "tests/", + "LICENSE" +] + +[tool.check-manifest] +ignore = [ + "tests/__pycache__/*.pyc", +] + +[tool.pytest.ini_options] +testpaths = [ + "tests/", +] +script_launch_mode = "subprocess" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/tests/test_cli.py new/pep440-0.1.2/tests/test_cli.py --- old/pep440-0.1.1/tests/test_cli.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pep440-0.1.2/tests/test_cli.py 2022-09-13 18:40:40.438270000 +0200 @@ -0,0 +1,35 @@ +import os + +import pytest +import pep440 + +NAME = "pep440" + [email protected] +def cli(script_runner): + def run_cli(*args, **kwargs): + env = dict(os.environ) + env.update(kwargs.pop("env", {})) + env["PYTHONIOENCODING"] = "utf-8" + kwargs["env"] = env + return script_runner.run(NAME, *map(str, args), **kwargs) + + return run_cli + + [email protected]("args,rc", [ + [["--help"], 0], + [[], 2] +]) +def test_cli_help(cli, args, rc): + ret = cli(*args) + assert ret.returncode == rc + assert f"usage: {NAME}" in ret.stdout.strip() + [email protected]("version,rc",[ + ["0.0.0", 0], + ["not-a-version", 1] +]) +def test_cli_version(cli, version, rc): + ret = cli(version) + assert ret.returncode == rc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pep440-0.1.1/tests/test_pep.py new/pep440-0.1.2/tests/test_pep.py --- old/pep440-0.1.1/tests/test_pep.py 2022-08-16 11:42:18.446506700 +0200 +++ new/pep440-0.1.2/tests/test_pep.py 2022-09-13 18:40:40.438422400 +0200 @@ -1,4 +1,6 @@ -from pep440 import is_canonical +import pytest + +from pep440 import is_canonical, assert_valid ok = [ "1!2.3.4rc5.post6.dev7", @@ -38,11 +40,14 @@ def test_ok(): for version in ok: assert is_canonical(version) + assert_valid(version) def test_not_ok(): for version in not_ok: assert is_canonical(version) == False + with pytest.raises(AssertionError): + assert_valid(version) def test_ok_loose():
