Skip to content

Commit 95fba7d

Browse files
behacklJasonGrace2282pre-commit-ci[bot]
authored
Change project management tool from poetry to uv (#4138)
* rewrite pyproject.toml to support uv; version upgrades of several dev dependencies * codespellrc: poetry.lock -> uv.lock * rewrite workflows, first attempt * change name of pre-commit-hook * dev-dependencies -> dependency-groups.dev * lint + format * Update .github/workflows/ci.yml Co-authored-by: Aarush Deshpande <[email protected]> * convert development.rst to myst markdown * fix (most) docbuild warnings from theme upgrade * development instructions: switch to uv, plus minor updates * update entrypoint config in plugin docs + tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Aarush Deshpande <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a6990bd commit 95fba7d

13 files changed

+4244
-5261
lines changed

.codespellrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[codespell]
22
check-hidden = True
3-
skip = .git,*.js,*.js.map,*.css,*.css.map,*.html,*.po,*.pot,poetry.lock,*.log,*.svg
3+
skip = .git,*.js,*.js.map,*.css,*.css.map,*.html,*.po,*.pot,uv.lock,*.log,*.svg
44
ignore-words = .codespell_ignorewords

.github/workflows/ci.yml

+8-16
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,15 @@ jobs:
2929
- name: Checkout the repository
3030
uses: actions/checkout@v4
3131

32-
- name: Install Poetry
33-
run: |
34-
pipx install "poetry==1.8.*"
35-
poetry config virtualenvs.prefer-active-python true
36-
3732
- name: Setup Python ${{ matrix.python }}
3833
uses: actions/setup-python@v5
3934
with:
4035
python-version: ${{ matrix.python }}
41-
cache: "poetry"
4236

43-
- name: Setup macOS PATH
44-
if: runner.os == 'macOS'
45-
run: |
46-
echo "$HOME/.local/bin" >> $GITHUB_PATH
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v5
39+
with:
40+
enable-cache: true
4741

4842
- name: Setup cache variables
4943
shell: bash
@@ -119,7 +113,6 @@ jobs:
119113
shell: bash
120114
run: |
121115
echo "/Library/TeX/texbin" >> $GITHUB_PATH
122-
echo "$HOME/.poetry/bin" >> $GITHUB_PATH
123116
echo "$PWD/macos-cache/TinyTeX/bin/universal-darwin" >> $GITHUB_PATH
124117
125118
- name: Setup Windows cache
@@ -150,21 +143,20 @@ jobs:
150143
if: runner.os == 'Windows'
151144
run: |
152145
$env:Path += ";" + "$($PWD)\ManimCache\LatexWindows\TinyTeX\bin\windows"
153-
$env:Path = "$env:USERPROFILE\.poetry\bin;$($env:PATH)"
154146
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
155147
156148
- name: Install dependencies and manim
157149
run: |
158-
poetry install --all-extras
150+
uv sync --all-extras --locked
159151
160152
- name: Run tests
161153
run: |
162-
poetry run python -m pytest
154+
uv run python -m pytest
163155
164156
- name: Run module doctests
165157
run: |
166-
poetry run python -m pytest -v --cov-append --ignore-glob="*opengl*" --doctest-modules manim
158+
uv run python -m pytest -v --cov-append --ignore-glob="*opengl*" --doctest-modules manim
167159
168160
- name: Run doctests in rst files
169161
run: |
170-
cd docs && poetry run make doctest O=-tskip-manim
162+
cd docs && uv run make doctest O=-tskip-manim

.github/workflows/python-publish.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ on:
66

77
jobs:
88
release:
9+
name: "Publish release"
910
runs-on: ubuntu-latest
11+
environment: release
12+
permissions:
13+
id-token: write
14+
1015
steps:
1116
- uses: actions/checkout@v4
1217

13-
- name: Set up Python 3.11
18+
- name: Set up Python 3.13
1419
uses: actions/setup-python@v5
1520
with:
16-
python-version: 3.11
17-
18-
- name: Install dependencies
19-
run: python -m pip install --upgrade poetry
21+
python-version: 3.13
2022

21-
# TODO: Set PYPI_API_TOKEN to api token from pip in secrets
22-
- name: Configure pypi credentials
23-
env:
24-
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
25-
run: poetry config http-basic.pypi __token__ "$PYPI_API_TOKEN"
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
2625

27-
- name: Publish release to pypi
26+
- name: Build and push release to PyPI
2827
run: |
29-
poetry publish --build
30-
poetry build
28+
uv sync
29+
uv build
30+
uv publish
3131
3232
- name: Store artifacts
3333
uses: actions/upload-artifact@v4

.github/workflows/release-publish-documentation.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v4
1313

14-
- name: Set up Python 3.11
14+
- name: Set up Python
1515
uses: actions/setup-python@v5
1616
with:
17-
python-version: 3.11
17+
python-version: 3.13
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
1821

1922
- name: Install system dependencies
2023
run: |
@@ -30,13 +33,12 @@ jobs:
3033
babel-english ctex doublestroke dvisvgm frcursive fundus-calligra jknapltx \
3134
mathastext microtype physics preview ragged2e relsize rsfs setspace standalone \
3235
wasy wasysym
33-
python -m pip install --upgrade poetry
34-
poetry install
36+
uv sync
3537
3638
- name: Build and package documentation
3739
run: |
3840
cd docs/
39-
poetry run make html
41+
uv run make html
4042
cd build/html/
4143
tar -czvf ../html-docs.tar.gz *
4244

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: mixed-line-ending
1212
- id: end-of-file-fixer
1313
- id: check-toml
14-
name: Validate Poetry
14+
name: Validate pyproject.toml
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
1616
rev: v0.9.2
1717
hooks:

docs/source/conf.py

-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
"source_repository": "https://github.com/ManimCommunity/manim/",
125125
"source_branch": "main",
126126
"source_directory": "docs/source/",
127-
"top_of_page_button": None,
128127
"light_logo": "manim-logo-sidebar.svg",
129128
"dark_logo": "manim-logo-sidebar-dark.svg",
130129
"light_css_variables": {

0 commit comments

Comments
 (0)