feat: add templates for python samples projects#506
Conversation
kurtisvg
left a comment
There was a problem hiding this comment.
For new samples, what are the steps for generating a new noxfile? Is there a way for users to manually generate it to ensure they get an updated version?
Just a comment that whatever we decide the steps are for new samples, they need to be added to the authoring guide and somehow communicated outward to our lovely contributors |
|
Will we need to add a .yml to every subdirectory? or only the ones whose noxfiles are different than the generic one? |
| str(p.relative_to(SAMPLES_TEMPLATE_PATH)) | ||
| for p in SAMPLES_TEMPLATE_PATH.glob("*.rst") | ||
| ] | ||
| t = templates.TemplateGroup(SAMPLES_TEMPLATE_PATH, excludes=excludes) |
There was a problem hiding this comment.
@SurferJeffAtGoogle Is it alright to use templates directly or will it break something related to the synth metadata tracking?
|
@leahecole Every single one, but I tweaked the logic so that synthtool will add a default On an unrelated note this ended up being more code than I expected so I will add some tests. |
These templates will be used for templates in python-docs-samples and in Python client libraries. The README generation code is a modified version of https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/scripts/readme-gen.
Co-Authored-By: Kurtis Van Gent <[email protected]>
2e15eb3 to
35e67bb
Compare
…l into py-samples-templates
These templates will be used for templates in python-docs-samples
and in Python client libraries.
The README generation code is a modified
version of https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/scripts/readme-gen.
To finish setup for a new set of samples in
foo/:client libraries: Go to the root of the repository, edit the synth.py, and run
synthtool.python-docs-samples: Copy
synth.pyfrom the root of the repo and run synthtool.$ cp synth.py foo/synth.py $ cd foo $ synthtool(You can also run synthtool from the root of the repository, but it will attempt to regenerate all the noxfiles and readmes.)