Skip to content

Commit de91ac7

Browse files
authored
chore(ci): from Rye to uv (#476)
* chore(ci): from Rye to uv uv is just better for what I need to do, and Rye will eventually be replaced by uv anyway * chore(ci): add tests' extra * chore(ci): oops * fix(ci): some tests * chore(ci): remove -W error Because it breaks on the CI, but not locally..
1 parent 6ad89ec commit de91ac7

File tree

15 files changed

+3591
-927
lines changed

15 files changed

+3591
-927
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,13 @@ jobs:
1818
- name: Checkout repository
1919
uses: actions/checkout@v4
2020

21-
- name: Setup Rye
22-
env:
23-
RYE_INSTALL_OPTION: --yes
24-
run: |
25-
curl -sSf https://rye.astral.sh/get | bash
26-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
27-
28-
- name: Configure Rye
29-
run: rye config --set-bool behavior.use-uv=true
21+
- name: Setup uv
22+
uses: astral-sh/setup-uv@v2
23+
with:
24+
enable-cache: true
3025

3126
- name: Build package
32-
run: rye build
27+
run: uv build
3328

3429
- name: Publish to PyPI
3530
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

.github/workflows/tests.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -69,29 +69,13 @@ jobs:
6969
- name: Checkout repository
7070
uses: actions/checkout@v4
7171

72-
- name: Setup Rye
73-
if: matrix.os != 'windows-latest'
74-
env:
75-
RYE_TOOLCHAIN_VERSION: ${{ matrix.pyversion}}
76-
RYE_INSTALL_OPTION: --yes
77-
run: |
78-
curl -sSf https://rye.astral.sh/get | bash
79-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
80-
81-
# Stolen from https://github.com/bluss/pyproject-local-kernel/blob/2b641290694adc998fb6bceea58d3737523a68b7/.github/workflows/ci.yaml
82-
- name: Install Rye (Windows)
83-
if: matrix.os == 'windows-latest'
84-
shell: bash
85-
run: |
86-
C:/msys64/usr/bin/wget.exe -q 'https://github.com/astral-sh/rye/releases/latest/download/rye-x86_64-windows.exe' -O rye-x86_64-windows.exe
87-
./rye-x86_64-windows.exe self install --toolchain-version ${{ matrix.pyversion }} --modify-path -y
88-
echo "$HOME\\.rye\\shims" >> $GITHUB_PATH
72+
- name: Setup uv
73+
uses: astral-sh/setup-uv@v2
74+
with:
75+
enable-cache: true
8976

90-
- name: Configure Rye
91-
shell: bash
92-
run: |
93-
rye config --set-bool behavior.use-uv=true
94-
rye pin ${{ matrix.pyversion }}
77+
- name: Setup Python ${{ matrix.pyversion }}
78+
run: uv python install ${{ matrix.pyversion }}
9579

9680
- name: Install manim dependencies on MacOS
9781
if: matrix.os == 'macos-latest'
@@ -113,12 +97,10 @@ jobs:
11397
uses: ssciwr/setup-mesa-dist-win@v2
11498

11599
- name: Install Manim Slides
116-
shell: bash
117-
run: rye sync
100+
run: uv sync --locked --extra tests
118101

119102
- name: Run pytest
120-
shell: bash
121-
run: rye run pytest
103+
run: uv run pytest
122104

123105
- name: Upload to codecov.io
124106
uses: codecov/codecov-action@v4

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ __pycache__/
44
/build
55
/dist
66
*.egg-info/
7-
.pdm-python
87

98
# Manim files
109
images/
@@ -45,7 +44,7 @@ paper/paper.pdf
4544
paper/media/
4645

4746
# Others
48-
.coverage
47+
.coverage*
4948
coverage.xml
5049

5150
rendering_times.csv

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ repos:
2020
- id: pretty-format-toml
2121
exclude: poetry.lock
2222
args: [--autofix, --trailing-commas]
23-
- repo: https://github.com/keewis/blackdoc
24-
rev: v0.3.9
25-
hooks:
26-
- id: blackdoc
2723
- repo: https://github.com/astral-sh/ruff-pre-commit
2824
rev: v0.6.7
2925
hooks:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4646
[#467](https://github.com/jeertmans/manim-slides/pull/467)
4747
- Documented potential fix for PPTX issue.
4848
[#475](https://github.com/jeertmans/manim-slides/pull/475)
49+
- Changed project manager from Rye to uv.
50+
[#476](https://github.com/jeertmans/manim-slides/pull/476)
4951

5052
(unreleased-fixed)=
5153
### Fixed

docs/source/contributing/workflow.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,30 @@ the repository, and clone it locally.
2424

2525
As for every Python project, using virtual environment is recommended to avoid
2626
conflicts between modules.
27-
For this project, we use [Rye](https://rye.astral.sh/) to easily manage project
27+
For this project, we use [uv](https://github.com/astral-sh/uv) to easily manage project
2828
and development dependencies. If not already, please install this tool.
2929

3030
## Installing Python modules
3131

32-
With Rye, installation becomes straightforward:
32+
With uv, installation becomes straightforward:
3333

3434
```bash
35-
rye sync --all-features
35+
uv sync --all-extras
3636
```
3737

38+
:::{note}
39+
You still need the same dependencies as to install Manim and ManimGL,
40+
so please check their respective installation guides.
41+
:::
42+
3843
## Running commands
3944

4045
Because modules are installed in a new Python environment,
4146
you cannot use them directly in the shell.
42-
Instead, you either need to prepend `rye run` to any command, e.g.:
47+
Instead, you either need to prepend `uv run` to any command, e.g.:
4348

4449
```bash
45-
rye run manim-slides wizard
50+
uv run manim-slides wizard
4651
```
4752

4853
## Testing your code
@@ -51,7 +56,7 @@ Most of the tests are done with GitHub actions, thus not on your computer.
5156
The only command you should run locally is:
5257

5358
```bash
54-
rye run pre-commit run --all-files
59+
uv run pre-commit run --all-files
5560
```
5661

5762
This runs a few linter and formatter to make sure the code quality and style stay
@@ -61,7 +66,7 @@ If a warning or an error is displayed, please fix it before going to next step.
6166
For testing your code, simply run:
6267

6368
```bash
64-
rye run pytest
69+
uv run pytest
6570
```
6671

6772
## Building the documentation
@@ -73,7 +78,7 @@ To generate the documentation, run the following:
7378

7479
```bash
7580
cd docs
76-
rye run make html
81+
uv run make html
7782
```
7883

7984
Then, the output index file is located at `docs/build/html/index.html` and

manim_slides/config.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def copy_to(
313313
use_cached: bool = True,
314314
include_reversed: bool = True,
315315
prefix: str = "",
316-
) -> "PresentationConfig":
316+
) -> None:
317317
"""Copy the files to a given directory."""
318318
for slide_config in self.slides:
319319
file = slide_config.file
@@ -322,13 +322,8 @@ def copy_to(
322322
dest = folder / f"{prefix}{file.name}"
323323
rev_dest = folder / f"{prefix}{rev_file.name}"
324324

325-
slide_config.file = dest
326-
slide_config.rev_file = rev_dest
327-
328325
if not use_cached or not dest.exists():
329326
shutil.copy(file, dest)
330327

331328
if include_reversed and (not use_cached or not rev_dest.exists()):
332329
shutil.copy(rev_file, rev_dest)
333-
334-
return self

pyproject.toml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pyside6 = ["pyside6>=6.6.1"]
6565
pyside6-full = ["manim-slides[full,pyside6]"]
6666
sphinx-directive = ["docutils>=0.20.1", "manim-slides[manim]"]
6767
tests = [
68+
"manim-slides[full,manimgl,pyqt6,pyside6,sphinx-directive]",
6869
"pytest>=7.4.0",
6970
"pytest-cov>=4.1.0",
7071
"pytest-env>=0.8.2",
@@ -136,7 +137,7 @@ search = "<!-- start changelog -->"
136137
builtin = "clear,rare,informal,usage,names,en-GB_to_en-US"
137138
check-hidden = true
138139
ignore-words-list = "master"
139-
skip = "requirements.lock,requirements-dev.lock"
140+
skip = "uv.lock"
140141

141142
[tool.coverage.report]
142143
exclude_lines = [
@@ -185,11 +186,10 @@ env = [
185186
"QT_QPA_PLATFORM=offscreen",
186187
]
187188
filterwarnings = [
188-
"error",
189189
'''ignore:'audioop' is deprecated:DeprecationWarning''',
190190
'ignore:pkg_resources is deprecated as an API:DeprecationWarning',
191191
'ignore::DeprecationWarning:pkg_resources.*:',
192-
'ignore::SyntaxWarning:pydub.*:',
192+
'ignore::DeprecationWarning:pydub.*:',
193193
]
194194

195195
[tool.ruff]
@@ -220,15 +220,12 @@ isort = {known-first-party = ["manim_slides", "tests"]}
220220
"docs/source/reference/magic_example.ipynb" = ["F403", "F405"]
221221
"tests/test_slide.py" = ["N801"]
222222

223-
[tool.rye]
223+
[tool.uv]
224224
dev-dependencies = [
225225
"bump-my-version>=0.20.3",
226226
"pre-commit>=3.5.0",
227227
"setuptools>=73.0.1",
228228
]
229-
managed = true
230-
231-
[tool.uv]
232229
override-dependencies = [
233230
# Bypass constraints from ManimGL
234231
"manimpango>=0.5.0,<1.0.0",

0 commit comments

Comments
 (0)