8000 Ask contributors to put library samples in library repository (#4298) · lak2142/python-docs-samples@a07d116 · GitHub
[go: up one dir, main page]

Skip to content

Commit a07d116

Browse files
authored
Ask contributors to put library samples in library repository (GoogleCloudPlatform#4298)
1 parent 6bcf974 commit a07d116

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

AUTHORING_GUIDE.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ This section covers guidelines for Python samples. Note that
2222

2323
### Folder Location
2424

25-
Each sample should be in a folder under the top-level folder of
25+
Samples that primarily show the use of one client library should be placed in the
26+
client library repository. Other samples should be placed in this repository
27+
`python-docs-samples`.
28+
29+
**Library repositories:** Each sample should be in the top-level samples folder `samples`
30+
in the client library repository. See the [Text-to-Speech samples](https://github.com/googleapis/python-texttospeech/tree/master/samples)
31+
for an example.
32+
33+
**python-docs-samples:** Each sample should be in a folder under the top-level folder of
2634
[python-docs-samples](https://github.com/GoogleCloudPlatform/python-docs-samples)
2735
that corresponds to the Google Cloud service or API used by the sample.
2836
For example, a sample demonstrating how to work with BigTable should be
@@ -472,15 +480,22 @@ Please read the [MAC Setup Guide](https://github.com/GoogleCloudPlatform/python-
472480
473481
### Running tests with nox
474482
475-
Automated testing for samples in `python-docs-samples` is managed by
483+
Automated testing for samples is managed by
476484
[nox](https://nox.readthedocs.io). Nox allows us to run a variety of tests,
477485
including the flake8 linter, Python 2.7, Python 3.x, and App Engine tests,
478486
as well as automated README generation.
479487
480-
__Note:__ As a temporary workaround, each project currently uses first
488+
__Note:__
489+
490+
**Library repositories:** If you are working on an existing project, a `noxfile.py` will already exist.
491+
For new samples, create a new `noxfile.py` and paste the contents of
492+
[noxfile-template.py](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/noxfile-template.py)
493+
494+
**python-docs-samples:** As a temporary workaround, each project currently uses first
481495
`noxfile-template.py` found in a parent folder above the current sample. In
482496
order to simulate this locally, you need to copy + rename the parent
483-
`noxfile-template.py` as `noxfile.py` in the folder of the project (containing the `requirements.txt` for the file) you want to
497+
`noxfile-template.py` as `noxfile.py` in the folder of the project (containing the `requirements.txt` for the file).
498+
484499
```console
485500
cd python-docs-samples
486501
cp noxfile-template.py PATH/TO/YOUR/PROJECT/noxfile.py
@@ -516,6 +531,8 @@ nox -s py-3.7 -- snippets_test.py:test_list_blobs
516531
517532
### Running tests with Docker
518533
534+
__Note__: This is currently only available for samples in `python-docs-samples`.
535+
519536
If you have [Docker](https://www.docker.com) installed and runnable by
520537
the local user, you can use `scripts/run_tests_local.sh` helper script
521538
to run the tests. For example, let's say you want to modify the code

0 commit comments

Comments
 (0)
0