diff --git a/.readthedocs.yaml b/.readthedocs.yaml index daeb189..3d083b1 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,7 +7,7 @@ build: python: install: - - requirements: ./scripts/requirements-docs.txt + - requirements: ./scripts/requirements/requirements-docs.txt - path: . sphinx: diff --git a/scripts/export_requirements_txt.py b/scripts/export_requirements_txt.py index 9ed850e..da70b48 100644 --- a/scripts/export_requirements_txt.py +++ b/scripts/export_requirements_txt.py @@ -6,7 +6,7 @@ from pathlib import Path Format = enum.Enum("Format", "requirements setuppy") -BASE_DIR = Path(__file__).parent +BASE_DIR = Path(__file__).parent / "requirements" def fix_end_of_file(text): @@ -23,6 +23,8 @@ def pdm_export(args, filename, format: Format): ['# This a dummy setup.py to enable GitHub "Used By" stats', output] ) p = Path(filename) + if not p.parent.exists(): + p.parent.mkdir(parents=True) is_new = not p.exists() if is_new or p.read_text() != output: p.write_text(output) diff --git a/scripts/requirements-dev.txt b/scripts/requirements/requirements-dev.txt similarity index 100% rename from scripts/requirements-dev.txt rename to scripts/requirements/requirements-dev.txt diff --git a/scripts/requirements-docs.txt b/scripts/requirements/requirements-docs.txt similarity index 100% rename from scripts/requirements-docs.txt rename to scripts/requirements/requirements-docs.txt diff --git a/scripts/requirements-mini.txt b/scripts/requirements/requirements-mini.txt similarity index 100% rename from scripts/requirements-mini.txt rename to scripts/requirements/requirements-mini.txt diff --git a/scripts/requirements.txt b/scripts/requirements/requirements.txt similarity index 100% rename from scripts/requirements.txt rename to scripts/requirements/requirements.txt