Skip to content

Commit

Permalink
Limit requirement compilation for doc and style to 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Mar 21, 2024
1 parent 4c95a67 commit 6bc1ff3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/scripts/compile_requirements.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import os
import re
import shutil
import subprocess
import sys
from pathlib import Path


EXCLUDE_STEM_RE = re.compile(r".*-3\.(?!8-)(\d+)-extra-(doc|style)")
GITHUB_OUTPUT = os.environ["GITHUB_OUTPUT"]
REQUIREMENTS_FOLDER = Path(__file__).parents[3].absolute() / "requirements"
os.chdir(REQUIREMENTS_FOLDER)


def pip_compile(version: str, name: str) -> None:
stem = f"{sys.platform}-{version}-{name}"
if EXCLUDE_STEM_RE.fullmatch(stem):
return

executable = ("py", f"-{version}") if sys.platform == "win32" else (f"python{version}",)
subprocess.check_call(
(
Expand All @@ -23,7 +29,7 @@ def pip_compile(version: str, name: str) -> None:
"--verbose",
f"{name}.in",
"--output-file",
f"{sys.platform}-{version}-{name}.txt",
f"{stem}.txt",
)
)

Expand Down

0 comments on commit 6bc1ff3

Please sign in to comment.