reorder tox dependency filters to avoid skipping

This commit is contained in:
sommersoft 2022-04-04 07:32:38 -05:00
parent 5197801025
commit 26b2a5016d
1 changed files with 9 additions and 6 deletions

View File

@ -28,7 +28,6 @@ parser.add_argument("jobs", nargs="+", help="Job names to use.")
parser.add_argument(
"--matrix-exclude", nargs="*", default=[], help="Exclude these matrix names."
)
parser.add_argument(
"--dry-run",
action="store_true",
@ -64,11 +63,6 @@ def load_matrix_schema(repo):
TOX_DEP_FILTERS = {
"pytest": {
"src": f"pytest @ file://{os.getcwd()}",
"condition": r"^pytest(?!\-)",
"has_gen": r"pytest\w*",
},
"pytest-rerunfailures": {
"src": "pytest-rerunfailures @ git+https://github.com/pytest-dev/pytest-rerunfailures.git",
"condition": r"^pytest-rerunfailures.*",
@ -79,6 +73,11 @@ TOX_DEP_FILTERS = {
"condition": r"^pytest.*pytest-xdist",
"has_gen": r"pytest\{.*\,7\d.*\}",
},
"pytest": {
"src": f"pytest @ file://{os.getcwd()}",
"condition": r"^pytest(?!\-)",
"has_gen": r"pytest\w*",
},
}
@ -96,6 +95,10 @@ class ToxDepFilter(_BaseUserDict):
"""Checks if `match` matches any conditions"""
match_found = None
for key, val in self.data.items():
if "xdist" in match:
logging.debug(
"matches_condition: %s", re.search(val["condition"], match)
)
if re.search(val["condition"], match):
match_found = key
break