From 3215a9931bfc501b41274f716a6966273bc0c287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 3 Apr 2023 16:34:29 +0200 Subject: [PATCH 1/8] Remove incorrect dependencies in pyproject.toml (#405) * Remove redundant wheel dep from pyproject.toml Remove the redundant `wheel` dependency, as it is added by the backend automatically. Listing it explicitly in the documentation was a historical mistake and has been fixed since, see: https://github.com/pypa/setuptools/commit/f7d30a9529378cf69054b5176249e5457aaf640a * Add build into deps (prepare-dist) Co-authored-by: Tom Schraitle --- pyproject.toml | 2 -- tox.ini | 2 -- 2 files changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d288e68e..e611abc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,8 +10,6 @@ requires = [ # sync with setup.py until we discard non-pep-517/518 "setuptools", "setuptools-scm", - "wheel", - "build", ] build-backend = "setuptools.build_meta" diff --git a/tox.ini b/tox.ini index b71ae78e..fb91a518 100644 --- a/tox.ini +++ b/tox.ini @@ -99,9 +99,7 @@ commands = make -C docs man description = Prepare for TestPyPI basepython = python3 deps = - wheel twine - # PEP 517 build frontend build commands = # Same as python3 -m build From 7625129e911829e359c150b3d155345a05f83140 Mon Sep 17 00:00:00 2001 From: Benjamin K <53038537+treee111@users.noreply.github.com> Date: Wed, 12 Apr 2023 16:32:48 +0200 Subject: [PATCH 2/8] correct typo in function description --- src/semver/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/semver/version.py b/src/semver/version.py index cca744a1..e9d0e15b 100644 --- a/src/semver/version.py +++ b/src/semver/version.py @@ -432,7 +432,7 @@ def next_version(self, part: str, prerelease_token: str = "rc") -> "Version": This function is taking prereleases into account. The "major", "minor", and "patch" raises the respective parts like the ``bump_*`` functions. The real difference is using the - "preprelease" part. It gives you the next patch version of the + "prerelease" part. It gives you the next patch version of the prerelease, for example: >>> str(semver.parse("0.1.4").next_version("prerelease")) From 100d90b27f0d5ae26d2892a73b2525ba49c850f5 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Sat, 22 Apr 2023 16:08:00 +0200 Subject: [PATCH 3/8] Improve GitHub Action * Set timeout-minutes ti 15min * Add on.push.path on.pull_request.path * Raise Python 3.7 -> 3.8 * Use cache for actions/setup-python@v3 --- .github/workflows/python-testing.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-testing.yml b/.github/workflows/python-testing.yml index fb23fcf8..8f32ffd1 100644 --- a/.github/workflows/python-testing.yml +++ b/.github/workflows/python-testing.yml @@ -3,9 +3,21 @@ name: Python on: push: - branches: [ master ] + branches: [ "master", "main" ] + paths: + - 'pyproject.toml' + - '**.py' + - '.github/workflows/python-testing.yml' + pull_request: - branches: [ master ] + branches: [ "master", "main" ] + paths: + - 'pyproject.toml' + - '**.py' + - '.github/workflows/python-testing.yml' + +permissions: + contents: read concurrency: # only cancel in-progress runs of the same workflow @@ -17,6 +29,9 @@ concurrency: jobs: check: runs-on: ubuntu-latest + # Timout of 15min + timeout-minutes: 15 + steps: - uses: actions/checkout@v3 - name: Output env variables @@ -41,7 +56,8 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: - python-version: 3.7 + python-version: 3.8 + cache: 'pip' - name: Install dependencies run: | python3 -m pip install --upgrade pip setuptools setuptools-scm @@ -70,6 +86,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install dependencies run: | python3 -m pip install --upgrade pip From 39bf287af9106986404762d91c20a27ca97b2219 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Thu, 27 Apr 2023 08:25:37 +0200 Subject: [PATCH 4/8] Add CITATION.cff for citation Benefits: * Users of our software can easily cite it using the metadata from CITATION.cff * GitHub shows the citation information in the sidebar * Browser plugins can import the correct reference Sources: * https://citation-file-format.github.io/ * https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files --- CITATION.cff | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 CITATION.cff diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..708f4d0a --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,104 @@ +# This CITATION.cff file was generated with cffinit: +# https://bit.ly/cffinit + +cff-version: 1.2.0 +title: python-semver +message: >- + If you use this software, please cite it using the + metadata from this file. +type: software + +authors: + - given-names: Kostiantyn + family-names: Rybnikov + email: k-bx@k-bx.com + - given-names: Tom + family-names: Schraitle + email: tom_schr@web.de + - given-names: Sebastian + family-names: Celles + email: s.celles@gmail.com + - name: "The python-semver software team" + +identifiers: + - type: url + value: 'https://github.com/python-semver/python-semver' + description: GitHub python-semver/python-semver +url: 'https://python-semver.readthedocs.io' +repository-code: 'https://github.com/python-semver/python-semver' +repository-artifact: 'https://pypi.org/project/semver/' + +abstract: >- + A Python module for semantic versioning. Simplifies + comparing versions. This modules follows the + MAJOR.MINOR.PATCH style. + +keywords: + - Python + - Python module + - semver + - versioning + - semantic versioning + - semver-format + - semver-tag + - versions + +references: + - authors: + - family-names: Preston-Werner + given-names: Tom + - name: "The semver team" + title: 'Semantic Versioning 2.0.0' + url: 'https://semver.org' + repository-code: 'https://github.com/semver/semver' + type: standard + version: 2.0.0 + languages: + - ar + - bg + - ca + - cs + - da + - de + - el + - en + - es + - fa + - fr + - he + - hin + - hr + - hu + - hy + - id + - it + - ja + - ka + - kab + - ko + - nl + - pl + - pt + - ro + - ru + - sk + - sl + - sr + - sv + - tr + - uk + - vi + - zh + abstract: >- + Given a version number MAJOR.MINOR.PATCH, increment the: + + 1. MAJOR version when you make incompatible API changes + 2. MINOR version when you add functionality in a backwards compatible manner + 3. PATCH version when you make backwards compatible bug fixes + + Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format. + +license: BSD-3-Clause +commit: 3a7680dc436211227c0aeae84c9b45e0b3345b8f +version: 3.0.0 +date-released: '2023-04-02' From 2a8331f3d4f4fe824360487071599d4dc0aeab09 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Thu, 27 Apr 2023 09:57:53 +0200 Subject: [PATCH 5/8] Mention CITATION.cff in release procedure --- release-procedure.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release-procedure.md b/release-procedure.md index d6c1701e..f7b8d7bb 100644 --- a/release-procedure.md +++ b/release-procedure.md @@ -20,6 +20,7 @@ create a new release. * `setup.cfg` * `tox.ini` * `.git/workflows/pythonpackage.yml` + * `CITATION.cff` 1. Verify that the version has been updated and follow : From 17bc2571c4f3c7faf85d5b024d5f9117d555d49b Mon Sep 17 00:00:00 2001 From: Dhaval Soneji Date: Wed, 14 Jun 2023 11:35:35 +0100 Subject: [PATCH 6/8] Fix #410 Export all names in __all__ variable * Export all semver names in `__all__` variable. * Fix linting issues --- changelog.d/410.bugfix.rst | 1 + src/semver/__init__.py | 35 ++++++++++++++++++++++++++++++++++- src/semver/cli.py | 2 +- src/semver/version.py | 4 ++-- 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 changelog.d/410.bugfix.rst diff --git a/changelog.d/410.bugfix.rst b/changelog.d/410.bugfix.rst new file mode 100644 index 00000000..1b2dcf74 --- /dev/null +++ b/changelog.d/410.bugfix.rst @@ -0,0 +1 @@ +Export functions properly using `__all__` in `__init__.py`. \ No newline at end of file diff --git a/src/semver/__init__.py b/src/semver/__init__.py index 433e5d5d..19c88f78 100644 --- a/src/semver/__init__.py +++ b/src/semver/__init__.py @@ -1,5 +1,5 @@ """ -semver package major release 3. +Semver package major release 3. A Python module for semantic versioning. Simplifies comparing versions. """ @@ -37,3 +37,36 @@ __maintainer_email__, SEMVER_SPEC_VERSION, ) + +__all__ = [ + "bump_build", + "bump_major", + "bump_minor", + "bump_patch", + "compare", + "bump_prerelease", + "finalize_version", + "format_version", + "match", + "max_ver", + "min_ver", + "parse", + "parse_version_info", + "replace", + "cmd_bump", + "cmd_compare", + "cmd_nextver", + "cmd_check", + "createparser", + "process", + "main", + "Version", + "VersionInfo", + "__version__", + "__author__", + "__maintainer__", + "__author_email__", + "__description__", + "__maintainer_email__", + "SEMVER_SPEC_VERSION", +] diff --git a/src/semver/cli.py b/src/semver/cli.py index b2751429..43e101e1 100644 --- a/src/semver/cli.py +++ b/src/semver/cli.py @@ -61,7 +61,7 @@ def cmd_check(args: argparse.Namespace) -> None: def cmd_compare(args: argparse.Namespace) -> str: """ - Subcommand: Compare two versions + Subcommand: Compare two versions. Synopsis: compare diff --git a/src/semver/version.py b/src/semver/version.py index e9d0e15b..af437296 100644 --- a/src/semver/version.py +++ b/src/semver/version.py @@ -64,8 +64,8 @@ class Version: See specification at https://semver.org. :param major: version when you make incompatible API changes. - :param minor: version when you add functionality in - a backwards-compatible manner. + :param minor: version when you add functionality in a backwards- + compatible manner. :param patch: version when you make backwards-compatible bug fixes. :param prerelease: an optional prerelease string :param build: an optional build string From 90c34840b1932d1dca5a975ac366be11e4a4f214 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 14 Jun 2023 12:48:17 +0200 Subject: [PATCH 7/8] Configure docformatter (#412) * Add config options to pyproject.toml * Call docformatter without any options in tox.ini as they are set in pyproject.toml now --- pyproject.toml | 9 +++++++++ src/semver/version.py | 3 +-- tox.ini | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e611abc4..6b12deb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,15 @@ target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] # diff = true +[tool.docformatter] +wrap-summaries = 80 +close-quotes-on-newline = true +# make-summary-multi-line = true +black = true +pre-summary-newline = true +recursive = true + + [tool.towncrier] package = "semver" package_dir = "src" diff --git a/src/semver/version.py b/src/semver/version.py index af437296..d2f336c0 100644 --- a/src/semver/version.py +++ b/src/semver/version.py @@ -64,8 +64,7 @@ class Version: See specification at https://semver.org. :param major: version when you make incompatible API changes. - :param minor: version when you add functionality in a backwards- - compatible manner. + :param minor: version when you add functionality in a backwards-compatible manner. :param patch: version when you make backwards-compatible bug fixes. :param prerelease: an optional prerelease string :param build: an optional build string diff --git a/tox.ini b/tox.ini index fb91a518..94598c4c 100644 --- a/tox.ini +++ b/tox.ini @@ -56,7 +56,7 @@ commands = mypy {posargs:--ignore-missing-imports --check-untyped-defs src} description = Check for PEP257 compatible docstrings basepython = python3 deps = docformatter -commands = docformatter --check --diff {posargs:--pre-summary-newline -r src} +commands = docformatter --check --diff {posargs:src} [testenv:checks] From c2680608bc9b080a1f34161a36971e8331a19056 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 14 Jun 2023 13:41:24 +0200 Subject: [PATCH 8/8] Prepare version 3.0.1 (#413) * Raise version * Ignore exit code from docformatter in checks `tox.ini` * Correct typo in release-procedure.md * Update CHANGELOG.rst --- CHANGELOG.rst | 17 +++++++++++++++++ changelog.d/410.bugfix.rst | 1 - docs/usage/semver-version.rst | 2 +- release-procedure.md | 2 +- src/semver/__about__.py | 2 +- tox.ini | 5 +++-- 6 files changed, 23 insertions(+), 6 deletions(-) delete mode 100644 changelog.d/410.bugfix.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 11b08e06..a773e1f3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -18,6 +18,23 @@ This section covers the changes between major version 2 and version 3. .. towncrier release notes start +Version 3.0.1 +============= + +:Released: 2023-06-14 +:Maintainer: Tom Schraitle + + +Bug Fixes +--------- + +* :gh:`410`: Export functions properly using ``__all__`` in ``__init__.py``. + + + +---- + + Version 3.0.0 ============= diff --git a/changelog.d/410.bugfix.rst b/changelog.d/410.bugfix.rst deleted file mode 100644 index 1b2dcf74..00000000 --- a/changelog.d/410.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Export functions properly using `__all__` in `__init__.py`. \ No newline at end of file diff --git a/docs/usage/semver-version.rst b/docs/usage/semver-version.rst index b7d5ed9e..0f2e2411 100644 --- a/docs/usage/semver-version.rst +++ b/docs/usage/semver-version.rst @@ -4,4 +4,4 @@ Getting the Version of semver To know the version of semver itself, use the following construct:: >>> semver.__version__ - '3.0.0' + '3.0.1' diff --git a/release-procedure.md b/release-procedure.md index f7b8d7bb..7476c79a 100644 --- a/release-procedure.md +++ b/release-procedure.md @@ -26,7 +26,7 @@ create a new release. : * `src/semver/__about__.py` - * `docs/usage.rst` + * `docs/usage/semver-version.rst` 1. Add eventually new contributor(s) to [CONTRIBUTORS](https://github.com/python-semver/python-semver/blob/master/CONTRIBUTORS). diff --git a/src/semver/__about__.py b/src/semver/__about__.py index 89c6412e..2eff8c86 100644 --- a/src/semver/__about__.py +++ b/src/semver/__about__.py @@ -16,7 +16,7 @@ """ #: Semver version -__version__ = "3.0.0" +__version__ = "3.0.1" #: Original semver author __author__ = "Kostiantyn Rybnikov" diff --git a/tox.ini b/tox.ini index 94598c4c..b18aa1f7 100644 --- a/tox.ini +++ b/tox.ini @@ -56,7 +56,8 @@ commands = mypy {posargs:--ignore-missing-imports --check-untyped-defs src} description = Check for PEP257 compatible docstrings basepython = python3 deps = docformatter -commands = docformatter --check --diff {posargs:src} +commands = + docformatter --check --diff {posargs:src} [testenv:checks] @@ -68,10 +69,10 @@ deps = {[testenv:mypy]deps} {[testenv:docstrings]deps} commands = + - {[testenv:docstrings]commands} {[testenv:black]commands} {[testenv:flake8]commands} {[testenv:mypy]commands} - {[testenv:docstrings]commands} [testenv:docs]