Skip to content

Commit

Permalink
CI: verify minimal dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed Apr 22, 2024
1 parent 5b68c17 commit 22dc1bc
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
63 changes: 57 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ classifiers = [
requires-python = ">=3.7"
dependencies = [
'importlib_metadata; python_version<"3.8"',
#"packaging>=21.0",
"packaging",
]
dynamic = ["version"]
Expand All @@ -50,11 +51,52 @@ 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,!=0.36.0"]
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
# eventlet 0.36.0 https://github.com/eventlet/eventlet/issues/946
# (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,!=0.36.0",
]
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",
Expand All @@ -67,12 +109,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"
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 ")'
Expand Down

0 comments on commit 22dc1bc

Please sign in to comment.