Skip to content

Commit

Permalink
Cleanup environment installation steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dcamron committed Jun 1, 2021
1 parent d332ebf commit 5122eba
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,18 @@ environments. Our recommended setup for contributing is:
``cd metpy``
* Connect your repository to the upstream (main project).
``git remote add unidata https://github.com/unidata/metpy.git``
* Create the development environment by running
``conda create -n devel -c conda-forge --file ci/requirements.txt --file ci/extra_requirements.txt
--file ci/test_requirements.txt``.
This will install all the necessary packages for development.
* Activate our new development environment by running ``conda activate devel``
* Make an editable install of MetPy by running ``pip install -e .``
* Create a new conda environment for us to configure, and give it a name with
``conda create -n devel``
* **IMPORTANT**: activate this new environment with ``conda activate devel``.
* Configure this environment so that we can reach
[conda-forge](https://conda-forge.org/feedstock-outputs/) for our packages with
``conda config --env --add channels conda-forge --add channels conda-forge/labels/testing``
* Install the necessary packages from conda-forge with
``conda install --file ci/requirements.txt --file ci/extra_requirements.txt --file ci/test_requirements.txt``.
* Finally, make an editable install of MetPy by running ``pip install -e .``

Note sections on [documentation](#documentation) and [code style](#code-style) below,
where you may need to install a few more packages into your new environment.

Now you're all set! You have an environment called ``devel`` that you can work in. You'll need
to make sure to activate that environment next time you want to use it after closing the
Expand Down Expand Up @@ -151,7 +157,9 @@ You can write examples in the documentation if they are simple concepts to demon
your feature is more complex, consider adding to the examples or tutorials for MetPy.

You can build the documentation locally to see how your changes will look.

After setting up your [development environment](#setting-up-your-development-environment) above,
use ``conda install --file ci/doc_requirements.txt`` to install required packages to build our documentation.
Then, from within your ``devel`` environment:
* Navigate to the docs folder ``cd docs``
* Remove any old builds and build the current docs ``make clean html``
* Open ``docs/build/html/index.html`` and see your changes!
Expand Down Expand Up @@ -262,9 +270,10 @@ While the authors are no fans of blind adherence to style and so-called project
that go through and correct code style, MetPy has adopted this style from the outset.
Therefore, it makes sense to enforce this style as code is added to keep everything clean and
uniform. To this end, part of the automated testing for MetPy checks style. To check style
locally within the source directory you can use the ``flake8`` tool. Running it
from the root of the source directory is as easy as running ``pytest --flake8`` in the base
of the repository.
locally within the source directory you can use the ``flake8`` tool.
After setting up your [development environment](#setting-up-your-development-environment) above,
install the code style tools we use with ``conda install --file ci/linting_requirements.txt``.
Checking your code style is then as easy as running ``pytest --flake8`` in the base of the repository.

You can also just submit your PR and the kind robots will comment on all style violations as
well. It can be a pain to make sure you have the right number of spaces around things, imports
Expand Down

0 comments on commit 5122eba

Please sign in to comment.