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 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/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' 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/pyproject.toml b/pyproject.toml index d288e68e..6b12deb0 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" @@ -23,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/release-procedure.md b/release-procedure.md index d6c1701e..7476c79a 100644 --- a/release-procedure.md +++ b/release-procedure.md @@ -20,12 +20,13 @@ create a new release. * `setup.cfg` * `tox.ini` * `.git/workflows/pythonpackage.yml` + * `CITATION.cff` 1. Verify that the version has been updated and follow : * `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/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 cca744a1..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 @@ -432,7 +431,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")) diff --git a/tox.ini b/tox.ini index b71ae78e..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:--pre-summary-newline -r 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] @@ -99,9 +100,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