diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index 308fab11a..513e2b1dd 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -26,6 +26,13 @@ jobs: # PyPy <= 3.8 is EoL since 2023-06-16 - "pypy-3.9" - "pypy-3.10" + mindep: [false] + include: + # pin OS lower than usual tests, even if that is slow / soon removed + # point is to prove we got our minimum deps documented + - os: ubuntu-20.04 + python-version: "3.7" + mindep: true steps: - uses: actions/checkout@v4 - name: Using Python ${{ matrix.python-version }} @@ -42,3 +49,5 @@ jobs: - run: tox -e run-module - run: tox -e run-entrypoint - run: tox -e py + - if: ${{ matrix.mindep }} + run: tox -e mindep diff --git a/pyproject.toml b/pyproject.toml index f4ac02e99..66aa0554f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ classifiers = [ requires-python = ">=3.7" dependencies = [ 'importlib_metadata; python_version<"3.8"', + #"packaging>=21.0", "packaging", ] dynamic = ["version"] @@ -50,11 +51,51 @@ Documentation = "https://docs.gunicorn.org" Changelog = "https://docs.gunicorn.org/en/stable/news.html" [project.optional-dependencies] -gevent = ["gevent>=1.4.0"] -eventlet = ["eventlet>=0.24.1"] -tornado = ["tornado>=0.2"] +gevent = [ + # 21.8.0 is what Ubuntu 22.04 shipped + # 22.8.0 is lowest tested OK on 3.11 + # 22.10 is the last version to support 3.7 + #'gevent>=21.8.0; python_version<"3.11"', + #'gevent>=22.8.0; python_version>="3.11"', + # gevent 1.4.0 does not build for 3.11 (incompat Cython) + "gevent>=1.4.0", +] +eventlet = [ + # eventlet 0.34.1 known to break older gunicorn + # (removed toplevel __version__, re-added since) + # eventlet 0.26.0 needed for 3.7 + # eventlet 0.26.1 needed for 3.7 dependencies + # eventlet 0.33.0 needed for python 3.10 + #'eventlet>=0.26.1; python_version<"3.10"', + #'eventlet>=0.33.3; python_version>="3.10"', + "eventlet>=0.24.1", +] +tornado = [ + # arbitrary unsupported release with grave issues + # pick version that does not play nice with CPython3 and work our way up + #"tornado>=3.0.2", + "tornado>=0.2", +] gthread = [] -setproctitle = ["setproctitle"] +setproctitle = [ + # 1.2.0 needed for Python 3.8 + #"setproctitle>=1.2.0", + "setproctitle", +] +testing-mindep = [ + # this sections helps tox/pip select lowest version + # .. needs to manually kept in sync with other sections + "coverage[toml]==5.2.1", + "packaging==21.0", + "pytest==7.2.0", + "setproctitle==1.2.0", + "setuptools==61.2", + "tornado==3.0.2", + 'eventlet==0.26.1; python_version<"3.10"', + 'eventlet==0.33.3; python_version>="3.10"', + 'gevent==21.8.0; python_version<"3.11"', + 'gevent==22.8.0; python_version>="3.11"', +] testing = [ "gevent", "eventlet", @@ -67,12 +108,21 @@ testing = [ # duplicates "python -m gunicorn" handling in __main__.py gunicorn = "gunicorn.app.wsgiapp:run" -# note the quotes around "paste.server_runner" to escape the dot [project.entry-points."paste.server_runner"] +# note the quotes around "paste.server_runner" to escape the dot main = "gunicorn.app.pasterapp:serve" +[tool.coverage.report] +omit = [ + # workaround for bad test tripping pytest+coverage: + # tests will load such file as configuration + # when we delete the source, we do not care for its coverage + "*/gunicorn.conf.py", +] + [tool.pytest.ini_options] -# # can override these: python -m pytest --override-ini="addopts=" +# can override these: python -m pytest --override-ini="addopts=" +faulthandler_timeout = 25 norecursedirs = ["examples", "lib", "local", "src"] testpaths = ["tests/"] addopts = "--assert=plain --cov=gunicorn --cov-report=xml" diff --git a/tox.ini b/tox.ini index c1c2fd053..f0a8237fa 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,15 @@ commands = pytest --cov=gunicorn {posargs} deps = -rrequirements_test.txt +[testenv:mindep] +# this need not match default testenv. both editable & wheel must work! +package = wheel +extras = testing-mindep +commands = + python -m pip freeze + python -m coverage run -m pytest {posargs} + python -m coverage xml + [testenv:run-entrypoint] # entry point: console script (provided by setuptools from pyproject.toml) commands = python -c 'import subprocess; cmd_out = subprocess.check_output(["gunicorn", "--version"])[:79].decode("utf-8", errors="replace"); print(cmd_out); assert cmd_out.startswith("gunicorn ")'