Skip to content

Commit c45211d

Browse files
build: switch to release-please for tagging (#488)
1 parent 6226fa0 commit c45211d

14 files changed

Lines changed: 432 additions & 342 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
docker:
22
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
3-
digest: sha256:2f90537dd7df70f6b663cd654b1fa5dee483cf6a4edcfd46072b2775be8a23ec
3+
digest: sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
releaseType: python
2+
handleGHRelease: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enabled: true

packages/google-cloud-bigtable/samples/beam/noxfile.py

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from __future__ import print_function
1616

17+
import glob
1718
import os
1819
from pathlib import Path
1920
import sys
@@ -182,37 +183,44 @@ def blacken(session: nox.sessions.Session) -> None:
182183
def _session_tests(
183184
session: nox.sessions.Session, post_install: Callable = None
184185
) -> None:
185-
if TEST_CONFIG["pip_version_override"]:
186-
pip_version = TEST_CONFIG["pip_version_override"]
187-
session.install(f"pip=={pip_version}")
188-
"""Runs py.test for a particular project."""
189-
if os.path.exists("requirements.txt"):
190-
if os.path.exists("constraints.txt"):
191-
session.install("-r", "requirements.txt", "-c", "constraints.txt")
192-
else:
193-
session.install("-r", "requirements.txt")
194-
195-
if os.path.exists("requirements-test.txt"):
196-
if os.path.exists("constraints-test.txt"):
197-
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
198-
else:
199-
session.install("-r", "requirements-test.txt")
200-
201-
if INSTALL_LIBRARY_FROM_SOURCE:
202-
session.install("-e", _get_repo_root())
203-
204-
if post_install:
205-
post_install(session)
206-
207-
session.run(
208-
"pytest",
209-
*(PYTEST_COMMON_ARGS + session.posargs),
210-
# Pytest will return 5 when no tests are collected. This can happen
211-
# on travis where slow and flaky tests are excluded.
212-
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
213-
success_codes=[0, 5],
214-
env=get_pytest_env_vars(),
215-
)
186+
# check for presence of tests
187+
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
188+
if len(test_list) == 0:
189+
print("No tests found, skipping directory.")
190+
else:
191+
if TEST_CONFIG["pip_version_override"]:
192+
pip_version = TEST_CONFIG["pip_version_override"]
193+
session.install(f"pip=={pip_version}")
194+
"""Runs py.test for a particular project."""
195+
if os.path.exists("requirements.txt"):
196+
if os.path.exists("constraints.txt"):
197+
session.install("-r", "requirements.txt", "-c", "constraints.txt")
198+
else:
199+
session.install("-r", "requirements.txt")
200+
201+
if os.path.exists("requirements-test.txt"):
202+
if os.path.exists("constraints-test.txt"):
203+
session.install(
204+
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
205+
)
206+
else:
207+
session.install("-r", "requirements-test.txt")
208+
209+
if INSTALL_LIBRARY_FROM_SOURCE:
210+
session.install("-e", _get_repo_root())
211+
212+
if post_install:
213+
post_install(session)
214+
215+
session.run(
216+
"pytest",
217+
*(PYTEST_COMMON_ARGS + session.posargs),
218+
# Pytest will return 5 when no tests are collected. This can happen
219+
# on travis where slow and flaky tests are excluded.
220+
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
221+
success_codes=[0, 5],
222+
env=get_pytest_env_vars(),
223+
)
216224

217225

218226
@nox.session(python=ALL_VERSIONS)

packages/google-cloud-bigtable/samples/hello/noxfile.py

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from __future__ import print_function
1616

17+
import glob
1718
import os
1819
from pathlib import Path
1920
import sys
@@ -184,37 +185,44 @@ def blacken(session: nox.sessions.Session) -> None:
184185
def _session_tests(
185186
session: nox.sessions.Session, post_install: Callable = None
186187
) -> None:
187-
if TEST_CONFIG["pip_version_override"]:
188-
pip_version = TEST_CONFIG["pip_version_override"]
189-
session.install(f"pip=={pip_version}")
190-
"""Runs py.test for a particular project."""
191-
if os.path.exists("requirements.txt"):
192-
if os.path.exists("constraints.txt"):
193-
session.install("-r", "requirements.txt", "-c", "constraints.txt")
194-
else:
195-
session.install("-r", "requirements.txt")
196-
197-
if os.path.exists("requirements-test.txt"):
198-
if os.path.exists("constraints-test.txt"):
199-
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
200-
else:
201-
session.install("-r", "requirements-test.txt")
202-
203-
if INSTALL_LIBRARY_FROM_SOURCE:
204-
session.install("-e", _get_repo_root())
205-
206-
if post_install:
207-
post_install(session)
208-
209-
session.run(
210-
"pytest",
211-
*(PYTEST_COMMON_ARGS + session.posargs),
212-
# Pytest will return 5 when no tests are collected. This can happen
213-
# on travis where slow and flaky tests are excluded.
214-
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
215-
success_codes=[0, 5],
216-
env=get_pytest_env_vars(),
217-
)
188+
# check for presence of tests
189+
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
190+
if len(test_list) == 0:
191+
print("No tests found, skipping directory.")
192+
else:
193+
if TEST_CONFIG["pip_version_override"]:
194+
pip_version = TEST_CONFIG["pip_version_override"]
195+
session.install(f"pip=={pip_version}")
196+
"""Runs py.test for a particular project."""
197+
if os.path.exists("requirements.txt"):
198+
if os.path.exists("constraints.txt"):
199+
session.install("-r", "requirements.txt", "-c", "constraints.txt")
200+
else:
201+
session.install("-r", "requirements.txt")
202+
203+
if os.path.exists("requirements-test.txt"):
204+
if os.path.exists("constraints-test.txt"):
205+
session.install(
206+
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
207+
)
208+
else:
209+
session.install("-r", "requirements-test.txt")
210+
211+
if INSTALL_LIBRARY_FROM_SOURCE:
212+
session.install("-e", _get_repo_root())
213+
214+
if post_install:
215+
post_install(session)
216+
217+
session.run(
218+
"pytest",
219+
*(PYTEST_COMMON_ARGS + session.posargs),
220+
# Pytest will return 5 when no tests are collected. This can happen
221+
# on travis where slow and flaky tests are excluded.
222+
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
223+
success_codes=[0, 5],
224+
env=get_pytest_env_vars(),
225+
)
218226

219227

220228
@nox.session(python=ALL_VERSIONS)

packages/google-cloud-bigtable/samples/hello_happybase/noxfile.py

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from __future__ import print_function
1616

17+
import glob
1718
import os
1819
from pathlib import Path
1920
import sys
@@ -184,37 +185,44 @@ def blacken(session: nox.sessions.Session) -> None:
184185
def _session_tests(
185186
session: nox.sessions.Session, post_install: Callable = None
186187
) -> None:
187-
if TEST_CONFIG["pip_version_override"]:
188-
pip_version = TEST_CONFIG["pip_version_override"]
189-
session.install(f"pip=={pip_version}")
190-
"""Runs py.test for a particular project."""
191-
if os.path.exists("requirements.txt"):
192-
if os.path.exists("constraints.txt"):
193-
session.install("-r", "requirements.txt", "-c", "constraints.txt")
194-
else:
195-
session.install("-r", "requirements.txt")
196-
197-
if os.path.exists("requirements-test.txt"):
198-
if os.path.exists("constraints-test.txt"):
199-
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
200-
else:
201-
session.install("-r", "requirements-test.txt")
202-
203-
if INSTALL_LIBRARY_FROM_SOURCE:
204-
session.install("-e", _get_repo_root())
205-
206-
if post_install:
207-
post_install(session)
208-
209-
session.run(
210-
"pytest",
211-
*(PYTEST_COMMON_ARGS + session.posargs),
212-
# Pytest will return 5 when no tests are collected. This can happen
213-
# on travis where slow and flaky tests are excluded.
214-
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
215-
success_codes=[0, 5],
216-
env=get_pytest_env_vars(),
217-
)
188+
# check for presence of tests
189+
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
190+
if len(test_list) == 0:
191+
print("No tests found, skipping directory.")
192+
else:
193+
if TEST_CONFIG["pip_version_override"]:
194+
pip_version = TEST_CONFIG["pip_version_override"]
195+
session.install(f"pip=={pip_version}")
196+
"""Runs py.test for a particular project."""
197+
if os.path.exists("requirements.txt"):
198+
if os.path.exists("constraints.txt"):
199+
session.install("-r", "requirements.txt", "-c", "constraints.txt")
200+
else:
201+
session.install("-r", "requirements.txt")
202+
203+
if os.path.exists("requirements-test.txt"):
204+
if os.path.exists("constraints-test.txt"):
205+
session.install(
206+
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
207+
)
208+
else:
209+
session.install("-r", "requirements-test.txt")
210+
211+
if INSTALL_LIBRARY_FROM_SOURCE:
212+
session.install("-e", _get_repo_root())
213+
214+
if post_install:
215+
post_install(session)
216+
217+
session.run(
218+
"pytest",
219+
*(PYTEST_COMMON_ARGS + session.posargs),
220+
# Pytest will return 5 when no tests are collected. This can happen
221+
# on travis where slow and flaky tests are excluded.
222+
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
223+
success_codes=[0, 5],
224+
env=get_pytest_env_vars(),
225+
)
218226

219227

220228
@nox.session(python=ALL_VERSIONS)

packages/google-cloud-bigtable/samples/instanceadmin/noxfile.py

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from __future__ import print_function
1616

17+
import glob
1718
import os
1819
from pathlib import Path
1920
import sys
@@ -184,37 +185,44 @@ def blacken(session: nox.sessions.Session) -> None:
184185
def _session_tests(
185186
session: nox.sessions.Session, post_install: Callable = None
186187
) -> None:
187-
if TEST_CONFIG["pip_version_override"]:
188-
pip_version = TEST_CONFIG["pip_version_override"]
189-
session.install(f"pip=={pip_version}")
190-
"""Runs py.test for a particular project."""
191-
if os.path.exists("requirements.txt"):
192-
if os.path.exists("constraints.txt"):
193-
session.install("-r", "requirements.txt", "-c", "constraints.txt")
194-
else:
195-
session.install("-r", "requirements.txt")
196-
197-
if os.path.exists("requirements-test.txt"):
198-
if os.path.exists("constraints-test.txt"):
199-
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
200-
else:
201-
session.install("-r", "requirements-test.txt")
202-
203-
if INSTALL_LIBRARY_FROM_SOURCE:
204-
session.install("-e", _get_repo_root())
205-
206-
if post_install:
207-
post_install(session)
208-
209-
session.run(
210-
"pytest",
211-
*(PYTEST_COMMON_ARGS + session.posargs),
212-
# Pytest will return 5 when no tests are collected. This can happen
213-
# on travis where slow and flaky tests are excluded.
214-
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
215-
success_codes=[0, 5],
216-
env=get_pytest_env_vars(),
217-
)
188+
# check for presence of tests
189+
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
190+
if len(test_list) == 0:
191+
print("No tests found, skipping directory.")
192+
else:
193+
if TEST_CONFIG["pip_version_override"]:
194+
pip_version = TEST_CONFIG["pip_version_override"]
195+
session.install(f"pip=={pip_version}")
196+
"""Runs py.test for a particular project."""
197+
if os.path.exists("requirements.txt"):
198+
if os.path.exists("constraints.txt"):
199+
session.install("-r", "requirements.txt", "-c", "constraints.txt")
200+
else:
201+
session.install("-r", "requirements.txt")
202+
203+
if os.path.exists("requirements-test.txt"):
204+
if os.path.exists("constraints-test.txt"):
205+
session.install(
206+
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
207+
)
208+
else:
209+
session.install("-r", "requirements-test.txt")
210+
211+
if INSTALL_LIBRARY_FROM_SOURCE:
212+
session.install("-e", _get_repo_root())
213+
214+
if post_install:
215+
post_install(session)
216+
217+
session.run(
218+
"pytest",
219+
*(PYTEST_COMMON_ARGS + session.posargs),
220+
# Pytest will return 5 when no tests are collected. This can happen
221+
# on travis where slow and flaky tests are excluded.
222+
# See http://doc.pytest.org/en/latest/_modules/_pytest/main.html
223+
success_codes=[0, 5],
224+
env=get_pytest_env_vars(),
225+
)
218226

219227

220228
@nox.session(python=ALL_VERSIONS)

0 commit comments

Comments
 (0)