diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62879704..912158e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,6 @@ repos: rev: "23.3.0" hooks: - id: black - args: ["--target-version", "py37"] - repo: https://github.com/PyCQA/autoflake rev: "v2.1.1" 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/pyproject.toml b/pyproject.toml index 23bb815d..4cb0b8a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,4 +7,4 @@ build-backend = "setuptools.build_meta" [tool.black] line-length = 80 -target-version = ["py36"] +target-version = ["py37"] diff --git a/release.py b/release.py index 12435cfe..45907324 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/requirements/black.txt b/requirements/black.txt index 10b3f1a1..a15bd515 100644 --- a/requirements/black.txt +++ b/requirements/black.txt @@ -1 +1 @@ -black==23.11.0 +black==23.12.1 diff --git a/requirements/mypy.txt b/requirements/mypy.txt index 733fef60..5719b0f2 100644 --- a/requirements/mypy.txt +++ b/requirements/mypy.txt @@ -1,3 +1,3 @@ -mypy==1.7.1 -mypy-zope==1.0.2 +mypy==1.8.0 +mypy-zope==1.0.3 types-click==7.1.8 diff --git a/requirements/tox-pin-base.txt b/requirements/tox-pin-base.txt index 813bd441..8d3e0246 100644 --- a/requirements/tox-pin-base.txt +++ b/requirements/tox-pin-base.txt @@ -1,4 +1,4 @@ -attrs==23.1.0 +attrs==23.2.0 Automat==22.10.0 characteristic==14.3.0 constantly==15.1.0 diff --git a/requirements/tox-tests.txt b/requirements/tox-tests.txt index 7caa9333..06fb23aa 100644 --- a/requirements/tox-tests.txt +++ b/requirements/tox-tests.txt @@ -1,2 +1,2 @@ -idna==3.4 +idna==3.6 treq==22.2.0 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 21ddefa7..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, release_candidate=1) +__version__ = Version("Klein", 23, 12, 0) __all__ = ["__version__"]