Skip to content

Commit 9f2e475

Browse files
authored
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
1 parent 6d85222 commit 9f2e475

File tree

7 files changed

+118
-203
lines changed

7 files changed

+118
-203
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 16 deletions
This file was deleted.

.readthedocs.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@ sphinx:
1515
fail_on_warning: true
1616
python:
1717
install:
18-
- method: pip
19-
path: .
20-
extra_requirements:
21-
- docs
22-
- magic
23-
- sphinx-directive
18+
- requirements: requirements-dev.lock

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
(unreleased)=
1111
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/v5.1.6...HEAD)
1212

13+
(unreleased-chore)=
14+
### Chore
15+
16+
- Improved the CI for bumping the version and README rendering on PyPI.
17+
[#425](https://github.com/jeertmans/manim-slides/pull/425)
18+
1319
(v5.1.6)=
1420
## [v5.1.6](https://github.com/jeertmans/manim-slides/compare/v5.1.5...v5.1.6)
1521

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<img alt="Manim Slides Logo" src="https://raw.githubusercontent.com/jeertmans/manim-slides/main/static/logo.png">
55
</picture>
66

7+
<!-- start pypi -->
8+
79
[![Latest Release][pypi-version-badge]][pypi-version-url]
810
[![Python version][pypi-python-version-badge]][pypi-version-url]
911
[![PyPI - Downloads][pypi-download-badge]][pypi-version-url]

pyproject.toml

Lines changed: 86 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
build-backend = "hatchling.build"
3-
requires = ["hatchling"]
3+
requires = ["hatchling", "hatch-fancy-pypi-readme"]
44

55
[project]
66
authors = [{name = "Jérome Eertmans", email = "[email protected]"}]
@@ -34,26 +34,13 @@ dependencies = [
3434
"tqdm>=4.64.1",
3535
]
3636
description = "Tool for live presentations using manim"
37-
dynamic = ["version"]
37+
dynamic = ["readme", "version"]
3838
keywords = ["manim", "slides", "plugin", "manimgl"]
39-
license = {text = "MIT"}
39+
license = "MIT"
4040
name = "manim-slides"
41-
readme = "README.md"
4241
requires-python = ">=3.9"
4342

4443
[project.optional-dependencies]
45-
docs = [
46-
"manim-slides[magic,sphinx-directive]",
47-
"furo>=2023.5.20",
48-
"ipykernel>=6.25.1",
49-
"myst-parser>=2.0.0",
50-
"nbsphinx>=0.9.2",
51-
"pandoc>=2.3",
52-
"sphinx>=7.0.1",
53-
"sphinx-click>=4.4.0",
54-
"sphinx-copybutton>=0.5.1",
55-
"sphinxext-opengraph>=0.7.5",
56-
]
5744
full = [
5845
"manim-slides[magic,manim,sphinx-directive]",
5946
]
@@ -79,6 +66,56 @@ Founding = "https://github.com/sponsors/jeertmans"
7966
Homepage = "https://github.com/jeertmans/manim-slides"
8067
Repository = "https://github.com/jeertmans/manim-slides"
8168

69+
[tool.bumpversion]
70+
allow_dirty = false
71+
commit = true
72+
commit_args = ""
73+
current_version = "5.1.6"
74+
ignore_missing_version = false
75+
message = "chore(deps): bump version from {current_version} to {new_version}"
76+
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-rc(?P<release>\d+))?'
77+
regex = false
78+
replace = "{new_version}"
79+
search = "{current_version}"
80+
serialize = ["{major}.{minor}.{patch}-rc{release}", "{major}.{minor}.{patch}"]
81+
sign_tags = false
82+
tag = false
83+
tag_message = "Bump version: {current_version} → {new_version}"
84+
tag_name = "v{new_version}"
85+
86+
[[tool.bumpversion.files]]
87+
filename = "manim_slides/__version__.py"
88+
replace = '__version__ = "{new_version}"'
89+
search = '__version__ = "{current_version}"'
90+
91+
[[tool.bumpversion.files]]
92+
filename = "CITATION.cff"
93+
replace = "version: v{new_version}"
94+
search = "version: v{current_version}"
95+
96+
[[tool.bumpversion.files]]
97+
filename = "CHANGELOG.md"
98+
replace = "v{new_version}"
99+
search = "Unreleased"
100+
101+
[[tool.bumpversion.files]]
102+
filename = "CHANGELOG.md"
103+
replace = "v{new_version}"
104+
search = "unreleased"
105+
106+
[[tool.bumpversion.files]]
107+
filename = "CHANGELOG.md"
108+
replace = "v{current_version}...v{new_version}"
109+
search = "v{current_version}...HEAD"
110+
111+
[[tool.bumpversion.files]]
112+
filename = "CHANGELOG.md"
113+
replace = '''<!-- start changelog -->
114+
115+
(unreleased)=
116+
## [Unreleased](https://github.com/jeertmans/manim-slides/compare/{new_version}...HEAD)'''
117+
search = "<!-- start changelog -->"
118+
82119
[tool.codespell]
83120
builtin = "clear,rare,informal,usage,names,en-GB_to_en-US"
84121
check-hidden = true
@@ -94,6 +131,25 @@ exclude_lines = [
94131
]
95132
precision = 2
96133

