From f637a86ce69ca3ad70e9374874253d084630ef5c Mon Sep 17 00:00:00 2001 From: masklinn Date: Sun, 1 May 2022 12:27:12 +0200 Subject: [PATCH] Add a bunch of new python versions (and pypy) to the CI 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 --- .github/workflows/ci.yml | 6 +++--- setup.py | 2 ++ tox.ini | 35 +++++++++++++++++------------------ 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dab4e3d..362d14b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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' }} diff --git a/setup.py b/setup.py index 90fdbec..ae2fe19 100644 --- a/setup.py +++ b/setup.py @@ -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", ], diff --git a/tox.ini b/tox.ini index b166425..41df6a3 100644 --- a/tox.ini +++ b/tox.ini @@ -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/