From 0eb529bba66e321e73383a604de74de9c611e254 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Thu, 3 Mar 2022 23:35:58 -0500 Subject: [PATCH 1/3] List some of the key dev dependencies for developing pygmt locally Namely git and dvc for code and data version control, pytest-mpl for testing baseline images, and sphinx-gallery for building the gallery example page. --- doc/contributing.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/contributing.md b/doc/contributing.md index 1b1f845958b..bf23e4b60bb 100644 --- a/doc/contributing.md +++ b/doc/contributing.md @@ -192,8 +192,16 @@ It will make your life a lot easier! The repository includes a conda environment file `environment.yml` with the specification for all development requirements to build and test the project. +In particular, these are some of the key development dependencies you will need +to install to build the documentation and run the unit tests locally: + +- git (for cloning the repo and tracking changes in code) +- dvc (for downloading baseline images used in tests) +- pytest-mpl (for checking that generated plots match the baseline) +- sphinx-gallery (for building the gallery example page) + See the [`environment.yml`](https://github.com/GenericMappingTools/pygmt/blob/main/environment.yml) -file for the list of dependencies and the environment name (`pygmt`). +file for the full list of dependencies and the environment name (`pygmt`). Once you have forked and cloned the repository to your local machine, you can use this file to create an isolated environment on which you can work. Run the following on the base of the repository to create a new conda @@ -210,7 +218,6 @@ Before building and testing the project, you have to activate the environment conda activate pygmt ``` - We have a [`Makefile`](https://github.com/GenericMappingTools/pygmt/blob/main/Makefile) that provides commands for installing, running the tests and coverage analysis, running linters, etc. If you don't want to use `make`, open the `Makefile` and From ab8ac74178d077cdcb80e86a26d95bd273373267 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Sun, 6 Mar 2022 10:21:30 -0500 Subject: [PATCH 2/3] Reorganize development dependencies in environment.yml into subsections Including subsections for general development dependencies, style checks, unit testing, and building documentation. --- environment.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/environment.yml b/environment.yml index 3fb89717c7f..ae160a97a7c 100644 --- a/environment.yml +++ b/environment.yml @@ -13,22 +13,25 @@ dependencies: - packaging # Optional dependencies - geopandas - # Development dependencies + # Development dependencies (general) + - dvc + - ipython + - jupyter + - make + # Dev dependencies (style checks) - black - blackdoc - docformatter - - dvc - flake8 - - ipython - isort>=5 - - jupyter - - make - - matplotlib - - myst-parser - pylint + # Dev dependencies (unit testing) + - matplotlib - pytest-cov - pytest-mpl - pytest>=6.0 + # Dev dependencies (building documentation) + - myst-parser - sphinx - sphinx-copybutton - sphinx-gallery From c2ae7dd44d2efa48f34873348cca73920761e14b Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Sun, 6 Mar 2022 20:08:06 -0500 Subject: [PATCH 3/3] Explicitly use conda env create --file environment.yml --- doc/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/contributing.md b/doc/contributing.md index 4d7c0a4cc04..6fe55a909fd 100644 --- a/doc/contributing.md +++ b/doc/contributing.md @@ -208,7 +208,7 @@ Run the following on the base of the repository to create a new conda environment from the `environment.yml` file: ```bash -conda env create +conda env create --file environment.yml ``` Before building and testing the project, you have to activate the environment