Skip to content
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

Update contributor docs #1110

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,31 @@ Ready to contribute? Here's how to set up :ref:`specutils <specutils>` for local

$ git clone git@github.com:your_name_here/specutils.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
3. Install your local copy, preferably into some sort of virtual environment using your
preferred environment manager. For example, using conda::

$ mkvirtualenv specutils
$ conda create --name specutils-dev python pip
$ conda activate specutils-dev
$ cd specutils/
$ python setup.py develop
$ pip install -e .[test]
kelle marked this conversation as resolved.
Show resolved Hide resolved

4. Create a branch for local development::

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
5. When you're done making changes, check that your changes pass flake8 and the tests::

$ tox -e codestyle
$ pytest
kelle marked this conversation as resolved.
Show resolved Hide resolved

The tests will run on other Python versions automatically on opening a pull request,
but if you want to attempt to run the full test suite locally before doing so you can
run ``tox``::

$ flake8 specutils tests
$ python setup.py test or py.test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::

Expand All @@ -101,14 +107,20 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 3.4, 3.5, and 3.6, and for PyPy. Check
https://travis-ci.org/astropy/specutils/pull_requests
and make sure that the tests pass for all supported Python versions.
3. The pull request should work for Python 3.9 - 3.11, and for PyPy. Check
that all required tests passed in the Github Actions CI section at the
bottom of your pull request.

Tips
----

To run a subset of tests::
To run a subset of the tests, you can call ``pytest`` with a specific file
provided as input. For example. from the base directory of a cloned
``specutils`` repository, you could run::

$ pytest specutils/tests/test_regions.py

$ py.test tests.test_specutils
You can also run a specific test defined within a file using the ``-k`` flag,
for example::

$ pytest specutils/tests/test_regions.py -k test_invert
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ install_requires =
test =
pytest-astropy
pytest-cov
tox
matplotlib
graphviz
coverage
Expand Down
Loading