Skip to content

Commit

Permalink
Merge pull request #2927 from samypr100/ci-improvements
Browse files Browse the repository at this point in the history
CI Improvements
  • Loading branch information
benoitc committed Jan 26, 2023
2 parents 48eda22 + f5d73aa commit bba59ae
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 39 deletions.
41 changes: 17 additions & 24 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,22 @@ on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
tox-lint:
lint:
name: tox-${{ matrix.toxenv }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toxenv: [lint, docs-lint, pycodestyle]
python-version: [ "3.10" ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install --upgrade pip
- run: pip install tox
- run: tox -e lint

tox-docs-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install --upgrade pip
- run: pip install tox
- run: tox -e docs-lint

tox-pycodestyle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install --upgrade pip
- run: pip install tox
- run: tox -e pycodestyle
- uses: actions/checkout@v3
- name: Using Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e ${{ matrix.toxenv }}
21 changes: 12 additions & 9 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@ permissions:
contents: read # to fetch code (actions/checkout)
jobs:
tox:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc.
os: [ubuntu-latest] # [macos-latest, ubuntu-latest, windows-latest]
python: ['3.10'] # ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
runs-on: ${{ matrix.os }}
matrix:
os: [ubuntu-latest, macos-latest] # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc.
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7", "pypy-3.8" ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Using Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- run: pip install --upgrade pip
- run: pip install tox
- run: pip install -e .
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e py
2 changes: 1 addition & 1 deletion gunicorn/http/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, cfg, unreader, peer_addr):
self.cfg = cfg
self.unreader = unreader
self.peer_addr = peer_addr
self.remote_addr = peer_addr[0]
self.remote_addr = peer_addr
self.version = None
self.headers = []
self.trailers = []
Expand Down
11 changes: 6 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tox]
envlist = py35, py36, py37, py38, py39, py310, pypy3, lint, docs-lint, pycodestyle
skipsdist = True
envlist = py{37,38,39,310,311,py3}, lint, docs-lint, pycodestyle
skipsdist = false
; Can't set skipsdist and use_develop in tox v4 to true due to https://github.com/tox-dev/tox/issues/2730

[testenv]
usedevelop = True
use_develop = true
commands = pytest --cov=gunicorn {posargs}
deps =
-rrequirements_test.txt
Expand All @@ -25,10 +26,10 @@ commands =
tests/test_util.py \
tests/test_valid_requests.py
deps =
pylint
pylint<2.7

[testenv:docs-lint]
whitelist_externals =
allowlist_externals =
rst-lint
bash
grep
Expand Down

0 comments on commit bba59ae

Please sign in to comment.