Skip to content

Commit

Permalink
docs/dev-install.md
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jun 14, 2024
1 parent d2414ed commit 9696408
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
29 changes: 29 additions & 0 deletions docs/dev-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Setup a development environment

Once [PDM] and [Nox] are installed, it is very easy to setup a development environment for
PyLandStats. On most systems, one can install PDM and Nox with [Pipx], with something like:

```sh
python3 -m pip install pipx
python3 -m pipx ensurepath
```

and then in a new terminal:

```sh
pipx install pdm
pipx install nox
```

Once PDM is installed, clone the PyLandStats repo and run `make` from the root
directory. This should install a dedicated local virtual environment `.venv`.
You can then activate it and run the tests.

Note that there are few other targets in the `Makefile` useful for developers. In
particular, it is good to periodically recompute the dependencies written in
the `pdm.lock` file (with `make lock`) to check if new packages uploaded on PyPI
do not break PyLandStats. It is reasonable to do this in a dedicated PR.

[nox]: https://nox.thea.codes
[pdm]: https://pdm-project.org
[pipx]: https://github.com/pypa/pipx
4 changes: 3 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Open-source library to compute landscape metrics in the Python ecosystem (NumPy,
:maxdepth: 1
:caption: Development:

dev-install
changelog
contributing

Expand All @@ -41,14 +42,15 @@ which will install PyLandStats and all of its dependencies. Alternatively, you c

$ pip install pylandstats


Nevertheless, note that the `BufferAnalysis` and `SpatioTemporalBufferAnalysis` classes make use of `geopandas <https://github.com/geopandas/geopandas>`_, which cannot be installed with pip. If you already have `the dependencies for geopandas <https://geopandas.readthedocs.io/en/latest/install.html#dependencies>`_ installed in your system, you might then install PyLandStats with the `geo` extras as in:

$ pip install pylandstats[geo]

and you will be able to use the `BufferAnalysis` and `SpatioTemporalBufferAnalysis` classes (without having to use conda).




Indices and tables
==================
* :ref:`genindex`
Expand Down

0 comments on commit 9696408

Please sign in to comment.