From dfb360b34d9ebf625f2ecc4e36b64b3b000c34fb Mon Sep 17 00:00:00 2001 From: masklinn Date: Wed, 24 Dec 2025 20:21:50 +0100 Subject: [PATCH] Improve tox file - add an entry for the docs (and remove the docs makefile, given sphinx's make-mode) - remove the old automation makefile - move the labels into the individual testenvs, easier to maintain - also apparently I forgot to add cpython 3.13 to the cpython testenv? --- Makefile | 20 -------------------- doc/Makefile | 20 -------------------- tox.ini | 31 +++++++++++++++++++++---------- 3 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 Makefile delete mode 100644 doc/Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 0604a25c..00000000 --- a/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -all: test - -test: - tox - -clean: - @find . -name '*.pyc' -delete - @rm -rf tmp \ - src/ua_parser.egg-info \ - dist \ - build \ - src/ua_parser/_regexes.py -format: - @black . - -release: clean - pyproject-build - twine upload -s dist/* - -.PHONY: all test clean format release diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/doc/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/tox.ini b/tox.ini index 9b3f1541..da50c20d 100644 --- a/tox.ini +++ b/tox.ini @@ -3,14 +3,10 @@ min_version = 4.0 env_list = py3{9,10,11,12,13} pypy{310,311} graalpy - flake8, black, typecheck -labels = - test = py3{9,10,11,12,13},pypy{310,311},graalpy - cpy = py3{9,10,11,12,13} - pypy = pypy{310,311} - check = flake8, black, typecheck + check, format, typecheck [testenv] +labels = test # wheel install package = wheel # wheel is universal so can use the same wheel for all envs @@ -25,7 +21,8 @@ deps = commands = pytest -Werror --doctest-glob="*.rst" {posargs} -[testenv:py3{9,10,11,12}] +[testenv:py3{9,10,11,12,13}] +labels = test, cpy deps = pytest pyyaml @@ -33,20 +30,34 @@ deps = ua-parser-rs ./ua-parser-builtins -[testenv:flake8] +[testenv:pypy{310,311}] +labels = test, pypy + +[testenv:check] +labels = check package = skip deps = ruff commands = ruff check {posargs} -[testenv:black] +[testenv:format] +description = Runs the formatter (just showing errors by default) +labels = check package = skip deps = ruff commands = ruff format {posargs:--diff} [testenv:typecheck] +labels = check package = skip deps = mypy types-PyYaml ./ua-parser-builtins -commands = mypy {posargs:} +commands = mypy {posargs} + +[testenv:docs] +description = Builds the documentation +labels = +package = skip +deps = sphinx +commands = sphinx-build -M {posargs:html} doc docs/_build