From 862179444fac9f36e9d327d757a5808a7b25691f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E7=8E=AE=20=28Jade=20Lin=29?= Date: Fri, 11 Oct 2024 19:12:58 +0800 Subject: [PATCH] chore: change requirements.txt loc --- .readthedocs.yaml | 2 +- scripts/export_requirements_txt.py | 19 ++++++++++++++----- .../requirements-dev.txt | 0 .../requirements-docs.txt | 0 .../requirements-mini.txt | 0 requirements.txt => scripts/requirements.txt | 0 6 files changed, 15 insertions(+), 6 deletions(-) rename requirements-dev.txt => scripts/requirements-dev.txt (100%) rename requirements-docs.txt => scripts/requirements-docs.txt (100%) rename requirements-mini.txt => scripts/requirements-mini.txt (100%) rename requirements.txt => scripts/requirements.txt (100%) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b7e608e..daeb189 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,7 +7,7 @@ build: python: install: - - requirements: ./requirements-docs.txt + - requirements: ./scripts/requirements-docs.txt - path: . sphinx: diff --git a/scripts/export_requirements_txt.py b/scripts/export_requirements_txt.py index 8cbf247..9ed850e 100644 --- a/scripts/export_requirements_txt.py +++ b/scripts/export_requirements_txt.py @@ -6,6 +6,7 @@ from pathlib import Path Format = enum.Enum("Format", "requirements setuppy") +BASE_DIR = Path(__file__).parent def fix_end_of_file(text): @@ -30,18 +31,26 @@ def pdm_export(args, filename, format: Format): pdm_export( - args=["--prod"], filename="requirements-mini.txt", format=Format.requirements + args=["--prod"], + filename=BASE_DIR / "requirements-mini.txt", + format=Format.requirements, ) pdm_export( args=[ "--prod", "-G:all", ], - filename="requirements.txt", + filename=BASE_DIR / "requirements.txt", format=Format.requirements, ) -pdm_export(args=["-G:all"], filename="requirements-dev.txt", format=Format.requirements) pdm_export( - args=["-G", "docs"], filename="requirements-docs.txt", format=Format.requirements + args=["-G:all"], + filename=BASE_DIR / "requirements-dev.txt", + format=Format.requirements, +) +pdm_export( + args=["-G", "docs"], + filename=BASE_DIR / "requirements-docs.txt", + format=Format.requirements, ) -# pdm_export(args=[], filename="setup.py", format=Format.setuppy) +# pdm_export(args=[], filename=BASE_DIR / "setup.py", format=Format.setuppy) diff --git a/requirements-dev.txt b/scripts/requirements-dev.txt similarity index 100% rename from requirements-dev.txt rename to scripts/requirements-dev.txt diff --git a/requirements-docs.txt b/scripts/requirements-docs.txt similarity index 100% rename from requirements-docs.txt rename to scripts/requirements-docs.txt diff --git a/requirements-mini.txt b/scripts/requirements-mini.txt similarity index 100% rename from requirements-mini.txt rename to scripts/requirements-mini.txt diff --git a/requirements.txt b/scripts/requirements.txt similarity index 100% rename from requirements.txt rename to scripts/requirements.txt