diff --git a/NEWS.rst b/NEWS.rst index bf34a803..1fe5165f 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -1,8 +1,8 @@ NEWS ==== -NEXT ----- +23.12.0 - 2023-12-22 +-------------------- * Fixed a compatibility issue with Werkzeug versions greater than 2.2. [`#575 `] * Added explicit support for Python 3.10 and 3.11, although in practice they did work previously in 21.8. [`#578 `] diff --git a/docs/release.rst b/docs/release.rst index 2cc895f7..50db4648 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -13,10 +13,22 @@ Releasing Klein #. Start with a clean (no changes) source tree on the trunk branch. #. Create a new release candidate: :code:`tox -e release -- start` +#. Manually update the ``NEXT`` heading in ``NEWS.rst`` to reference the + version that was just updated, *without* the "rc" release-candidate tag, and + the current RFC3339-formatted date; i.e. write the ``NEWS.rst`` file as if + it were for the final release. #. Commit and push the branch #. Open a PR from the branch (follow the usual process for opening a PR). -#. As appropriate, pull the latest code from :code:`trunk`: :code:`git checkout trunk && git pull --rebase` (or use the GitHub UI) -#. To publish a release candidate to PyPI: :code:`tox -e release -- publish` +#. As appropriate, pull the latest code from :code:`trunk`: :code:`git checkout + trunk && git pull --rebase` (or use the GitHub UI) +#. To publish a release candidate to PyPI: :code:`tox -e release -- publish --candidate` #. Obtain an approving review for the PR using the usual process. -#. To publish a production release: :code:`tox -e release -- publish --final` +#. If the date has changed since the release candidate, update the RFC3339 date + in the ``NEWS.rst`` header for the release to the current date; commit and + push this change to the branch. +#. Publish a production release with the command: :code:`tox -e release -- + publish --final` +#. In ``NEWS.rst``, add a new "NEXT" section at the top. You do not need a + separate review for this addition; it should be done after the release, but + before merging to trunk. #. Merge the PR to the trunk branch. diff --git a/release.py b/release.py index 958d876d..0116c388 100644 --- a/release.py +++ b/release.py @@ -66,7 +66,7 @@ def fadeToBlack() -> None: """ Run black to reformat the source code. """ - spawn(["tox", "-e", "black-reformat"]) + spawn(["pre-commit", "run", "black"]) def incrementVersion(candidate: bool) -> None: @@ -77,7 +77,7 @@ def incrementVersion(candidate: bool) -> None: """ # Incremental doesn't have an API to do this, so we have to run a # subprocess. Boo. - args = ["python", "-m", "incremental.update", "klein"] + args = ["python", "-m", "incremental.update", "Klein"] if candidate: args.append("--rc") spawn(args) @@ -263,11 +263,10 @@ def publishRelease(final: bool, test: bool = False) -> None: 1, ) - incrementVersion(candidate=False) + incrementVersion(candidate=not final) version = currentVersion() - versonFile = Path(__file__).parent / "src" / "klein" / "_version.py" - repository.index.add(str(versonFile)) + repository.index.add("src/klein") repository.index.commit(f"Update version to {version}") tagName = releaseTagName(version) @@ -308,10 +307,14 @@ def bump() -> None: @main.command() @commandOption( - "--test/--production", help="Use test (or production) PyPI server" + "--test/--production", + help="Use test (or production) PyPI server", + default=False, ) @commandOption( - "--final/--candidate", help="Publish a final (or candidate) release" + "--final/--candidate", + help="Publish a final (or candidate) release", + default=False, ) def publish(final: bool, test: bool) -> None: publishRelease(final=final, test=test) diff --git a/src/klein/_dihttp.py b/src/klein/_dihttp.py index 10008f43..0e7a7807 100644 --- a/src/klein/_dihttp.py +++ b/src/klein/_dihttp.py @@ -47,7 +47,7 @@ class RequestURL: """ Require a hyperlink L{DecodedURL} object from a L{Requirer}. - @since: Klein NEXT + @since: Klein 23.12.0 """ @classmethod @@ -80,7 +80,7 @@ class RequestComponent: """ Require a hyperlink L{DecodedURL} object from a L{Requirer}. - @since: Klein NEXT + @since: Klein 23.12.0 """ interface: Type[Interface] @@ -120,7 +120,7 @@ class Response: - a body object, which can be anything else Klein understands; for example, an IResource, an IRenderable, str, bytes, etc. - @since: Klein NEXT + @since: Klein 23.12.0 """ code: int = 200 diff --git a/src/klein/_version.py b/src/klein/_version.py index ffaf0d69..0cf808cf 100644 --- a/src/klein/_version.py +++ b/src/klein/_version.py @@ -1,11 +1,11 @@ """ -Provides klein version information. +Provides Klein version information. """ # This file is auto-generated! Do not edit! -# Use `python -m incremental.update klein` to change this file. +# Use `python -m incremental.update Klein` to change this file. from incremental import Version -__version__ = Version("klein", 23, 5, 0) +__version__ = Version("Klein", 23, 12, 0) __all__ = ["__version__"]