Skip to content

Commit 14beae2

Browse files
authored
docs: update contribution instructions (#1591)
* Updating contribution to include fork instructions * Fixing urls * Fix urls
1 parent ea6db5e commit 14beae2

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

doc/contributing.rst

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,27 @@ you frustration.
3333
Getting the code
3434
----------------
3535

36-
The coverage.py code is hosted on a GitHub repository at
37-
https://github.com/nedbat/coveragepy. To get a working environment, follow
38-
these steps:
36+
Fork the repo into your own github repository. If you have not forked a
37+
repository before then please follow the `fork instructions`_ provided by
38+
github.
39+
40+
.. _fork instructions: https://docs.github.com/en/get-started/quickstart/fork-a-repo
41+
42+
The coverage.py code will then be copied into a GitHub repository at
43+
https://github.com/GITHUB_USER/coveragepy where GITHUB_USER is your github
44+
username. To get a working development environment, follow these steps:
3945

4046
.. minimum of PYVERSIONS:
4147
42-
#. Create a Python 3.7 virtualenv to work in, and activate it.
48+
#. Create a virtualenv using one of the common virtualenv formats (conda,
49+
venv, pipenv, etc) and a version of python greater than 3.7 to work in, and
50+
activate it. Please follow your virtualenv format specific creation and
51+
activation instructions.
52+
4353

4454
#. Clone the repository::
4555

46-
$ git clone https://github.com/nedbat/coveragepy
56+
$ git clone https://github.com/GITHUB_USER/coveragepy
4757
$ cd coveragepy
4858

4959
#. Install the requirements::
@@ -54,20 +64,23 @@ these steps:
5464
``dev.in`` instead::
5565

5666
$ python3 -m pip install -r requirements/dev.in
67+
68+
Note: You may need to upgrade pip to install the requirements.
5769

58-
#. Install a number of versions of Python. Coverage.py supports a range
59-
of Python versions. The more you can test with, the more easily your code
60-
can be used as-is. If you only have one version, that's OK too, but may
61-
mean more work integrating your contribution.
70+
#. (Optional) Install more versions of Python. By default, Coverage.py won't
71+
run the tests on a version of python that isn't installed. Coverage.py
72+
supports a range of Python versions. The more you can test with, the more
73+
easily your code can be used as-is. If you only have one version, that's
74+
OK too, but may mean more work integrating your contribution.
6275

6376

6477
Running the tests
6578
-----------------
6679

6780
The tests are written mostly as standard unittest-style tests, and are run with
68-
pytest running under `tox`_::
81+
pytest running under `tox`_ by using the command `python3 -m tox`::
6982

70-
% tox
83+
% python3 -m tox
7184
ROOT: tox-gh won't override envlist because tox is not running in GitHub Actions
7285
.pkg: _optional_hooks> python /usr/local/virtualenvs/coverage/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
7386
.pkg: get_requires_for_build_editable> python /usr/local/virtualenvs/coverage/lib/python3.7/site-packages/pyproject_api/_backend.py True setuptools.build_meta
@@ -113,21 +126,21 @@ the second uses the Python implementation.
113126

114127
To limit tox to just a few versions of Python, use the ``-e`` switch::
115128

116-
$ tox -e py37,py39
129+
$ python3 -m tox -e py37,py39
117130

118131
On the tox command line, options after ``--`` are passed to pytest. To run
119132
just a few tests, you can use `pytest test selectors`_::
120133

121-
$ tox -- tests/test_misc.py
122-
$ tox -- tests/test_misc.py::HasherTest
123-
$ tox -- tests/test_misc.py::HasherTest::test_string_hashing
134+
$ python3 -m tox -- tests/test_misc.py
135+
$ python3 -m tox -- tests/test_misc.py::HasherTest
136+
$ python3 -m tox -- tests/test_misc.py::HasherTest::test_string_hashing
124137

125138
These commands run the tests in one file, one class, and just one test,
126139
respectively. The pytest ``-k`` option selects tests based on a word in their
127140
name, which can be very convenient for ad-hoc test selection. Of course you
128141
can combine tox and pytest options::
129142

130-
$ tox -q -e py37 -- -n 0 -vv -k hash
143+
$ python3 -m tox -q -e py37 -- -n 0 -vv -k hash
131144
=== CPython 3.7.15 with C tracer (.tox/py37/bin/python) ===
132145
======================================= test session starts ========================================
133146
platform darwin -- Python 3.7.15, pytest-7.2.2, pluggy-1.0.0 -- /Users/nedbat/coverage/.tox/py37/bin/python

0 commit comments

Comments
 (0)