From a55e22157b39f5f07c54177703ebcb8d24f13993 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 9 May 2023 09:43:36 +0000 Subject: [PATCH] Fix GitHub Actions error that caused failures --- .github/ci_requirements.txt | 2 +- noxfile.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/ci_requirements.txt b/.github/ci_requirements.txt index 04b8b104..a9c8f26d 100644 --- a/.github/ci_requirements.txt +++ b/.github/ci_requirements.txt @@ -1,2 +1,2 @@ -poetry==1.1.9 +poetry==1.3.2 nox==2022.1.7 diff --git a/noxfile.py b/noxfile.py index 028b306f..7c6006a1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -21,6 +21,14 @@ def install_with_constraints(session, *args, **kwargs): f"--output={requirements.name}", external=True, ) + # Using sed to remove extras from the constraints file, thereby fixing the + # error "Constraints cannot have extras". A better solution might be to + # use `poetry install --only dev` but this requires a newer version of + # Poetry than we're using in our development environments. See + # https://github.com/jazzband/pip-tools/issues/1300#issuecomment-818122483 + # for more info relating to the sed solution + sed_expression = r"s/\[.*\]//g" + session.run("sed", "-i", sed_expression, requirements.name, external=True) session.install(f"--constraint={requirements.name}", *args, **kwargs) try: