Skip to content

Commit

Permalink
chore: update testing - ignore files, add constraints (#107)
Browse files Browse the repository at this point in the history
* chore: add constraints file check for python samples

This is the sibling PR to #5611
and this is the issue opened for it #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

* docs(python): add empty lines between methods

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Wed Apr 14 14:41:09 2021 -0600
Source-Repo: googleapis/synthtool
Source-Sha: 721339ab60a6eb63b889978b3d9b295dcb3be370
Source-Link: googleapis/synthtool@721339a

* build: use PyPI API token in secret manager

Migrate python libraries onto the PyPI API token stored in secret manager.

A PyPI API token is limited in scope to uploading new releases. https://pypi.org/help/#apitoken

Verified that this works with [build](https://fusion2.corp.google.com/invocations/14bae126-83fa-4328-8da9-d390ed99315c/targets/cloud-devrel%2Fclient-libraries%2Fpython%2Fgoogleapis%2Fpython-vision%2Frelease%2Frelease;config=default/log) on googleapis/python-vision#136

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Wed Apr 14 17:46:06 2021 -0600
Source-Repo: googleapis/synthtool
Source-Sha: 043cc620d6a6111816d9e09f2a97208565fde958
Source-Link: googleapis/synthtool@043cc62
  • Loading branch information
yoshi-automation authored and dandhlee committed Nov 10, 2022
1 parent a56a9f8 commit f6eaabe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions secretmanager/snippets/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,16 @@ def blacken(session: nox.sessions.Session) -> None:
def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> 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

0 comments on commit f6eaabe

Please sign in to comment.