Skip to content

Commit

Permalink
chore: add constraints file check for python samples (#176)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/b7a528df-1b0b-42e0-a583-e53b45ee05fc/targets

- [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.)

Source-Link: googleapis/synthtool@0a071b3
  • Loading branch information
yoshi-automation committed Apr 13, 2021
1 parent f5f999b commit 1503f57
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/header-checker-lint.yml
@@ -1,6 +1,6 @@
{"allowedCopyrightHolders": ["Google LLC"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
Expand Down
5 changes: 4 additions & 1 deletion renovate.json
Expand Up @@ -2,5 +2,8 @@
"extends": [
"config:base", ":preserveSemverRanges"
],
"ignorePaths": [".pre-commit-config.yaml"]
"ignorePaths": [".pre-commit-config.yaml"],
"pip_requirements": {
"fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"]
}
}
10 changes: 8 additions & 2 deletions samples/quickstart/noxfile.py
Expand Up @@ -174,10 +174,16 @@ def _session_tests(
) -> None:
"""Runs py.test for a particular project."""
if os.path.exists("requirements.txt"):
session.install("-r", "requirements.txt")
if os.path.exists("constraints.txt"):
session.install("-r", "requirements.txt", "-c", "constraints.txt")
else:
session.install("-r", "requirements.txt")

if os.path.exists("requirements-test.txt"):
session.install("-r", "requirements-test.txt")
if os.path.exists("constraints-test.txt"):
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
else:
session.install("-r", "requirements-test.txt")

if INSTALL_LIBRARY_FROM_SOURCE:
session.install("-e", _get_repo_root())
Expand Down
10 changes: 8 additions & 2 deletions samples/to_dataframe/noxfile.py
Expand Up @@ -174,10 +174,16 @@ def _session_tests(
) -> None:
"""Runs py.test for a particular project."""
if os.path.exists("requirements.txt"):
session.install("-r", "requirements.txt")
if os.path.exists("constraints.txt"):
session.install("-r", "requirements.txt", "-c", "constraints.txt")
else:
session.install("-r", "requirements.txt")

if os.path.exists("requirements-test.txt"):
session.install("-r", "requirements-test.txt")
if os.path.exists("constraints-test.txt"):
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
else:
session.install("-r", "requirements-test.txt")

if INSTALL_LIBRARY_FROM_SOURCE:
session.install("-e", _get_repo_root())
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-bigquery-storage.git",
"sha": "4a714f77542e8f6b7118fdd1d032ebee45c4f911"
"sha": "f5f999b779e85483d8dcb66885004b2ce0469464"
}
},
{
Expand All @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "5b5bf6d519b2d658d9f2e483d9f6f3d0ba8ee6bc"
"sha": "0a071b3460344886297a304253bf924aa68ddb7e"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "5b5bf6d519b2d658d9f2e483d9f6f3d0ba8ee6bc"
"sha": "0a071b3460344886297a304253bf924aa68ddb7e"
}
}
],
Expand Down

0 comments on commit 1503f57

Please sign in to comment.