mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-05-21 04:26:40 +08:00
chore(dev): move to Rye instead of PDM (#420)
* test: re-add opencv-python * chore(dev): move to Rye instead of PDM * try fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: build backend * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: string quotes? * small fixes * upgrade typing * fix(ci): rye install on Windows * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix(ci): typos * fix * fix(ci): actually use right python version * fix(deps): manimgl * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix docs * another fix * cleanup * make sure to use trusted publisher * chore(docs): remove PDM --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -24,61 +24,25 @@ the repository, and clone it locally.
|
||||
|
||||
As for every Python project, using virtual environment is recommended to avoid
|
||||
conflicts between modules.
|
||||
For this project, we use [PDM](https://pdm-project.org/) to easily manage project
|
||||
For this project, we use [Rye](https://rye-up.com/) to easily manage project
|
||||
and development dependencies. If not already, please install this tool.
|
||||
|
||||
## Installing Python modules
|
||||
|
||||
With PDM, installation becomes straightforward:
|
||||
With Rye, installation becomes straightforward:
|
||||
|
||||
```bash
|
||||
pdm install
|
||||
rye sync --all-features
|
||||
```
|
||||
|
||||
This, however, only installs the minimal set of dependencies to run the package.
|
||||
|
||||
If you would like to install Manim or ManimGL,
|
||||
as documented in the [quickstart](/quickstart),
|
||||
you can use the `-G|--group` option:
|
||||
|
||||
```bash
|
||||
pdm install -Gmanim # For Manim
|
||||
# or
|
||||
pdm install -Gmanimgl # For ManimGL
|
||||
```
|
||||
|
||||
Additionally, Manim Slides comes with groups of dependencies for development purposes:
|
||||
|
||||
```bash
|
||||
pdm install -Gdev # For linters and formatters
|
||||
# or
|
||||
pdm install -Gdocs # To build the documentation locally
|
||||
# or
|
||||
pdm install -Gtest # To run tests
|
||||
```
|
||||
|
||||
:::{note}
|
||||
You can combine any number of groups or extras when installing the package locally.
|
||||
|
||||
You can also install everything with `pdm install -G:all`.
|
||||
:::
|
||||
|
||||
## Running commands
|
||||
|
||||
Because modules are installed in a new Python environment,
|
||||
you cannot use them directly in the shell.
|
||||
Instead, you either need to prepend `pdm run` to any command, e.g.:
|
||||
Instead, you either need to prepend `rye run` to any command, e.g.:
|
||||
|
||||
```bash
|
||||
pdm run manim-slides wizard
|
||||
```
|
||||
|
||||
or [enter a new shell](https://pdm-project.org/latest/usage/venv/#activate-a-virtualenv)
|
||||
that uses this new Python environment:
|
||||
|
||||
```bash
|
||||
eval $(pdm venv activate) # Click on the link above to see shell-specific command
|
||||
manim-slides wizard
|
||||
rye run manim-slides wizard
|
||||
```
|
||||
|
||||
## Testing your code
|
||||
@ -87,7 +51,7 @@ Most of the tests are done with GitHub actions, thus not on your computer.
|
||||
The only command you should run locally is:
|
||||
|
||||
```bash
|
||||
pdm run pre-commit run --all-files
|
||||
rye run pre-commit run --all-files
|
||||
```
|
||||
|
||||
This runs a few linter and formatter to make sure the code quality and style stay
|
||||
@ -97,7 +61,7 @@ If a warning or an error is displayed, please fix it before going to next step.
|
||||
For testing your code, simply run:
|
||||
|
||||
```bash
|
||||
pdm run pytest
|
||||
rye run pytest
|
||||
```
|
||||
|
||||
## Building the documentation
|
||||
@ -109,7 +73,7 @@ To generate the documentation, run the following:
|
||||
|
||||
```bash
|
||||
cd docs
|
||||
pdm run make html
|
||||
rye run make html
|
||||
```
|
||||
|
||||
Then, the output index file is located at `docs/build/html/index.html` and
|
||||
|
@ -106,7 +106,9 @@ Along with the optional dependencies for Manim and ManimGL,
|
||||
Manim Slides offers additional *extras*, that can be activated
|
||||
using optional dependencies:
|
||||
|
||||
- `full`, to include `magic`, `manim`, `manimgl`, and
|
||||
- `full`, to include `magic`, `manim`, and
|
||||
`sphinx-directive` extras (see below);
|
||||
- `full-gl`, to include `magic`, `manimgl`, and
|
||||
`sphinx-directive` extras (see below);
|
||||
- `magic`, to include a Jupyter magic to render
|
||||
animations inside notebooks. This automatically installs `manim`,
|
||||
|
@ -15,7 +15,6 @@ the slides.
|
||||
If both modules are present in {py:data}`sys.modules`, then Manim Slides will
|
||||
prefer using `manim`.
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
The simplest way to use Manim Slides with the correct Manim API is to:
|
||||
|
@ -18,6 +18,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from manim import *\n",
|
||||
"\n",
|
||||
"from manim_slides import *"
|
||||
]
|
||||
},
|
||||
|
Reference in New Issue
Block a user