Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit 6dcbc56

Browse files
feat: add Samples section to CONTRIBUTING.rst (#4)
Source-Link: googleapis/synthtool@52e4e46 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:6186535cbdbf6b9fe61f00294929221d060634dae4a0795c1cefdbc995b2d605
1 parent 8baf5c3 commit 6dcbc56

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Copyright 2021 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
docker:
162
image: gcr.io/repo-automation-bots/owlbot-python:latest
17-
digest: sha256:5ff7446edeaede81c3ed58b23a4e76a5403fba1350ce28478045657303b6479d
3+
digest: sha256:6186535cbdbf6b9fe61f00294929221d060634dae4a0795c1cefdbc995b2d605

CONTRIBUTING.rst

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

178178
$ nox -s docs
179179

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

0 commit comments

Comments
 (0)