From 221bfba902d13acc640c44602f8a090fb68215f3 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 19 Jan 2022 21:35:09 +0100 Subject: [PATCH 1/2] Fix #315: Create 3.0.0-dev.3 * Improve entries for PyPI in setup.cfg * Remove key "download_url" as it points to a broken URL * Add Changelog entry pointing to RTD * Raise version to 3.0.0-dev.3 * Update release procedure * Update Black formatter config * Replace "exclude" with "extend-exclude" * Ignore all *.py files in project's root directory * Include "setup.py" explicity --- changelog.d/315.doc.rst | 1 + docs/usage.rst | 2 +- pyproject.toml | 21 +++++---------- release-procedure.md | 58 +++++++++++++++++++++++++++++------------ setup.cfg | 2 +- src/semver/__about__.py | 2 +- 6 files changed, 53 insertions(+), 33 deletions(-) create mode 100644 changelog.d/315.doc.rst diff --git a/changelog.d/315.doc.rst b/changelog.d/315.doc.rst new file mode 100644 index 00000000..77ca8ba5 --- /dev/null +++ b/changelog.d/315.doc.rst @@ -0,0 +1 @@ +Improve release procedure text diff --git a/docs/usage.rst b/docs/usage.rst index eb4cc25b..f6983d17 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -26,7 +26,7 @@ Getting the Version of semver To know the version of semver itself, use the following construct:: >>> semver.__version__ - '3.0.0-dev.2' + '3.0.0-dev.3' Creating a Version diff --git a/pyproject.toml b/pyproject.toml index e58eb25a..769b13d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,20 +11,13 @@ build-backend = "setuptools.build_meta" line-length = 88 target-version = ['py36', 'py37', 'py38', 'py39', 'py310'] # diff = true -exclude = ''' -( - /( - \.eggs # exclude a few common directories in the - | \.git # root of the project - | \.mypy_cache - | \.tox - | \.venv - | \.env - | _build - | build - | dist - )/ -) +extend-exclude = ''' +# A regex preceded with ^/ will apply only to files and directories +# in the root of the project. +^/*.py +''' +include = ''' +^/setup.py ''' [tool.towncrier] diff --git a/release-procedure.md b/release-procedure.md index db9ed1b5..251f23f0 100644 --- a/release-procedure.md +++ b/release-procedure.md @@ -5,22 +5,31 @@ create a new release. ## Prepare the Release -1. Verify that issues about new release are closed https://github.com/python-semver/python-semver/issues. +1. Verify: -1. Verify that no pull requests that should be included in this release haven't been left out https://github.com/python-semver/python-semver/pulls. + * all issues for a new release are closed: . -1. Verify that continuous integration for latest build was passing https://travis-ci.com/python-semver/python-semver. + * that all pull requests that should be included in this release are merged: . -1. Create a new branch `release/VERSION`. + * that continuous integration for latest build was passing: . + +1. Create a new branch `release/`. 1. If one or several supported Python versions have been removed or added, verify that the 3 following files have been updated: - * [setup.py](https://github.com/python-semver/python-semver/blob/master/setup.py) - * [tox.ini](https://github.com/python-semver/python-semver/blob/master/tox.ini) - * [.travis.yml](https://github.com/python-semver/python-semver/blob/master/.travis.yml) + * `setup.cfg` + * `tox.ini` + * `.git/workflows/pythonpackage.yml` + +1. Verify that the version has been updated and follow + : + + * `src/semver/__about__.py` + * `docs/usage.rst` 1. Add eventually new contributor(s) to [CONTRIBUTORS](https://github.com/python-semver/python-semver/blob/master/CONTRIBUTORS). -1. Verify that `__version__` in [semver.py](https://github.com/python-semver/python-semver/blob/master/semver.py) have been updated and follow https://semver.org. + +1. Check if all changelog entries are created. If some are missing, [create them](https://python-semver.readthedocs.io/en/latest/development.html#adding-a-changelog-entry). 1. Show the new draft [CHANGELOG](https://github.com/python-semver/python-semver/blob/master/CHANGELOG.rst) entry for the latest release with: @@ -36,32 +45,47 @@ create a new release. $ tox -e docs +1. Commit all changes, push, and create a pull request. + ## Create the New Release -1. Ensure that long description (ie [README.rst](https://github.com/python-semver/python-semver/blob/master/README.rst)) can be correctly rendered by Pypi using `restview --long-description` +1. Ensure that long description ([README.rst](https://github.com/python-semver/python-semver/blob/master/README.rst)) can be correctly rendered by Pypi using `restview --long-description` + +1. Clean up your local Git repository. Be careful, + as it **will remove all files** which are not + versioned by Git: + + $ git clean -xfd + + Before you create your distribution files, clean + the directory too: + + $ rm dist/* + +1. Create the distribution files (wheel and source): + + $ tox -e prepare-dist 1. Upload the wheel and source to TestPyPI first: - ```bash - $ git clean -xfd - $ rm dist/* - $ python3 setup.py sdist bdist_wheel + ```bash $ twine upload --repository-url https://test.pypi.org/legacy/ dist/* ``` - If you have a `~/.pypirc` with a `testpyi` section, the upload can be + If you have a `~/.pypirc` with a `testpypi` section, the upload can be simplified: - $ twine upload --repository testpyi dist/* + $ twine upload --repository testpypi dist/* 1. Check if everything is okay with the wheel. + Check also the web site `https://test.pypi.org/project//` 1. Upload to PyPI: ```bash $ git clean -xfd - $ python setup.py register sdist bdist_wheel + $ tox -e prepare-dist $ twine upload dist/* ``` @@ -78,4 +102,6 @@ create a new release. document the new release. Usually it's enough to take it from a commit message or the tag description. +1. Announce it in . + You're done! Celebrate! diff --git a/setup.cfg b/setup.cfg index 9467709c..de2d226c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,8 +14,8 @@ author_email = k-bx@k-bx.com maintainer = Sebastien Celles, Tom Schraitle maintainer_email = s.celles@gmail.com url = https://github.com/python-semver/python-semver -download_url = https://github.com/python-semver/python-semver/downloads project_urls = + Changelog = https://python-semver.readthedocs.io/en/latest/changelog.html Documentation = https://python-semver.rtfd.io Releases = https://github.com/python-semver/python-semver/releases Bug Tracker = https://github.com/python-semver/python-semver/issues diff --git a/src/semver/__about__.py b/src/semver/__about__.py index 1f5fcae5..fa448ebe 100644 --- a/src/semver/__about__.py +++ b/src/semver/__about__.py @@ -16,7 +16,7 @@ """ #: Semver version -__version__ = "3.0.0-dev.2" +__version__ = "3.0.0-dev.3" #: Original semver author __author__ = "Kostiantyn Rybnikov" From 47f9f346ddb0a920b7a65abdbee50c97bdc9e8a5 Mon Sep 17 00:00:00 2001 From: Tom Schraitle Date: Wed, 19 Jan 2022 22:27:05 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.rst | 85 +++++++++++++++++++++++++++++++++++++ changelog.d/309.trivial.rst | 17 -------- changelog.d/310.bugfix.rst | 3 -- changelog.d/312.doc.rst | 11 ----- changelog.d/313.trivial.rst | 3 -- changelog.d/315.doc.rst | 1 - changelog.d/316.trivial.rst | 10 ----- changelog.d/319.trivial.rst | 4 -- changelog.d/322.trivial.rst | 1 - changelog.d/347.trivial.rst | 1 - 10 files changed, 85 insertions(+), 51 deletions(-) delete mode 100644 changelog.d/309.trivial.rst delete mode 100644 changelog.d/310.bugfix.rst delete mode 100644 changelog.d/312.doc.rst delete mode 100644 changelog.d/313.trivial.rst delete mode 100644 changelog.d/315.doc.rst delete mode 100644 changelog.d/316.trivial.rst delete mode 100644 changelog.d/319.trivial.rst delete mode 100644 changelog.d/322.trivial.rst delete mode 100644 changelog.d/347.trivial.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 879a5bdd..3173507f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,91 @@ in our repository. .. towncrier release notes start +Version 3.0.0-dev.3 +=================== + +:Released: 2022-01-19 +:Maintainer: Tom Schraitle + + +Bug Fixes +--------- + +* :gh:`310`: Rework API documentation. + Follow a more "semi-manual" attempt and add auto directives + into :file:`docs/api.rst`. + + + +Improved Documentation +---------------------- + +* :gh:`312`: Rework "Usage" section. + + * Mention the rename of :class:`~semver.version.VersionInfo` to + :class:`~semver.version.Version` class + * Remove semver. prefix in doctests to make examples shorter + * Correct some references to dunder methods like + :func:`~.semver.version.Version.__getitem__`, + :func:`~.semver.version.Version.__gt__` etc. + * Remove inconsistencies and mention module level function as + deprecated and discouraged from using + * Make empty :py:func:`super` call in :file:`semverwithvprefix.py` example + +* :gh:`315`: Improve release procedure text + + + +Trivial/Internal Changes +------------------------ + +* :gh:`309`: Some (private) functions from the :mod:`semver.version` + module has been changed. + + The following functions got renamed: + + * function ``semver.version.comparator`` got renamed to + :func:`semver.version._comparator` as it is only useful + inside the :class:`~semver.version.Version` class. + * function ``semver.version.cmp`` got renamed to + :func:`semver.version._cmp` as it is only useful + inside the :class:`~semver.version.Version` class. + + The following functions got integrated into the + :class:`~semver.version.Version` class: + + * function ``semver.version._nat_cmd`` as a classmethod + * function ``semver.version.ensure_str`` + +* :gh:`313`: Correct :file:`tox.ini` for ``changelog`` entry to skip + installation for semver. This should speed up the execution + of towncrier. + +* :gh:`316`: Comparisons of :class:`~semver.version.Version` class and other + types return now a :py:const:`NotImplemented` constant instead + of a :py:exc:`TypeError` exception. + + The `NotImplemented`_ section of the Python documentation recommends + returning this constant when comparing with ``__gt__``, ``__lt__``, + and other comparison operators to "to indicate that the operation is + not implemented with respect to the other type". + + .. _NotImplemented: https://docs.python.org/3/library/constants.html#NotImplemented + +* :gh:`319`: Introduce stages in :file:`.travis.yml` + The config file contains now two stages: check and test. If + check fails, the test stage won't be executed. This could + speed up things when some checks fails. + +* :gh:`322`: Switch from Travis CI to GitHub Actions. + +* :gh:`347`: Support Python 3.10 in GitHub Action and other config files. + + + +---- + + Version 3.0.0-dev.2 =================== diff --git a/changelog.d/309.trivial.rst b/changelog.d/309.trivial.rst deleted file mode 100644 index 97bbba1e..00000000 --- a/changelog.d/309.trivial.rst +++ /dev/null @@ -1,17 +0,0 @@ -Some (private) functions from the :mod:`semver.version` -module has been changed. - -The following functions got renamed: - -* function ``semver.version.comparator`` got renamed to - :func:`semver.version._comparator` as it is only useful - inside the :class:`~semver.version.Version` class. -* function ``semver.version.cmp`` got renamed to - :func:`semver.version._cmp` as it is only useful - inside the :class:`~semver.version.Version` class. - -The following functions got integrated into the -:class:`~semver.version.Version` class: - -* function ``semver.version._nat_cmd`` as a classmethod -* function ``semver.version.ensure_str`` diff --git a/changelog.d/310.bugfix.rst b/changelog.d/310.bugfix.rst deleted file mode 100644 index 6b042982..00000000 --- a/changelog.d/310.bugfix.rst +++ /dev/null @@ -1,3 +0,0 @@ -Rework API documentation. -Follow a more "semi-manual" attempt and add auto directives -into :file:`docs/api.rst`. \ No newline at end of file diff --git a/changelog.d/312.doc.rst b/changelog.d/312.doc.rst deleted file mode 100644 index 6b18eb49..00000000 --- a/changelog.d/312.doc.rst +++ /dev/null @@ -1,11 +0,0 @@ -Rework "Usage" section. - -* Mention the rename of :class:`~semver.version.VersionInfo` to - :class:`~semver.version.Version` class -* Remove semver. prefix in doctests to make examples shorter -* Correct some references to dunder methods like - :func:`~.semver.version.Version.__getitem__`, - :func:`~.semver.version.Version.__gt__` etc. -* Remove inconsistencies and mention module level function as - deprecated and discouraged from using -* Make empty :py:func:`super` call in :file:`semverwithvprefix.py` example diff --git a/changelog.d/313.trivial.rst b/changelog.d/313.trivial.rst deleted file mode 100644 index 963b4f31..00000000 --- a/changelog.d/313.trivial.rst +++ /dev/null @@ -1,3 +0,0 @@ -Correct :file:`tox.ini` for ``changelog`` entry to skip -installation for semver. This should speed up the execution -of towncrier. diff --git a/changelog.d/315.doc.rst b/changelog.d/315.doc.rst deleted file mode 100644 index 77ca8ba5..00000000 --- a/changelog.d/315.doc.rst +++ /dev/null @@ -1 +0,0 @@ -Improve release procedure text diff --git a/changelog.d/316.trivial.rst b/changelog.d/316.trivial.rst deleted file mode 100644 index edb555ff..00000000 --- a/changelog.d/316.trivial.rst +++ /dev/null @@ -1,10 +0,0 @@ -Comparisons of :class:`~semver.version.Version` class and other -types return now a :py:const:`NotImplemented` constant instead -of a :py:exc:`TypeError` exception. - -The `NotImplemented`_ section of the Python documentation recommends -returning this constant when comparing with ``__gt__``, ``__lt__``, -and other comparison operators to "to indicate that the operation is -not implemented with respect to the other type". - -.. _NotImplemented: https://docs.python.org/3/library/constants.html#NotImplemented \ No newline at end of file diff --git a/changelog.d/319.trivial.rst b/changelog.d/319.trivial.rst deleted file mode 100644 index c1c259a9..00000000 --- a/changelog.d/319.trivial.rst +++ /dev/null @@ -1,4 +0,0 @@ -Introduce stages in :file:`.travis.yml` -The config file contains now two stages: check and test. If -check fails, the test stage won't be executed. This could -speed up things when some checks fails. \ No newline at end of file diff --git a/changelog.d/322.trivial.rst b/changelog.d/322.trivial.rst deleted file mode 100644 index b9394c12..00000000 --- a/changelog.d/322.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Switch from Travis CI to GitHub Actions. diff --git a/changelog.d/347.trivial.rst b/changelog.d/347.trivial.rst deleted file mode 100644 index 2d44ceb1..00000000 --- a/changelog.d/347.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Support Python 3.10 in GitHub Action and other config files.