From 99ac046f58829eb2e2e3aca24741289ea81acea6 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 27 Jun 2024 10:15:25 +0100 Subject: [PATCH] Packaging: add example requirements file. --- pyproject.toml | 22 ++++++---------------- requirements-dev.txt | 1 + requirements-examples.txt | 12 ++++++++++++ tox.ini | 9 +-------- 4 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 requirements-examples.txt diff --git a/pyproject.toml b/pyproject.toml index db474c33..5e92f538 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["hatchling", "hatch-fancy-pypi-readme"] +requires = ["hatchling", "hatch-fancy-pypi-readme", "hatch-requirements-txt"] build-backend = "hatchling.build" [project] name = "inky" -dynamic = ["version", "readme"] +dynamic = ["version", "readme", "optional-dependencies"] description = "Inky pHAT Driver" license = {file = "LICENSE"} requires-python = ">= 3.7" @@ -42,19 +42,8 @@ dependencies = [ "gpiodevice>=0.0.3" ] -[project.optional-dependencies] -example-depends = [ - "pillow", - "requests", - "geocoder", - "beautifulsoup4", - "font-fredoka-one", - "font-source-serif-pro", - "font-hanken-grotesk", - "font-intuitive" -] -rpi-gpio-output = ['RPi.GPIO'] -rpi = ['RPi.GPIO'] +[tool.hatch.metadata.hooks.requirements_txt.optional-dependencies] +example-depends = ["requirements-examples.txt"] [project.urls] GitHub = "https://www.github.com/pimoroni/inky" @@ -68,7 +57,8 @@ include = [ "inky", "README.md", "CHANGELOG.md", - "LICENSE" + "LICENSE", + "requirements-examples.txt" ] [tool.hatch.build.targets.sdist] diff --git a/requirements-dev.txt b/requirements-dev.txt index 525b0427..d392e8fe 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,5 +5,6 @@ isort twine hatch hatch-fancy-pypi-readme +hatch-requirements-txt tox pdoc diff --git a/requirements-examples.txt b/requirements-examples.txt new file mode 100644 index 00000000..f711a6f1 --- /dev/null +++ b/requirements-examples.txt @@ -0,0 +1,12 @@ +pillow +requests +beautifulsoup4 +fonts +font-source-sans-pro +font-source-serif-pro +font-fredoka-one +font-hanken-grotesk +font-intuitive +geocoder +seaborn +wikiquotes \ No newline at end of file diff --git a/tox.ini b/tox.ini index 4726cef0..2b6d87b8 100644 --- a/tox.ini +++ b/tox.ini @@ -23,12 +23,5 @@ commands = ruff check . codespell . deps = - check-manifest - ruff - codespell - isort - twine - build - hatch - hatch-fancy-pypi-readme + -r{toxinidir}/requirements-dev.txt