Skip to content

blacken samples using templated noxfile #765

@tswast

Description

@tswast

This repository has three historical samples locations (see #790 for the issue to migrate them all to the most recent layout, supported by templates), but this issue only refers to the samples in (3). The samples in (1, 2) should remain blackened by the existing mechanism:

  1. docs/snippets.py
  2. samples/*.py + samples/tests/*.py
  3. samples/snippets/*.py, samples/geography/*.py, samples/magics/*.py, and possibly more in the future, see: Clean-up samples/snippets/requirements.txt #1352.

For this issue, I anticipate the following updates:

  1. Update the blacken session in noxfile.py to only blacken the samples in legacy directories. That is
    BLACK_PATHS = ("docs", "google", "samples", "tests", "noxfile.py", "setup.py")
    should be updated to BLACK_PATHS = ("docs", "google", "samples/*.py", "samples/tests/*.py", "tests", "noxfile.py", "setup.py") or similar.
  2. Update owlbot config to make sure the code samples in samples/snippets|geography|etc stay blackened. We still want to run nox -s blacken in the root directory but then we also want to run nox -s blacken in each samples directory that has a noxfile.py. See the implementation in python-bigquery-datatransfer for reference: https://github.com/googleapis/python-bigquery-datatransfer/blob/822223fc02b1e2ff6f52b834c51f4bf46924e2e8/owlbot.py#L60-L61

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.samplesIssues that are directly related to samples.type: processA process-related concern. May include testing, release, or the like.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions