Skip to content

Commit 59e8b1f

Browse files
chore: add constraints file check for python samples (#137)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore: add constraints file check for python samples This is the sibling PR to GoogleCloudPlatform/python-docs-samples#5611 and this is the issue opened for it GoogleCloudPlatform/python-docs-samples#5549 If you look at the files in [this example repo](https://github.com/leahecole/testrepo-githubapp/pull/31/files), you'll see that renovate successfully opened a PR on three constraints files in `samples` directories and subdirectories, and properly ignored `constraints` files at the root level cc @tswast TODO: - [x] update renovate to check for samples/constraints.txt dependency updates - [x] run lint locally to double check that I'm not introducing lint error Source-Author: Leah E. Cole <[email protected]> Source-Date: Fri Apr 9 22:50:04 2021 -0700 Source-Repo: googleapis/synthtool Source-Sha: 0a071b3460344886297a304253bf924aa68ddb7e Source-Link: googleapis/synthtool@0a071b3
1 parent 76c056e commit 59e8b1f

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

packages/google-cloud-datacatalog/.github/header-checker-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{"allowedCopyrightHolders": ["Google LLC"],
22
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
3-
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
3+
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
44
"sourceFileExtensions": [
55
"ts",
66
"js",

packages/google-cloud-datacatalog/google/cloud/datacatalog_v1beta1/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
"CreateTagTemplateFieldRequest",
104104
"CreateTagTemplateRequest",
105105
"CreateTaxonomyRequest",
106+
"DataCatalogClient",
106107
"DeleteEntryGroupRequest",
107108
"DeleteEntryRequest",
108109
"DeletePolicyTagRequest",
@@ -140,7 +141,6 @@
140141
"LookupEntryRequest",
141142
"PolicyTag",
142143
"PolicyTagManagerClient",
143-
"PolicyTagManagerSerializationClient",
144144
"RenameTagTemplateFieldRequest",
145145
"Schema",
146146
"SearchCatalogRequest",
@@ -165,5 +165,5 @@
165165
"UpdateTagTemplateRequest",
166166
"UpdateTaxonomyRequest",
167167
"ViewSpec",
168-
"DataCatalogClient",
168+
"PolicyTagManagerSerializationClient",
169169
)

packages/google-cloud-datacatalog/renovate.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"extends": [
33
"config:base", ":preserveSemverRanges"
44
],
5-
"ignorePaths": [".pre-commit-config.yaml"]
5+
"ignorePaths": [".pre-commit-config.yaml"],
6+
"pip_requirements": {
7+
"fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"]
8+
}
69
}

packages/google-cloud-datacatalog/samples/snippets/noxfile.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,16 @@ def blacken(session: nox.sessions.Session) -> None:
172172
def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None:
173173
"""Runs py.test for a particular project."""
174174
if os.path.exists("requirements.txt"):
175-
session.install("-r", "requirements.txt")
175+
if os.path.exists("constraints.txt"):
176+
session.install("-r", "requirements.txt", "-c", "constraints.txt")
177+
else:
178+
session.install("-r", "requirements.txt")
176179

177180
if os.path.exists("requirements-test.txt"):
178-
session.install("-r", "requirements-test.txt")
181+
if os.path.exists("constraints-test.txt"):
182+
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
183+
else:
184+
session.install("-r", "requirements-test.txt")
179185

180186
if INSTALL_LIBRARY_FROM_SOURCE:
181187
session.install("-e", _get_repo_root())

packages/google-cloud-datacatalog/synth.metadata

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-datacatalog.git",
7-
"sha": "b2fb4858966809914c915e11435d29e0fa4442e8"
7+
"sha": "875c645ebfc01d1c25819a89486cec197d08c563"
88
}
99
},
1010
{
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "5b5bf6d519b2d658d9f2e483d9f6f3d0ba8ee6bc"
22+
"sha": "0a071b3460344886297a304253bf924aa68ddb7e"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "5b5bf6d519b2d658d9f2e483d9f6f3d0ba8ee6bc"
29+
"sha": "0a071b3460344886297a304253bf924aa68ddb7e"
3030
}
3131
}
3232
],

0 commit comments

Comments
 (0)