From ac4dab17d1ec1b87d5076b5a210ba76cc3cc3e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20L=C3=B6sche?= Date: Tue, 5 Mar 2024 18:20:17 +0100 Subject: [PATCH] Add dev tools --- Makefile | 7 +++++-- pyproject.toml | 4 ++++ requirements-dev.in | 1 + requirements-dev.txt | 8 ++++++++ tools/make-requirements-in.py | 12 +++++++++--- 5 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 requirements-dev.in create mode 100644 requirements-dev.txt diff --git a/Makefile b/Makefile index 4482a9e..f74fbb5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -.PHONY: all generate_in requirements.txt requirements-test.txt +.PHONY: all generate_in requirements.txt requirements-test.txt requirements-dev.txt -all: generate_in requirements.txt requirements-test.txt +all: generate_in requirements.txt requirements-test.txt requirements-dev.txt generate_in: python tools/make-requirements-in.py @@ -10,3 +10,6 @@ requirements.txt: requirements.in pyproject.toml requirements-test.txt: requirements-test.in pyproject.toml pip-compile -q --no-annotate --resolver=backtracking --upgrade --allow-unsafe --no-header --unsafe-package n/a --no-strip-extras requirements-test.in -o requirements-test.txt + +requirements-dev.txt: requirements-dev.in pyproject.toml + pip-compile -q --no-annotate --resolver=backtracking --upgrade --allow-unsafe --no-header --unsafe-package n/a --no-strip-extras requirements-dev.in -o requirements-dev.txt diff --git a/pyproject.toml b/pyproject.toml index a5be758..ab8f898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,10 @@ test = [ "types-aiofiles", ] +dev = [ + "pip-tools", +] + [tool.setuptools.package-data] fixcompliance = ["py.typed"] diff --git a/requirements-dev.in b/requirements-dev.in new file mode 100644 index 0000000..2c2a9f3 --- /dev/null +++ b/requirements-dev.in @@ -0,0 +1 @@ +pip-tools diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..fb241de --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,8 @@ +build==1.1.1 +click==8.1.7 +packaging==23.2 +pip==24.0 +pip-tools==7.4.0 +pyproject-hooks==1.0.0 +setuptools==69.1.1 +wheel==0.42.0 diff --git a/tools/make-requirements-in.py b/tools/make-requirements-in.py index 5726ada..24f9fc3 100755 --- a/tools/make-requirements-in.py +++ b/tools/make-requirements-in.py @@ -8,18 +8,24 @@ def create_in_files(pyproject_path: str): pyproject = tomllib.load(f) dependencies = pyproject.get("project", {}).get("dependencies", []) - optional_dependencies = pyproject.get("pyproject", {}).get("optional-dependencies", {}).get("test", []) + test_dependencies = pyproject.get("pyproject", {}).get("optional-dependencies", {}).get("test", []) + dev_dependencies = pyproject.get("pyproject", {}).get("optional-dependencies", {}).get("dev", []) # Write main dependencies to requirements.in with open("requirements.in", "w") as f: for dep in dependencies: f.write(dep + "\n") - # Write test dependencies to requirements-test.in (includes extras) + # Write test dependencies to requirements-test.in with open("requirements-test.in", "w") as f: - for test_dep in optional_dependencies: + for test_dep in test_dependencies: f.write(test_dep + "\n") + # Write dev dependencies to requirements-dev.in + with open("requirements-dev.in", "w") as f: + for dev_dep in dev_dependencies: + f.write(dev_dep + "\n") + if __name__ == "__main__": pyproject_path = "pyproject.toml"