Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blacken samples using templated noxfile #765

Closed
tswast opened this issue Jul 14, 2021 · 2 comments · Fixed by #1367
Closed

blacken samples using templated noxfile #765

tswast opened this issue Jul 14, 2021 · 2 comments · Fixed by #1367
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. samples Issues that are directly related to samples. type: process A process-related concern. May include testing, release, or the like.

Comments

@tswast
Copy link
Contributor

tswast commented Jul 14, 2021

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
@product-auto-label product-auto-label bot added api: bigquery Issues related to the googleapis/python-bigquery API. samples Issues that are directly related to samples. labels Jul 14, 2021
@tswast tswast added type: process A process-related concern. May include testing, release, or the like. and removed api: bigquery Issues related to the googleapis/python-bigquery API. samples Issues that are directly related to samples. labels Jul 14, 2021
@tswast tswast self-assigned this Jul 14, 2021
@tswast tswast mentioned this issue Jul 14, 2021
4 tasks
@product-auto-label product-auto-label bot added api: bigquery Issues related to the googleapis/python-bigquery API. samples Issues that are directly related to samples. labels Jul 15, 2021
@tswast
Copy link
Contributor Author

tswast commented Jul 21, 2021

Turns out these are already blackened, but they aren't using the blacken session from the templated noxfile.

@tswast tswast changed the title blacken samples blacken samples using templated noxfile Jul 21, 2021
@tswast
Copy link
Contributor Author

tswast commented Jul 21, 2021

Unblocked by #785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. samples Issues that are directly related to samples. type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
2 participants