From ca27bf06cf6220cf48a52efd0bf4290f8b3d9b50 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Tue, 24 Dec 2024 15:23:37 +0000 Subject: [PATCH 1/3] Add cache-keys to tool.uv in pyproject See https://docs.astral.sh/uv/concepts/cache/#dynamic-metadata. This is to try and make versioning work. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index e787b6e58..f6855a3d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,9 @@ Releases = "https://github.com/rst2pdf/rst2pdf/releases" Source = "https://github.com/rst2pdf/rst2pdf" "Bug Reports" = "https://github.com/rst2pdf/rst2pdf/issues" +[tool.uv] +cache-keys = [{ git = { commit = true, tags = true } }] + [tool.black] line-length = 88 target-version = ['py36'] From 23d905546c49e0dcff0955fb88dc17a988933eb2 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Tue, 24 Dec 2024 15:39:21 +0000 Subject: [PATCH 2/3] Update RELEASE_PROCESS for versioning with uv uv holds rst2pdf's version in its lock file, so we need to tag, update the lock file and then move the tag before pushing. --- doc/RELEASE_PROCESS.rst | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/doc/RELEASE_PROCESS.rst b/doc/RELEASE_PROCESS.rst index ce5232095..7b0b00248 100644 --- a/doc/RELEASE_PROCESS.rst +++ b/doc/RELEASE_PROCESS.rst @@ -15,28 +15,36 @@ This is an outline of what needs to be done in order to release rst2pdf. $ git checkout main -#. Use changelog-generator_ (or similar) to create a changelog +#. Use changelog-generator_ (or similar) to create a changelog for the tag's message :: - $ changelog-generator -u rst2pdf -r rst2pdf -m 999 + $ changelog-generator -u rst2pdf -r rst2pdf -m {id of milestone} #. Tag release with version number e.g. :: - $ git tag -s 0.94 - $ git push upstream 0.94 + $ git tag -s 0.103 + +#. Update the uv.lock file with the correct version number, move the tag and push + + $ uv lock + $ git add uv.lock + $ git commit -m "Update uv.lock for version 0.103" + $ git tag -s 0.103 -f + $ git push upstream 0.103 #. Build manual - Check out the tag first and then install via ``uv``. We do this so that the version number that + Check out the tag first if it's not already checked out from the previous step. + Install via ``uv``. We do this so that the version number that is rendered to the first page of the PDF is displayed as "{version number} (final)" rather than as a dev version. :: - $ git checkout 0.94 + $ git checkout 0.103 $ uv sync --all-extras Generate the HTML and PDF docs: @@ -50,7 +58,7 @@ This is an outline of what needs to be done in order to release rst2pdf. :: - $ exiftool -PDF:Subject="v0.94 r2019011700" doc/output/pdf/manual.pdf + $ exiftool -PDF:Subject="v0.103 r2019011700" doc/output/pdf/manual.pdf $ exiftool -PDF:Author="rst2pdf project; Roberto Alsina" doc/output/pdf/manual.pdf and upload to HTML and PDF to the website @@ -94,7 +102,7 @@ This is an outline of what needs to be done in order to release rst2pdf. :: $ uvx -n --index-url https://test.pypi.org/simple --extra-index-url https://pypi.org/simple --prerelease allow \ - --index-strategy unsafe-best-match rst2pdf@0.101rc1 tests/input/test_tableofcontents.rst + --index-strategy unsafe-best-match rst2pdf@0.103rc1 tests/input/test_tableofcontents.rst #. Delete the build artifacts and dist files with: From a066ba05c2ab956b859ba2232d922a342f6af607 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Tue, 24 Dec 2024 16:02:03 +0000 Subject: [PATCH 3/3] . --- doc/RELEASE_PROCESS.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/RELEASE_PROCESS.rst b/doc/RELEASE_PROCESS.rst index 7b0b00248..8ff39d5ac 100644 --- a/doc/RELEASE_PROCESS.rst +++ b/doc/RELEASE_PROCESS.rst @@ -37,8 +37,7 @@ This is an outline of what needs to be done in order to release rst2pdf. #. Build manual - Check out the tag first if it's not already checked out from the previous step. - Install via ``uv``. We do this so that the version number that + Check out the tag first and then install via ``uv``. We do this so that the version number that is rendered to the first page of the PDF is displayed as "{version number} (final)" rather than as a dev version.