From 9f2e4757ec65ea1afe2320725eac6c8b23f92b7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Eertmans?= Date: Fri, 3 May 2024 13:47:44 +0200 Subject: [PATCH] chore(ci): fancy README and better bump config (#425) * chore(ci): fancy README and better bump config * fix(ci): CITATION.cff * chore(docs): add changelog entry --- .bumpversion.cfg | 16 ----- .readthedocs.yaml | 7 +- CHANGELOG.md | 6 ++ README.md | 2 + pyproject.toml | 104 +++++++++++++++++++++++----- requirements-dev.lock | 33 ++++++--- requirements.lock | 153 ------------------------------------------ 7 files changed, 118 insertions(+), 203 deletions(-) delete mode 100644 .bumpversion.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index ad52b242..00000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,16 +0,0 @@ -[bumpversion] -current_version = 5.1.6 -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(-rc(?P\d+))? -serialize = - {major}.{minor}.{patch}-rc{release} - {major}.{minor}.{patch} -commit = True -message = chore(version): bump {current_version} to {new_version} - -[bumpversion:file:manim_slides/__version__.py] -search = __version__ = "{current_version}" -replace = __version__ = "{new_version}" - -[bumpversion:file:CITATION.cff] -search = version: v{current_version} -replace = version: v{new_version} diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 9921f8e7..61242288 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -15,9 +15,4 @@ sphinx: fail_on_warning: true python: install: - - method: pip - path: . - extra_requirements: - - docs - - magic - - sphinx-directive + - requirements: requirements-dev.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index a91a612c..97e108e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (unreleased)= ## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.1.6...HEAD) +(unreleased-chore)= +### Chore + +- Improved the CI for bumping the version and README rendering on PyPI. + [#425](https://github.com/jeertmans/manim-slides/pull/425) + (v5.1.6)= ## [v5.1.6](https://github.com/jeertmans/manim-slides/compare/v5.1.5...v5.1.6) diff --git a/README.md b/README.md index c198efc5..18cac8d9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Manim Slides Logo + + [![Latest Release][pypi-version-badge]][pypi-version-url] [![Python version][pypi-python-version-badge]][pypi-version-url] [![PyPI - Downloads][pypi-download-badge]][pypi-version-url] diff --git a/pyproject.toml b/pyproject.toml index 57a60f25..296674f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] build-backend = "hatchling.build" -requires = ["hatchling"] +requires = ["hatchling", "hatch-fancy-pypi-readme"] [project] authors = [{name = "Jérome Eertmans", email = "jeertmans@icloud.com"}] @@ -34,26 +34,13 @@ dependencies = [ "tqdm>=4.64.1", ] description = "Tool for live presentations using manim" -dynamic = ["version"] +dynamic = ["readme", "version"] keywords = ["manim", "slides", "plugin", "manimgl"] -license = {text = "MIT"} +license = "MIT" name = "manim-slides" -readme = "README.md" requires-python = ">=3.9" [project.optional-dependencies] -docs = [ - "manim-slides[magic,sphinx-directive]", - "furo>=2023.5.20", - "ipykernel>=6.25.1", - "myst-parser>=2.0.0", - "nbsphinx>=0.9.2", - "pandoc>=2.3", - "sphinx>=7.0.1", - "sphinx-click>=4.4.0", - "sphinx-copybutton>=0.5.1", - "sphinxext-opengraph>=0.7.5", -] full = [ "manim-slides[magic,manim,sphinx-directive]", ] @@ -79,6 +66,56 @@ Founding = "https://github.com/sponsors/jeertmans" Homepage = "https://github.com/jeertmans/manim-slides" Repository = "https://github.com/jeertmans/manim-slides" +[tool.bumpversion] +allow_dirty = false +commit = true +commit_args = "" +current_version = "5.1.6" +ignore_missing_version = false +message = "chore(deps): bump version from {current_version} to {new_version}" +parse = '(?P\d+)\.(?P\d+)\.(?P\d+)(-rc(?P\d+))?' +regex = false +replace = "{new_version}" +search = "{current_version}" +serialize = ["{major}.{minor}.{patch}-rc{release}", "{major}.{minor}.{patch}"] +sign_tags = false +tag = false +tag_message = "Bump version: {current_version} → {new_version}" +tag_name = "v{new_version}" + +[[tool.bumpversion.files]] +filename = "manim_slides/__version__.py" +replace = '__version__ = "{new_version}"' +search = '__version__ = "{current_version}"' + +[[tool.bumpversion.files]] +filename = "CITATION.cff" +replace = "version: v{new_version}" +search = "version: v{current_version}" + +[[tool.bumpversion.files]] +filename = "CHANGELOG.md" +replace = "v{new_version}" +search = "Unreleased" + +[[tool.bumpversion.files]] +filename = "CHANGELOG.md" +replace = "v{new_version}" +search = "unreleased" + +[[tool.bumpversion.files]] +filename = "CHANGELOG.md" +replace = "v{current_version}...v{new_version}" +search = "v{current_version}...HEAD" + +[[tool.bumpversion.files]] +filename = "CHANGELOG.md" +replace = ''' + +(unreleased)= +## [Unreleased](https://github.com/jeertmans/manim-slides/compare/{new_version}...HEAD)''' +search = "" + [tool.codespell] builtin = "clear,rare,informal,usage,names,en-GB_to_en-US" check-hidden = true @@ -94,6 +131,25 @@ exclude_lines = [ ] precision = 2 +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/markdown" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] +text = """

+ + + +

+""" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] +path = "README.md" +start-after = "" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] +pattern = '> \[!([A-Z]+)\]' +replacement = '> **\1:**' + [tool.hatch.version] path = "manim_slides/__version__.py" @@ -138,9 +194,21 @@ isort = {known-first-party = ["manim_slides", "tests"]} [tool.rye] dev-dependencies = [ - "bump2version>=1.0.1", - "manim-slides[manim,manimgl,pyqt6]", + "manim-slides[magic,manim,manimgl,pyqt6,sphinx-directive]", + # dev + "bump-my-version>=0.20.3", "pre-commit>=3.5.0", + # docs + "furo>=2023.5.20", + "ipykernel>=6.25.1", + "myst-parser>=2.0.0", + "nbsphinx>=0.9.2", + "pandoc>=2.3", + "sphinx>=7.0.1", + "sphinx-click>=4.4.0", + "sphinx-copybutton>=0.5.1", + "sphinxext-opengraph>=0.7.5", + # tests "pytest>=7.4.0", "pytest-cov>=4.1.0", "pytest-env>=0.8.2", diff --git a/requirements-dev.lock b/requirements-dev.lock index cf5af248..fab4d63e 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -26,7 +26,9 @@ beautifulsoup4==4.12.3 # via nbconvert bleach==6.1.0 # via nbconvert -bump2version==1.0.1 +bracex==2.4 + # via wcmatch +bump-my-version==0.21.0 certifi==2024.2.2 # via requests cfgv==3.4.0 @@ -34,10 +36,12 @@ cfgv==3.4.0 charset-normalizer==3.3.2 # via requests click==8.1.7 + # via bump-my-version # via click-default-group # via cloup # via manim # via manim-slides + # via rich-click # via sphinx-click click-default-group==1.2.4 # via manim @@ -81,7 +85,6 @@ filelock==3.13.4 fonttools==4.51.0 # via matplotlib furo==2024.1.29 - # via manim-slides glcontext==2.5.0 # via moderngl identify==2.5.35 @@ -93,7 +96,6 @@ imagesize==1.4.1 iniconfig==2.0.0 # via pytest ipykernel==6.29.4 - # via manim-slides ipython==8.18.1 # via ipykernel # via manim-slides @@ -169,7 +171,6 @@ mpmath==1.3.0 multipledispatch==1.0.0 # via pyrr myst-parser==2.0.0 - # via manim-slides nbclient==0.10.0 # via nbconvert nbconvert==7.16.3 @@ -179,7 +180,6 @@ nbformat==5.10.4 # via nbconvert # via nbsphinx nbsphinx==0.9.3 - # via manim-slides nest-asyncio==1.6.0 # via ipykernel networkx==2.8.8 @@ -205,7 +205,6 @@ packaging==24.0 # via qtpy # via sphinx pandoc==2.3 - # via manim-slides pandocfilters==1.5.1 # via nbconvert parso==0.8.4 @@ -232,6 +231,7 @@ ply==3.11 pre-commit==3.7.0 prompt-toolkit==3.0.43 # via ipython + # via questionary psutil==5.9.8 # via ipykernel ptyprocess==0.7.0 @@ -241,12 +241,16 @@ pure-eval==0.2.2 pycairo==1.26.0 # via manim pydantic==2.7.0 + # via bump-my-version # via manim-slides # via pydantic-extra-types + # via pydantic-settings pydantic-core==2.18.1 # via pydantic pydantic-extra-types==2.6.0 # via manim-slides +pydantic-settings==2.2.1 + # via bump-my-version pydub==0.25.1 # via manim # via manimgl @@ -291,6 +295,8 @@ pytest-xdist==3.5.0 python-dateutil==2.9.0.post0 # via jupyter-client # via matplotlib +python-dotenv==1.0.1 + # via pydantic-settings python-pptx==0.6.23 # via manim-slides pyyaml==6.0.1 @@ -302,6 +308,8 @@ pyzmq==26.0.0 # via jupyter-client qtpy==2.4.1 # via manim-slides +questionary==1.10.0 + # via bump-my-version referencing==0.34.0 # via jsonschema # via jsonschema-specifications @@ -310,9 +318,13 @@ requests==2.31.0 # via manim-slides # via sphinx rich==13.7.1 + # via bump-my-version # via manim # via manim-slides # via manimgl + # via rich-click +rich-click==1.8.0 + # via bump-my-version rpds-py==0.18.0 # via jsonschema # via referencing @@ -343,7 +355,6 @@ soupsieve==2.5 # via beautifulsoup4 sphinx==7.3.6 # via furo - # via manim-slides # via myst-parser # via nbsphinx # via sphinx-basic-ng @@ -353,9 +364,7 @@ sphinx==7.3.6 sphinx-basic-ng==1.0.0b2 # via furo sphinx-click==5.1.0 - # via manim-slides sphinx-copybutton==0.5.2 - # via manim-slides sphinxcontrib-applehelp==1.0.8 # via sphinx sphinxcontrib-devhelp==1.0.6 @@ -369,7 +378,6 @@ sphinxcontrib-qthelp==1.0.7 sphinxcontrib-serializinghtml==1.1.10 # via sphinx sphinxext-opengraph==0.9.1 - # via manim-slides srt==3.5.3 # via manim stack-data==0.6.3 @@ -381,6 +389,8 @@ sympy==1.12 # via manimgl tinycss2==1.2.1 # via nbconvert +tomlkit==0.12.4 + # via bump-my-version tornado==6.4 # via ipykernel # via jupyter-client @@ -402,6 +412,7 @@ traitlets==5.14.2 typing-extensions==4.11.0 # via pydantic # via pydantic-core + # via rich-click urllib3==2.2.1 # via requests validators==0.28.0 @@ -410,6 +421,8 @@ virtualenv==20.25.3 # via pre-commit watchdog==2.3.1 # via manim +wcmatch==8.5.1 + # via bump-my-version wcwidth==0.2.13 # via prompt-toolkit webencodings==0.5.1 diff --git a/requirements.lock b/requirements.lock index 7525c64b..db09e50c 100644 --- a/requirements.lock +++ b/requirements.lock @@ -8,24 +8,12 @@ # with-sources: false -e file:. -alabaster==0.7.16 - # via sphinx annotated-types==0.6.0 # via pydantic asttokens==2.4.1 # via stack-data -attrs==23.2.0 - # via jsonschema - # via referencing av==12.0.0 # via manim-slides -babel==2.14.0 - # via sphinx -beautifulsoup4==4.12.3 - # via furo - # via nbconvert -bleach==6.1.0 - # via nbconvert certifi==2024.2.2 # via requests charset-normalizer==3.3.2 @@ -35,7 +23,6 @@ click==8.1.7 # via cloup # via manim # via manim-slides - # via sphinx-click click-default-group==1.2.4 # via manim # via manim-slides @@ -44,43 +31,24 @@ cloup==0.13.1 colour==0.1.5 # via manim # via manimgl -comm==0.2.2 - # via ipykernel contourpy==1.2.1 # via matplotlib cycler==0.12.1 # via matplotlib -debugpy==1.8.1 - # via ipykernel decorator==5.1.1 # via ipython # via manim -defusedxml==0.7.1 - # via nbconvert docutils==0.20.1 # via manim-slides - # via myst-parser - # via nbsphinx - # via sphinx - # via sphinx-click executing==2.0.1 # via stack-data -fastjsonschema==2.19.1 - # via nbformat fonttools==4.51.0 # via matplotlib -furo==2024.1.29 - # via manim-slides glcontext==2.5.0 # via moderngl idna==3.7 # via requests -imagesize==1.4.1 - # via sphinx -ipykernel==6.29.4 - # via manim-slides ipython==8.18.1 - # via ipykernel # via manim-slides # via manimgl isosurfaces==0.1.0 @@ -90,25 +58,6 @@ jedi==0.19.1 # via ipython jinja2==3.1.3 # via manim-slides - # via myst-parser - # via nbconvert - # via nbsphinx - # via sphinx -jsonschema==4.21.1 - # via nbformat -jsonschema-specifications==2023.12.1 - # via jsonschema -jupyter-client==8.6.1 - # via ipykernel - # via nbclient -jupyter-core==5.7.2 - # via ipykernel - # via jupyter-client - # via nbclient - # via nbconvert - # via nbformat -jupyterlab-pygments==0.3.0 - # via nbconvert kiwisolver==1.4.5 # via matplotlib lxml==5.2.1 @@ -125,23 +74,15 @@ mapbox-earcut==1.0.1 # via manim # via manimgl markdown-it-py==3.0.0 - # via mdit-py-plugins - # via myst-parser # via rich markupsafe==2.1.5 # via jinja2 - # via nbconvert matplotlib==3.8.4 # via manimgl matplotlib-inline==0.1.7 - # via ipykernel # via ipython -mdit-py-plugins==0.4.0 - # via myst-parser mdurl==0.1.2 # via markdown-it-py -mistune==3.0.2 - # via nbconvert moderngl==5.10.0 # via manim # via manimgl @@ -153,20 +94,6 @@ mpmath==1.3.0 # via sympy multipledispatch==1.0.0 # via pyrr -myst-parser==2.0.0 - # via manim-slides -nbclient==0.10.0 - # via nbconvert -nbconvert==7.16.3 - # via nbsphinx -nbformat==5.10.4 - # via nbclient - # via nbconvert - # via nbsphinx -nbsphinx==0.9.3 - # via manim-slides -nest-asyncio==1.6.0 - # via ipykernel networkx==2.8.8 # via manim numpy==1.26.4 @@ -181,15 +108,8 @@ numpy==1.26.4 # via pyrr # via scipy packaging==24.0 - # via ipykernel # via matplotlib - # via nbconvert # via qtpy - # via sphinx -pandoc==2.3 - # via manim-slides -pandocfilters==1.5.1 - # via nbconvert parso==0.8.4 # via jedi pexpect==4.9.0 @@ -201,16 +121,8 @@ pillow==9.5.0 # via matplotlib # via moderngl-window # via python-pptx -platformdirs==4.2.0 - # via jupyter-core -plumbum==1.8.2 - # via pandoc -ply==3.11 - # via pandoc prompt-toolkit==3.0.43 # via ipython -psutil==5.9.8 - # via ipykernel ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 @@ -230,13 +142,10 @@ pydub==0.25.1 pyglet==2.0.15 # via moderngl-window pygments==2.17.2 - # via furo # via ipython # via manim # via manimgl - # via nbconvert # via rich - # via sphinx pyopengl==3.1.7 # via manimgl pyparsing==3.1.2 @@ -257,32 +166,20 @@ pyside6-essentials==6.5.2 # via pyside6 # via pyside6-addons python-dateutil==2.9.0.post0 - # via jupyter-client # via matplotlib python-pptx==0.6.23 # via manim-slides pyyaml==6.0.1 # via manimgl - # via myst-parser -pyzmq==26.0.0 - # via ipykernel - # via jupyter-client qtpy==2.4.1 # via manim-slides -referencing==0.34.0 - # via jsonschema - # via jsonschema-specifications requests==2.31.0 # via manim # via manim-slides - # via sphinx rich==13.7.1 # via manim # via manim-slides # via manimgl -rpds-py==0.18.0 - # via jsonschema - # via referencing rtoml==0.10.0 # via manim-slides scipy==1.13.0 @@ -297,44 +194,10 @@ shiboken6==6.5.2 # via pyside6-essentials six==1.16.0 # via asttokens - # via bleach # via python-dateutil skia-pathops==0.7.4 # via manim # via manimgl -snowballstemmer==2.2.0 - # via sphinx -soupsieve==2.5 - # via beautifulsoup4 -sphinx==7.3.6 - # via furo - # via manim-slides - # via myst-parser - # via nbsphinx - # via sphinx-basic-ng - # via sphinx-click - # via sphinx-copybutton - # via sphinxext-opengraph -sphinx-basic-ng==1.0.0b2 - # via furo -sphinx-click==5.1.0 - # via manim-slides -sphinx-copybutton==0.5.2 - # via manim-slides -sphinxcontrib-applehelp==1.0.8 - # via sphinx -sphinxcontrib-devhelp==1.0.6 - # via sphinx -sphinxcontrib-htmlhelp==2.0.5 - # via sphinx -sphinxcontrib-jsmath==1.0.1 - # via sphinx -sphinxcontrib-qthelp==1.0.7 - # via sphinx -sphinxcontrib-serializinghtml==1.1.10 - # via sphinx -sphinxext-opengraph==0.9.1 - # via manim-slides srt==3.5.3 # via manim stack-data==0.6.3 @@ -344,26 +207,13 @@ svgelements==1.9.6 # via manimgl sympy==1.12 # via manimgl -tinycss2==1.2.1 - # via nbconvert -tornado==6.4 - # via ipykernel - # via jupyter-client tqdm==4.66.2 # via manim # via manim-slides # via manimgl traitlets==5.14.2 - # via comm - # via ipykernel # via ipython - # via jupyter-client - # via jupyter-core # via matplotlib-inline - # via nbclient - # via nbconvert - # via nbformat - # via nbsphinx typing-extensions==4.11.0 # via pydantic # via pydantic-core @@ -375,8 +225,5 @@ watchdog==2.3.1 # via manim wcwidth==0.2.13 # via prompt-toolkit -webencodings==0.5.1 - # via bleach - # via tinycss2 xlsxwriter==3.2.0 # via python-pptx