Skip to content

Commit

Permalink
Downgrade jsonschema for py3.7
Browse files Browse the repository at this point in the history
Fix pypy version and linting

Go without tox-gh

Specify tox environment

Fix jsonschema version for python versions

Restrict pytest version by python version

Prevent syntax and import errors on <3.7 python versions
  • Loading branch information
sarayourfriend committed Nov 8, 2023
1 parent 3ad3b45 commit a1e57c4
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 28 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
- name: Lint
run: flake8 pook tests

tox:
name: test with ${{ matrix.config.py }}
test:
name: test on ${{ matrix.config.py }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
Expand All @@ -59,7 +59,7 @@ jobs:
os: "ubuntu-20.04"
- py: "3.5"
os: "ubuntu-20.04"
- py: "pypy3.11"
- py: "pypy3.10"
os: "ubuntu-22.04"

steps:
Expand All @@ -75,10 +75,7 @@ jobs:
cache: pip

- name: Install tox
run: python -m pip install tox-gh>=1.2

- name: Setup test suite
run: tox -vv --notest
run: python -m pip install tox

- name: Run test suite
run: tox --skip-pkg-install
run: tox run -e py
2 changes: 0 additions & 2 deletions pook/headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
except ImportError:
from collections import Mapping, MutableMapping

from base64 import b64encode


class HTTPHeaderDict(MutableMapping):
"""
Expand Down
10 changes: 5 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
flake8
wheel>=0.29
coveralls>=1.1
pytest~=7.2.0
pytest-cov~=4.0.0
pytest-flakes~=1.0.1
pytest~=7.0; python_version >= '3.6'
pytest; python_version == '3.5'
pytest-cov~=4.0.0; python_version == '3.11'
nose~=1.3.7
Sphinx~=1.4.8
sphinx-rtd-theme~=0.1.9
requests>=2.20.0
urllib3>=1.24.2
bumpversion~=0.5.3
aiohttp~=3.8.3
aiohttp~=3.8.3; python_version >= '3.7'
mocket~=1.6.0
pytest-asyncio~=0.20.3
pytest-asyncio~=0.20.3; python_version >= '3.7'
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jsonschema>=4.19.2
jsonschema~=4.0; python_version >= '3.6'
jsonschema~=3.0; python_version == '3.5'
xmltodict>=0.13.0
furl>=2.1.3
6 changes: 5 additions & 1 deletion tests/unit/interceptors/aiohttp_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import aiohttp
import sys
if sys.version_info >= (3, 7):
# Prevents import error when testing Python < 3.7
import aiohttp

import pook
import pytest

Expand Down
19 changes: 8 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = {py35,py36,py37,py38,py39,py310,py311,pypy}
envlist = {py35,py36,py37,py38,py39,py310,py311,pypy310}

[testenv]
setenv =
Expand All @@ -10,13 +10,10 @@ deps =
commands =
pytest

[gh]
python =
3.11 = py311
3.10 = py310
3.9 = py39
3.8 = py38
3.7 = py37
3.6 = py36
3.5 = py35
pypy3.11 = pypy311
[testenv:py36]
commands =
pytest -k 'not aiohttp'

[testenv:py35]
commands =
pytest -k 'not aiohttp'

0 comments on commit a1e57c4

Please sign in to comment.