134+
[tool.hatch.metadata.hooks.fancy-pypi-readme]
135+
content-type = "text/markdown"
136+
137+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
138+
text = """<p align="center">
139+
<a href="https://www.github.com/jeertmans/manin-slides">
140+
<img src="https://raw.githubusercontent.com/jeertmans/manim-slides/main/static/logo.png"/>
141+
</a>
142+
</p>
143+
"""
144+
145+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
146+
path = "README.md"
147+
start-after = "<!-- start pypi -->"
148+
149+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
150+
pattern = '> \[!([A-Z]+)\]'
151+
replacement = '> **\1:**'
152+
97153
[tool.hatch.version]
98154
path = "manim_slides/__version__.py"
99155

@@ -138,9 +194,21 @@ isort = {known-first-party = ["manim_slides", "tests"]}
138194

139195
[tool.rye]
140196
dev-dependencies = [
141-
"bump2version>=1.0.1",
142-
"manim-slides[manim,manimgl,pyqt6]",
197+
"manim-slides[magic,manim,manimgl,pyqt6,sphinx-directive]",
198+
# dev
199+
"bump-my-version>=0.20.3",
143200
"pre-commit>=3.5.0",
201+
# docs
202+
"furo>=2023.5.20",
203+
"ipykernel>=6.25.1",
204+
"myst-parser>=2.0.0",
205+
"nbsphinx>=0.9.2",
206+
"pandoc>=2.3",
207+
"sphinx>=7.0.1",
208+
"sphinx-click>=4.4.0",
209+
"sphinx-copybutton>=0.5.1",
210+
"sphinxext-opengraph>=0.7.5",
211+
# tests
144212
"pytest>=7.4.0",
145213
"pytest-cov>=4.1.0",
146214
"pytest-env>=0.8.2",

requirements-dev.lock

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,22 @@ beautifulsoup4==4.12.3
2626
# via nbconvert
2727
bleach==6.1.0
2828
# via nbconvert
29-
bump2version==1.0.1
29+
bracex==2.4
30+
# via wcmatch
31+
bump-my-version==0.21.0
3032
certifi==2024.2.2
3133
# via requests
3234
cfgv==3.4.0
3335
# via pre-commit
3436
charset-normalizer==3.3.2
3537
# via requests
3638
click==8.1.7
39+
# via bump-my-version
3740
# via click-default-group
3841
# via cloup
3942
# via manim
4043
# via manim-slides
44+
# via rich-click
4145
# via sphinx-click
4246
click-default-group==1.2.4
4347
# via manim
@@ -81,7 +85,6 @@ filelock==3.13.4
8185
fonttools==4.51.0
8286
# via matplotlib
8387
furo==2024.1.29
84-
# via manim-slides
8588
glcontext==2.5.0
8689
# via moderngl
8790
identify==2.5.35
@@ -93,7 +96,6 @@ imagesize==1.4.1
9396
iniconfig==2.0.0
9497
# via pytest
9598
ipykernel==6.29.4
96-
# via manim-slides
9799
ipython==8.18.1
98100
# via ipykernel
99101
# via manim-slides
@@ -169,7 +171,6 @@ mpmath==1.3.0
169171
multipledispatch==1.0.0
170172
# via pyrr
171173
myst-parser==2.0.0
172-
# via manim-slides
173174
nbclient==0.10.0
174175
# via nbconvert
175176
nbconvert==7.16.3
@@ -179,7 +180,6 @@ nbformat==5.10.4
179180
# via nbconvert
180181
# via nbsphinx
181182
nbsphinx==0.9.3
182-
# via manim-slides
183183
nest-asyncio==1.6.0
184184
# via ipykernel
185185
networkx==2.8.8
@@ -205,7 +205,6 @@ packaging==24.0
205205
# via qtpy
206206
# via sphinx
207207
pandoc==2.3
208-
# via manim-slides
209208
pandocfilters==1.5.1
210209
# via nbconvert
211210
parso==0.8.4
@@ -232,6 +231,7 @@ ply==3.11
232231
pre-commit==3.7.0
233232
prompt-toolkit==3.0.43
234233
# via ipython
234+
# via questionary
235235
psutil==5.9.8
236236
# via ipykernel
237237
ptyprocess==0.7.0
@@ -241,12 +241,16 @@ pure-eval==0.2.2
241241
pycairo==1.26.0
242242
# via manim
243243
pydantic==2.7.0
244+
# via bump-my-version
244245
# via manim-slides
245246
# via pydantic-extra-types
247+
# via pydantic-settings
246248
pydantic-core==2.18.1
247249
# via pydantic
248250
pydantic-extra-types==2.6.0
249251
# via manim-slides
252+
pydantic-settings==2.2.1
253+
# via bump-my-version
250254
pydub==0.25.1
251255
# via manim
252256
# via manimgl
@@ -291,6 +295,8 @@ pytest-xdist==3.5.0
291295
python-dateutil==2.9.0.post0
292296
# via jupyter-client
293297
# via matplotlib
298+
python-dotenv==1.0.1
299+
# via pydantic-settings
294300
python-pptx==0.6.23
295301
# via manim-slides
296302
pyyaml==6.0.1
@@ -302,6 +308,8 @@ pyzmq==26.0.0
302308
# via jupyter-client
303309
qtpy==2.4.1
304310
# via manim-slides
311+
questionary==1.10.0
312+
# via bump-my-version
305313
referencing==0.34.0
306314
# via jsonschema
307315
# via jsonschema-specifications
@@ -310,9 +318,13 @@ requests==2.31.0
310318
# via manim-slides
311319
# via sphinx
312320
rich==13.7.1
321+
# via bump-my-version
313322
# via manim
314323
# via manim-slides
315324
# via manimgl
325+
# via rich-click
326+
rich-click==1.8.0
327+
# via bump-my-version
316328
rpds-py==0.18.0
317329
# via jsonschema
318330
# via referencing
@@ -343,7 +355,6 @@ soupsieve==2.5
343355
# via beautifulsoup4
344356
sphinx==7.3.6
345357
# via furo
346-
# via manim-slides
347358
# via myst-parser
348359
# via nbsphinx
349360
# via sphinx-basic-ng
@@ -353,9 +364,7 @@ sphinx==7.3.6
353364
sphinx-basic-ng==1.0.0b2
354365
# via furo
355366
sphinx-click==5.1.0
356-
# via manim-slides
357367
sphinx-copybutton==0.5.2
358-
# via manim-slides
359368
sphinxcontrib-applehelp==1.0.8
360369
# via sphinx
361370
sphinxcontrib-devhelp==1.0.6
@@ -369,7 +378,6 @@ sphinxcontrib-qthelp==1.0.7
369378
sphinxcontrib-serializinghtml==1.1.10
370379
# via sphinx
371380
sphinxext-opengraph==0.9.1
372-
# via manim-slides
373381
srt==3.5.3
374382
# via manim
375383
stack-data==0.6.3
@@ -381,6 +389,8 @@ sympy==1.12
381389
# via manimgl
382390
tinycss2==1.2.1
383391
# via nbconvert
392+
tomlkit==0.12.4
393+
# via bump-my-version
384394
tornado==6.4
385395
# via ipykernel
386396
# via jupyter-client
@@ -402,6 +412,7 @@ traitlets==5.14.2
402412
typing-extensions==4.11.0
403413
# via pydantic
404414
# via pydantic-core
415+
# via rich-click
405416
urllib3==2.2.1
406417
# via requests
407418
validators==0.28.0
@@ -410,6 +421,8 @@ virtualenv==20.25.3
410421
# via pre-commit
411422
watchdog==2.3.1
412423
# via manim
424+
wcmatch==8.5.1
425+
# via bump-my-version
413426
wcwidth==0.2.13
414427
# via prompt-toolkit
415428
webencodings==0.5.1

0 commit comments

Comments
 (0)