Skip to content

Commit

Permalink
add conda stuff to docs (#336)
Browse files Browse the repository at this point in the history
* add conda stuff to docs

* add conda stuff to docs

* add flake8 to dev build

* split out runtime deps from development deps in example

* remove make lint from instructions (already run in make test)

* link to apple silicon tips

* update conda install instructions

add test dependencies to conda env initialization following @aarchiba's suggestion

---------

Co-authored-by: Rutger van Haasteren <3092444+vhaasteren@users.noreply.github.com>
  • Loading branch information
paulthebaker and vhaasteren authored Nov 15, 2023
1 parent a4dd7b6 commit 33fc82b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 11 deletions.
55 changes: 44 additions & 11 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,38 @@ If you are proposing a feature:
Get Started!
------------

Ready to contribute? Here's how to set up `enterprise` for local development.
Ready to contribute? Here's how to set up ``enterprise`` for local development.

1. Fork the `enterprise` repo on GitHub.
Install the dependencies
~~~~~~~~~~~~~~~~~~~~~~~~

``enterprise`` relies on a lot of other software to function.
If you use the Anaconda distribution of Python, you can get all of this software using ``conda``.
First, you install the latest stable version of ``enterprise``, which will come with all of the dependencies.
Then you remove ``enterprise`` leaving everything else intact.
This way you can use your development version of ``enterprise`` instead of the stable version.
We will also need some additional software that is required to run the tests.

Start with a virtual environment with the extra dependencies required for running tests. In this case it is called ``ent_dev``::

$ conda create -n ent_dev -y -c conda-forge python=3.9 black=22.3.0 flake8 sphinx_rtd_theme pytest-cov
$ conda activate ent_dev

Now install everything else by running the commands::

$ conda install -c conda-forge enterprise-pulsar
$ conda remove enterprise-pulsar --force
$ pip install coverage-conditional-plugin


Get the enterprise source code and get to work!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. Fork the ``enterprise`` repo on GitHub.
2. Clone your fork locally::

$ git clone git@github.com:your_name_here/enterprise.git
$ cd enterprise/
3. Set `enterprise/master` as upstream remote::
Expand All @@ -73,17 +99,25 @@ Ready to contribute? Here's how to set up `enterprise` for local development.
$ git pull upstream master

4. This is how you set up your fork for local development:

.. note::
You will need to have ``tempo`` and ``suitesparse`` installed before
running the commands below.
You will need to have ``tempo2`` and ``suitesparse`` installed before
running these commands.

::
If you installed the dependencies via conda, you are good to go!

$ cd enterprise/
If you set up a ``conda`` virtual environment with the dependencies already,
you can add your local fork of ``enterprise`` to it by running::

$ pip install -e .

If you manually installed the dependencies, this will make and activate a
Python3 virtual env with your local fork of ``enterprise``::
$ make init
$ source .enterprise/bin/activate


5. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature
Expand All @@ -93,7 +127,6 @@ Ready to contribute? Here's how to set up `enterprise` for local development.
6. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox (tox not implemented yet). Also check that any new docs are formatted correctly::

$ make test
$ make lint
$ make docs

To get flake8 and tox, just pip install them into your virtualenv.
Expand All @@ -114,9 +147,8 @@ Before you submit a pull request, check that it meets these guidelines:
1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring.
3. The pull request should work for Python 3.8, 3.9, 3.10, and 3.11. Check
https://github.com/nanograv/enterprise/pulls
and make sure that the tests pass for all supported Python versions.
3. The pull request should work for all supported versions of Python: 3.8, 3.9, 3.10, and 3.11. You
can see the progress of the tests in the `Checks` tab of your GitHub pull request.

Tips
----
Expand All @@ -130,3 +162,4 @@ To track and checkout another user's branch::
$ git remote add other-user-username https://github.com/other-user-username/enterprise.git
$ git fetch other-user-username
$ git checkout --track -b branch-name other-user-username/branch-name

19 changes: 19 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ Installation
.. .. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
Using conda
-----------

``enterprise`` is available via conda-forge as `enterprise-pulsar <https://anaconda.org/conda-forge/enterprise-pulsar>`_.
If you use the Anaconda distribution of Python, we strongly recommend installing via the ``conda`` command:

.. code-block:: console
$ conda install -c conda-forge enterprise-pulsar
From sources
------------

Expand Down Expand Up @@ -57,3 +68,11 @@ If you want to run tests or do any other development then also run:
.. _Github repo: https://github.com/nanograv/enterprise
.. _tarball: https://github.com/nanograv/enterprise/tarball/master


Tips
----

If you have a computer with an Apple Silicon chip, see `these instructions`_ on how to install Apple Intel packages using Rosetta.

.. _these instructions: https://conda-forge.org/docs/user/tipsandtricks.html#installing-apple-intel-packages-on-apple-silicon

0 comments on commit 33fc82b

Please sign in to comment.