-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,83 +4,45 @@ | |
|
||
### Requirements | ||
|
||
Developing requires: | ||
Developing requires: | ||
|
||
* the [PDM](https://pdm.fming.dev/) package manager (typically installed with | ||
[pipx](https://pypa.github.io/pipx/)); | ||
* [Nox](https://nox.thea.codes/), a test automation framework which uses Python files | ||
for configuration. | ||
* the [Rye](https://rye-up.com/) package manager; | ||
* the [pre-commit](https://pre-commit.com/) git hook manager, typically | ||
installed with [pipx](https://pipx.pypa.io/stable/). | ||
|
||
### IDE configuration | ||
### Setting up a development environment | ||
|
||
Follow [instructions from the PDM documentation](https://pdm.fming.dev/#use-with-ide). | ||
|
||
### Running tests | ||
|
||
The testing process of Dessine-moi uses [pytest](https://docs.pytest.org) | ||
and [Nox](https://nox.thea.codes). Two make targets are defined to help you run | ||
the tests: | ||
|
||
* `make test`: run pytest without creating a new environment (uses equivalent | ||
to `nox --no-venv`); | ||
* `make nox-test`: run pytest in a virtual environment for each selected Python | ||
version. | ||
|
||
### Virtual environment issues | ||
|
||
This project uses PDM's PEP 582 support, meaning that it does not require using | ||
a virtual environment for development. | ||
|
||
````{warning} | ||
We recommend [deactivating Conda's `base` environment](https://stackoverflow.com/a/54560785/3645374) | ||
if you don't want to use a virtual environment and instead rely on PDM's PEP | ||
582 support. | ||
```` | ||
|
||
You may however use one if that suits you: in that case, you'll want to | ||
configure PDM so as to use the current virtual environment as | ||
[instructed in the PDM docs](https://pdm.fming.dev/usage/project/#working-with-a-virtualenv): | ||
Clone the repository: | ||
|
||
```bash | ||
pdm config --local use_venv true | ||
git clone [email protected]:rayference/dessinemoi.git | ||
``` | ||
|
||
### Using a Conda virtual environment | ||
|
||
Developing Dessine-moi using a Conda virtual environment is supported. | ||
To get started, initialise an empty Conda environment: | ||
Enter the created repository and set up the development environment: | ||
|
||
```bash | ||
conda create --name dessinemoi | ||
cd dessinemoi | ||
rye sync | ||
``` | ||
|
||
Then activate it and initialise it: | ||
Finally, activate the pre-commit hooks: | ||
|
||
```bash | ||
conda activate dessinemoi | ||
make conda-init | ||
``` | ||
|
||
```{note} | ||
Initialisation is possible only if a conda-lock file | ||
`requirements/conda-lock.yml` already exists. If not, you first have to generate | ||
it using conda-lock (see [Managing dependencies](managing_dependencies)). | ||
pre-commit install | ||
``` | ||
|
||
(managing_dependencies)= | ||
## Managing dependencies | ||
### Running tests | ||
|
||
Dependencies are managed using PDM. | ||
The [conda-lock](https://conda-incubator.github.io/conda-lock/) utility is also | ||
configured to help create reproducible Conda lock environments. For simplicity, | ||
dedicated Make targets lock PDM, Conda or both environments: | ||
The testing process of *Dessine-moi* uses [pytest](https://docs.pytest.org). A Make target is defined to | ||
help you run the tests: | ||
|
||
```bash | ||
make pdm-lock # lock PDM dependencies | ||
make conda-lock # lock Conda dependencies | ||
make lock # chains PDM and Conda locking | ||
make test | ||
``` | ||
|
||
This will run pytest for all relevant files (unit tests and doctests included | ||
in the documentation). | ||
|
||
## Building the documentation | ||
|
||
To build the documentation, use the dedicated Make target: | ||
|