Skip to content

Commit

Permalink
docs: update python contributing guide (#147)
Browse files Browse the repository at this point in the history
Adds details about blacken, updates version for system tests,
and shows how to pass through pytest arguments.

Source-Author: Chris Cotter <cjcotter@google.com>
Source-Date: Mon Feb 8 17:13:36 2021 -0500
Source-Repo: googleapis/synthtool
Source-Sha: 4679e7e415221f03ff2a71e3ffad75b9ec41d87e
Source-Link: googleapis/synthtool@4679e7e
  • Loading branch information
yoshi-automation authored Mar 23, 2021
1 parent 611b6dc commit 1d76b57
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
22 changes: 18 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
- To test your changes, run unit tests with ``nox``::

$ nox -s unit-2.7
$ nox -s unit-3.7
$ nox -s unit-3.8
$ ...

- Args to pytest can be passed through the nox command separated by a `--`. For
example, to run a single test::

$ nox -s unit-3.8 -- -k <name of test>

.. note::

The unit tests and system tests are described in the
Expand All @@ -93,8 +98,12 @@ On Debian/Ubuntu::
************
Coding Style
************
- We use the automatic code formatter ``black``. You can run it using
the nox session ``blacken``. This will eliminate many lint errors. Run via::

$ nox -s blacken

- PEP8 compliance, with exceptions defined in the linter configuration.
- PEP8 compliance is required, with exceptions defined in the linter configuration.
If you have ``nox`` installed, you can test that you have not introduced
any non-compliant code via::

Expand Down Expand Up @@ -133,13 +142,18 @@ Running System Tests

- To run system tests, you can execute::

$ nox -s system-3.7
# Run all system tests
$ nox -s system-3.8
$ nox -s system-2.7

# Run a single system test
$ nox -s system-3.8 -- -k <name of test>


.. note::

System tests are only configured to run under Python 2.7 and
Python 3.7. For expediency, we do not run them in older versions
Python 3.8. For expediency, we do not run them in older versions
of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down
4 changes: 2 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-api-core.git",
"sha": "94c76e0873e5b2f42331d5b1ad286c1e63b61395"
"sha": "7273090a011c8b840d2e90e29dda3fc8f0eed792"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "33366574ffb9e11737b3547eb6f020ecae0536e8"
"sha": "4679e7e415221f03ff2a71e3ffad75b9ec41d87e"
}
}
],
Expand Down

0 comments on commit 1d76b57

Please sign in to comment.