Skip to content

Commit 52e4e46

Browse files
feat: add Samples section to CONTRIBUTING.rst (#1159)
Adding a section about samples in CONTRIBUTING.rst if Python libraries template. Co-authored-by: Tres Seaver <tseaver@palladion.com>
1 parent 4124d24 commit 52e4e46

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

synthtool/gcp/templates/python_library/CONTRIBUTING.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,30 @@ Build the docs via:
187187

188188
$ nox -s docs
189189

190+
*************************
191+
Samples and code snippets
192+
*************************
193+
194+
Code samples and snippets live in the `samples/` catalogue. Feel free to
195+
provide more examples, but make sure to write tests for those examples.
196+
Each folder containing example code requires its own `noxfile.py` script
197+
which automates testing. If you decide to create a new folder, you can
198+
base it on the `samples/snippets` folder (providing `noxfile.py` and
199+
the requirements files).
200+
201+
The tests will run against a real Google Cloud Project, so you should
202+
configure them just like the System Tests.
203+
204+
- To run sample tests, you can execute::
205+
206+
# Run all tests in a folder
207+
$ cd samples/snippets
208+
$ nox -s py-3.8
209+
210+
# Run a single sample test
211+
$ cd samples/snippets
212+
$ nox -s py-3.8 -- -k <name of test>
213+
190214
********************************************
191215
Note About ``README`` as it pertains to PyPI
192216
********************************************

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy