Skip to content

Commit

Permalink
add check to noxfile template for constraints files (#5611)
Browse files Browse the repository at this point in the history
* add check to noxfile template for constraints files

* ignore constraints files in header check

* add constraints check to renovate, remove old ignore
  • Loading branch information
leahecole authored Apr 2, 2021
1 parent f2fbf82 commit e8509ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/header-checker-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{"allowedCopyrightHolders": ["Google LLC", "Google, Inc"],
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/requirements-composer.txt", "**/__init__.py"],
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/requirements-composer.txt", "**/__init__.py", "**/constraints.txt", "**/constraints-test.txt"],
"sourceFileExtensions": [
"ts",
"js",
Expand Down
8 changes: 6 additions & 2 deletions noxfile-template.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,14 @@ 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")
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")
session.install("-r", "requirements-test.txt")

if INSTALL_LIBRARY_FROM_SOURCE:
session.install("-e", _get_repo_root())
Expand Down
3 changes: 1 addition & 2 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"rebaseWhen": "never",
"masterIssue": true,
"pip_requirements": {
"fileMatch": ["requirements-test.txt", "requirements-composer.txt"]
"fileMatch": ["requirements-test.txt", "requirements-composer.txt", "constraints.txt", "constraints-test.txt"]
},
"ignoreDeps":["cattrs"],
"packageRules": [
{
"packagePatterns": ["pytest"],
Expand Down

0 comments on commit e8509ca

Please sign in to comment.