Skip to content

Commit

Permalink
feat: add Samples section to CONTRIBUTING.rst (#1159)
Browse files Browse the repository at this point in the history
Adding a section about samples in CONTRIBUTING.rst if Python
libraries template.

Co-authored-by: Tres Seaver <tseaver@palladion.com>
  • Loading branch information
m-strzelczyk and tseaver committed Jul 20, 2021
1 parent 4124d24 commit 52e4e46
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions synthtool/gcp/templates/python_library/CONTRIBUTING.rst
Expand Up @@ -187,6 +187,30 @@ Build the docs via:

$ nox -s docs

*************************
Samples and code snippets
*************************

Code samples and snippets live in the `samples/` catalogue. Feel free to
provide more examples, but make sure to write tests for those examples.
Each folder containing example code requires its own `noxfile.py` script
which automates testing. If you decide to create a new folder, you can
base it on the `samples/snippets` folder (providing `noxfile.py` and
the requirements files).

The tests will run against a real Google Cloud Project, so you should
configure them just like the System Tests.

- To run sample tests, you can execute::

# Run all tests in a folder
$ cd samples/snippets
$ nox -s py-3.8

# Run a single sample test
$ cd samples/snippets
$ nox -s py-3.8 -- -k <name of test>

********************************************
Note About ``README`` as it pertains to PyPI
********************************************
Expand Down

0 comments on commit 52e4e46

Please sign in to comment.