Skip to content

Commit

Permalink
chore(deps): use PDM instead of Poetry (#354)
Browse files Browse the repository at this point in the history
* chore(deps): use PDM instead of Poetry

* chore(git): move to top

* chore(lint): fixes

* fix(pdm): dynamic version did not work

* chore(ci): fix syntax for Windows

* fix(ci): typo

* wip(docs): updates

* chore(docs): add changelog entry

* chore(docs): admonitions

* chore(docs): update to use manim-slides render

* chore(docs): make it better
  • Loading branch information
jeertmans authored Jan 18, 2024
1 parent 62560ea commit be227bb
Show file tree
Hide file tree
Showing 20 changed files with 3,826 additions and 4,437 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,53 +33,64 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Install Python
uses: actions/setup-python@v5

- name: Install PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
cache: poetry
cache: true

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev
- name: Setup Pandoc
uses: nikeee/setup-pandoc@v1

- name: Install local Python package
run: poetry install --with docs
run: pdm install -dGdocs -dGgithub-action

- name: Install IPython kernel
run: poetry run ipython kernel install --name "manim-slides" --user
run: pdm run ipython kernel install --name "manim-slides" --user

- name: Restore cached media
id: cache-media-restore
uses: actions/cache/restore@v4
with:
path: docs/media
key: ${{ runner.os }}-docs-media

- name: Clear cache
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ steps.cache-media-restore.outputs.cache-primary-key }} --confirm || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Save media to cache
id: cache-media-save
uses: actions/cache/save@v4
with:
path: docs/media
key: ${{ steps.cache-media-restore.outputs.cache-primary-key }}

- name: Build docs
run: cd docs && poetry run make html
run: cd docs && pdm run make html

- name: Upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
# Upload docs/build/html dir
path: docs/build/html/

- name: Show docs/build/html/_static/ dir content (video only)
run: tree -L 3 docs/build/html/_static/ -P '*.mp4'

- name: Deploy to GitHub Pages
id: deployment
if: github.event_name != 'pull_request'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Upload Python Package
name: Upload Packages

on:
push:
Expand All @@ -7,31 +7,23 @@ on:
types: [published]

jobs:
build_and_release:
publish-python:
name: Build and release
runs-on: ubuntu-latest

environment: release
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Install Python
uses: actions/setup-python@v5
- name: Install PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
cache: poetry

- name: Build wheels
run: poetry build
cache: true

- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: poetry publish
run: pdm publish

publish-docker:
name: Publish Docker image
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry

- name: Install Python
uses: actions/setup-python@v5
- name: Install PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.pyversion }}
cache: poetry
cache: true

# Path related stuff
- name: Append to Path on MacOS
Expand Down Expand Up @@ -72,15 +69,15 @@ jobs:

- name: Install Manim Slides
run: |
poetry install --with test --all-extras
pdm install -dGgithub-action -dGtest
- name: Run pytest
if: matrix.os != 'ubuntu-latest' || matrix.pyversion != '3.11'
run: poetry run pytest
run: pdm run pytest

- name: Run pytest and coverage
if: matrix.os == 'ubuntu-latest' && matrix.pyversion == '3.11'
run: poetry run pytest --cov-report xml --cov=manim_slides tests/
run: pdm run pytest --cov-report xml --cov=manim_slides tests/

- name: Upload to codecov.io
if: matrix.os == 'ubuntu-latest' && matrix.pyversion == '3.11'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__/
/build
/dist
*.egg-info/
.pdm-python

# Manim files
images/
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ repos:
args: [--autofix]
- id: pretty-format-toml
exclude: poetry.lock
args: [--autofix]
args: [--autofix, --trailing-commas]
- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
- id: blackdoc
additional_dependencies: [black==23.10.1]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
hooks:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
and `self.zoom`.
[#331](https://github.com/jeertmans/manim-slides/pull/331)
- Created a Docker image, published on GitHub.
[#331](https://github.com/jeertmans/manim-slides/pull/355)
[#355](https://github.com/jeertmans/manim-slides/pull/355)

(v5.1-modified)=
### Modified
Expand All @@ -47,6 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed subrocess calls to FFMPEG with direct `libav` bindings using
the `av` Python module. This should enhance rendering speed and security.
[#335](https://github.com/jeertmans/manim-slides/pull/335)
- Changed build backend to PDM and reflected on docs.
[#354](https://github.com/jeertmans/manim-slides/pull/354)

## [v5](https://github.com/jeertmans/manim-slides/compare/v4.16.0...v5.0.0)

Expand Down
Loading

0 comments on commit be227bb

Please sign in to comment.