From acc68de059c15c5eaefbb353cfbf7e0bf1524edc Mon Sep 17 00:00:00 2001 From: James Falcon Date: Fri, 26 Apr 2024 15:25:52 -0500 Subject: [PATCH] ci: Skip package build on tox runs (#5210) Building a wheel/sdist generally adds 5+ seconds to every tox run. This is unnecessary because a built package isn't needed to run any of the CI tasks. Also remove the `recreate` line as it wasn't doing anything. To work correctly, it should be defined under `[testenv]`, not `[tox]`. --- test-requirements.txt | 2 ++ tools/read-dependencies | 6 ++---- tox.ini | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test-requirements.txt b/test-requirements.txt index 19488b943d7..c6c32cae679 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,7 @@ # Needed generally in tests +-r requirements.txt + # Avoid breaking change in `testpaths` treatment forced # test/unittests/conftest.py to be loaded by our integration-tests tox env # resulting in an unmet dependency issue: diff --git a/tools/read-dependencies b/tools/read-dependencies index a3b2d73884b..6e7bf46167e 100755 --- a/tools/read-dependencies +++ b/tools/read-dependencies @@ -203,7 +203,7 @@ def parse_pip_requirements(requirements_path): with open(requirements_path, "r") as fp: for line in fp: line = line.strip() - if not line or line.startswith("#"): + if not line or line.startswith(("#", "-r ")): continue # remove pip-style markers @@ -212,9 +212,7 @@ def parse_pip_requirements(requirements_path): # remove version requirements version_comparison = re.compile(r"[~!>=.<]+") if version_comparison.search(dep): - dep_names.append( - version_comparison.split(dep)[0].strip() - ) + dep_names.append(version_comparison.split(dep)[0].strip()) else: dep_names.append(dep) return dep_names diff --git a/tox.ini b/tox.ini index 473e937cb25..e6280821db6 100644 --- a/tox.ini +++ b/tox.ini @@ -6,12 +6,12 @@ envlist = isort, mypy, pylint -recreate = True [doc8] ignore-path-errors=doc/rtd/topics/faq.rst;D001 [testenv] +package = skip basepython = python3 setenv = LC_ALL = en_US.utf-8