diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6ad570..4e7fbc4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,9 +25,7 @@ jobs: python-version: ${{ matrix.python-version }} cache: 'pip' - name: Install - run: | - pip install -U pip -r requirements.txt - pip install . + run: make EXTRAS=dev install - name: Test run: thx --live test - name: Lint diff --git a/makefile b/makefile index 5b0247f..48ac94f 100644 --- a/makefile +++ b/makefile @@ -1,19 +1,16 @@ SRCS:=thx +EXTRAS:=dev,docs .venv: python -m venv .venv - source .venv/bin/activate && make setup dev + source .venv/bin/activate && make install echo 'run `source .venv/bin/activate` to use virtualenv' venv: .venv -dev: - python -m pip install -e . - -setup: +install: python -m pip install -U pip - python -m pip install -Ur requirements-dev.txt - python -m pip install -Ur requirements.txt + python -m pip install -e .[$(EXTRAS)] release: lint test clean flit publish diff --git a/pyproject.toml b/pyproject.toml index d1e6784..f7bae41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,38 +2,69 @@ requires = ["flit_core >=3,<4"] build-backend = "flit_core.buildapi" -[tool.flit.metadata] -module = "thx" -author = "Amethyst Reese" -author-email = "amy@noswap.com" -description-file = "README.rst" -home-page = "https://github.com/omnilib/thx" -requires = [ +[project] +name = "thx" +readme = "README.rst" +license = {file="LICENSE"} +dynamic = ["version", "description"] +authors = [ + {name="Amethyst Reese", email="amethyst@n7.gg"}, +] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Topic :: Utilities", + "Typing :: Typed", +] +requires-python = ">=3.8" +dependencies = [ "aioitertools >= 0.10.0b1", "click >= 8.0", "packaging >= 21.0", "rich >= 11.0.0", "tomli >= 1.0", "trailrunner >= 1.1", - "typing_extensions >= 4.0; python_version < '3.11'", + "typing_extensions >= 4.0", "watchdog >= 2.1", ] -requires-python = ">=3.7" -classifiers = [ - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Topic :: Utilities", - "Typing :: Typed", + +[project.optional-dependencies] +dev = [ + "aioitertools==v0.11.0", + "click==8.1.3", + "packaging==24.0", + "rich==13.7.1", + "tomli==2.0.1", + "trailrunner==1.4.0", + "typing_extensions == 4.1.1", + "watchdog==2.1.9", + + "attribution==1.7.1", + "black==24.4.2", + "coverage==7.5.1", + "flit==3.9.0", + "flake8==7.0.0", + "mypy==1.10.0", + "ufmt==2.6.0", + "usort==1.0.8.post1", +] +docs = [ + "sphinx==7.2.6; python_version > '3.8'", + "sphinx-mdinclude==0.6.1", ] +[project.scripts] +thx = "thx.main:main" + +[project.urls] +Documentation = "https://thx.omnilib.dev" +Github = "https://github.com/omnilib/thx" + [tool.flit.sdist] exclude = [ ".github/", ] -[tool.flit.scripts] -thx = "thx.main:main" - [tool.attribution] name = "thx" package = "thx" @@ -61,6 +92,7 @@ ignore_missing_imports = true [tool.thx] default = ["format", "docs", "test", "lint", "coverage"] python_versions = ["3.8", "3.9", "3.10", "3.11", "3.12"] +extras = ["dev", "docs"] [tool.thx.values] module = "thx" @@ -71,14 +103,12 @@ docs = {run="sphinx-build -ab html docs html", once=true} format = {run="python -m ufmt format {srcs}", once=true} test = "python -m coverage run -m {module}.tests" -[tool.thx.jobs.combine] -requires = ["test"] -run = "python -m coverage combine" -once = true - [tool.thx.jobs.coverage] -requires = ["combine"] -run = "python -m coverage report" +requires = ["test"] +run = [ + "python -m coverage combine -q", + "python -m coverage report", +] once = true show_output = true diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 329fb5d..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,10 +0,0 @@ -attribution==1.7.1 -black==24.4.2 -coverage==7.5.1 -flit==3.9.0 -flake8==7.0.0 -mypy==1.10.0 -sphinx==7.3.7; python_version >= "3.9" -sphinx-mdinclude==0.6.1 -ufmt==2.6.0 -usort==1.0.8.post1 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7f43cc6..0000000 --- a/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -aioitertools==v0.11.0 -click==8.1.3 -packaging==24.0 -rich==13.7.1 -tomli==2.0.1 -trailrunner==1.4.0 -typing_extensions == 4.1.1 -watchdog==2.1.9