Skip to content

Commit bba59ae

Browse files
authored
Merge pull request #2927 from samypr100/ci-improvements
CI Improvements
2 parents 48eda22 + f5d73aa commit bba59ae

File tree

4 files changed

+36
-39
lines changed

4 files changed

+36
-39
lines changed

.github/workflows/lint.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,22 @@ on: [push, pull_request]
33
permissions:
44
contents: read # to fetch code (actions/checkout)
55
jobs:
6-
tox-lint:
6+
lint:
7+
name: tox-${{ matrix.toxenv }}
78
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
toxenv: [lint, docs-lint, pycodestyle]
13+
python-version: [ "3.10" ]
814
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/setup-python@v2
11-
- run: pip install --upgrade pip
12-
- run: pip install tox
13-
- run: tox -e lint
14-
15-
tox-docs-lint:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/setup-python@v2
20-
- run: pip install --upgrade pip
21-
- run: pip install tox
22-
- run: tox -e docs-lint
23-
24-
tox-pycodestyle:
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v2
28-
- uses: actions/setup-python@v2
29-
- run: pip install --upgrade pip
30-
- run: pip install tox
31-
- run: tox -e pycodestyle
15+
- uses: actions/checkout@v3
16+
- name: Using Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install Dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install tox
24+
- run: tox -e ${{ matrix.toxenv }}

.github/workflows/tox.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ permissions:
44
contents: read # to fetch code (actions/checkout)
55
jobs:
66
tox:
7+
name: ${{ matrix.os }} / ${{ matrix.python-version }}
8+
runs-on: ${{ matrix.os }}
79
strategy:
810
fail-fast: false
9-
matrix: # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc.
10-
os: [ubuntu-latest] # [macos-latest, ubuntu-latest, windows-latest]
11-
python: ['3.10'] # ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
12-
runs-on: ${{ matrix.os }}
11+
matrix:
12+
os: [ubuntu-latest, macos-latest] # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc.
13+
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7", "pypy-3.8" ]
1314
steps:
1415
- uses: actions/checkout@v3
15-
- uses: actions/setup-python@v4
16+
- name: Using Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
1618
with:
17-
python-version: ${{ matrix.python }}
18-
- run: pip install --upgrade pip
19-
- run: pip install tox
20-
- run: pip install -e .
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install Dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install tox
2124
- run: tox -e py

gunicorn/http/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def __init__(self, cfg, unreader, peer_addr):
3131
self.cfg = cfg
3232
self.unreader = unreader
3333
self.peer_addr = peer_addr
34-
self.remote_addr = peer_addr[0]
34+
self.remote_addr = peer_addr
3535
self.version = None
3636
self.headers = []
3737
self.trailers = []

tox.ini

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[tox]
2-
envlist = py35, py36, py37, py38, py39, py310, pypy3, lint, docs-lint, pycodestyle
3-
skipsdist = True
2+
envlist = py{37,38,39,310,311,py3}, lint, docs-lint, pycodestyle
3+
skipsdist = false
4+
; Can't set skipsdist and use_develop in tox v4 to true due to https://github.com/tox-dev/tox/issues/2730
45

56
[testenv]
6-
usedevelop = True
7+
use_develop = true
78
commands = pytest --cov=gunicorn {posargs}
89
deps =
910
-rrequirements_test.txt
@@ -25,10 +26,10 @@ commands =
2526
tests/test_util.py \
2627
tests/test_valid_requests.py
2728
deps =
28-
pylint
29+
pylint<2.7
2930

3031
[testenv:docs-lint]
31-
whitelist_externals =
32+
allowlist_externals =
3233
rst-lint
3334
bash
3435
grep

0 commit comments

Comments
 (0)