-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List key development dependencies to install for new contributors #1783
Changes from 3 commits
0eb529b
26fa507
ab8ac74
1fc43ec
c2ae7dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Building the documentation needs more packages (like sphinx) than listed here. |
||
|
||
- 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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,22 +13,25 @@ dependencies: | |
- packaging | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 7: can we remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could, but then people might get a warning that says: "Warning : you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies...". See https://stackoverflow.com/questions/58544099/warning-after-i-run-the-command-conda-env-create-f-environment-yml. Edit: Oh wait, actually that warning won't show up since we don't list pip dependencies, but I think listing it explicitly doesn't really hurt? |
||
# 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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I feel this sentence is very clear that all dependencies are listed in the environment.yml and people who want to build and test should read the environment.yml file, rather than listing an incompleted list here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A compromise could be to add more sections (via comments) to
environment.yml
that specify which development dependencies are required for building the docs, running the tests, and/or formatting the code (inspiration from numpy and pandas environment files).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that sounds like a good idea actually.
So do we not want to list some of the dev dependencies here in contributing.md? I know it seems redundant, but there are some people who might be from a non-Anaconda/pure-Python-pip sort of world that don't really use that environment.yml file. Listing things like git/dvc/pytest/sphinx here up front will at least give people an idea on what framework PyGMT uses for testing and building documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree.
Fair point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok,
environment.yml
has been reorganized into subsections (general, linters, testing, documentation) in ab8ac74.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this paragraph also include a short sentence on how to install dependencies with a .yml file? Since it's different than the typical
pip install -r requirements.txt
, it would cut down on confusion of how to useenvironment.yml
to install dependencies.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. There's actually a
conda env create
instruction just a few sentences below. I've just added a commit (c2ae7dd) to make it more explicit (conda env create --file environment.yml
).