Skip to content

Commit

Permalink
Add a bunch of new python versions (and pypy) to the CI
Browse files Browse the repository at this point in the history
Also to the local tox, and try to rewrite tox.ini to make it more
reliable (wip):

- don't sdist into the repository, just develop into it matching the
  CI (and in a way the old expectations, given the old `setup.py
  develop` stanza)
- don't install the package at all into the checker environments, it's
  entirely unnecessay
- add doctesting of the readme to tox, in order to match the CI
  action, opt 2.7 out for the same reasons: changes in pprint's
  formatting between 2.7 and 3.5 make them incompatible, ignore 2.7
- requirements.txt was removed previously, use the dev requirements

Related to: #102
Closes: #111
  • Loading branch information
masklinn authored May 1, 2022
1 parent 69a7a69 commit f637a86
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.8"
python-version: "3.10"
- name: Install checkers
run: |
python -mpip install --upgrade pip
Expand All @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8"]
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-alpha.7", "pypy-3.8"]

steps:
- name: Checkout working copy
Expand All @@ -48,7 +48,7 @@ jobs:
- name: tests
run: |
python setup.py develop
python ./ua_parser/user_agent_parser_test.py
env time -v python ./ua_parser/user_agent_parser_test.py
- name: doctests
# pprint formatting was changed a lot in 3.5
if: ${{ matrix.python-version != '2.7' }}
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ class sdist(_sdist):
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down
35 changes: 17 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
[tox]
envlist = py27, py36, py37, py38, docs, py27-flake8, py36-flake8, py36-black
envlist = py27, py36, py37, py38, py39, py310, docs, flake8, black
skipsdist = True

[testenv]
deps =
-rrequirements.txt
usedevelop = True
deps = -rrequirements_dev.txt
commands =
python setup.py develop
python ua_parser/user_agent_parser_test.py
python -mdoctest README.rst

[testenv:py27]
# no doctesting in 2.7 because of formatting divergences
commands = python ua_parser/user_agent_parser_test.py

[testenv:docs]
basepython = python2.7
skip_install = True
deps = docutils
Pygments
commands =
python setup.py check -s --restructuredtext --metadata

[testenv:py27-flake8]
basepython = python2.7
deps = flake8
commands = flake8 {posargs}
commands = python setup.py check -s --restructuredtext --metadata

[testenv:py36-flake8]
basepython = python3.6
[testenv:flake8]
skip_install = True
deps = flake8
commands = flake8 {posargs}

[testenv:py36-black]
basepython = python3.6
[testenv:black]
skip_install = True
deps = black
commands = black --check .
commands = black --check --diff .

[flake8]
max_line_length = 88
exclude = .git,.tox,dist,docs,_regexes.py,*_test.py,.eggs
filename = ua_parser/

0 comments on commit f637a86

Please sign in to comment.