From c2665eb405064ba69fec08cb0c5cd9eeb2e7d3a0 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Wed, 29 May 2019 23:21:32 -0700 Subject: [PATCH 1/4] Drop support for Python 3.4 --- .travis.yml | 1 - pyproject.toml | 2 +- setup.py | 9 +++------ tests/test_pytest_mypy.py | 9 ++++----- tox.ini | 1 - 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 560d918..2a0fa29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ dist: xenial language: python python: -- '3.4' - '3.5' - '3.6' - '3.7' diff --git a/pyproject.toml b/pyproject.toml index c01b3dc..59ecba1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ['setuptools ~= 43.0.0', 'setuptools-scm ~= 3.5.0', 'wheel ~= 0.33.6'] +requires = ['setuptools ~= 45.2.0', 'setuptools-scm ~= 3.5.0', 'wheel ~= 0.34.0'] build-backend = 'setuptools.build_meta' diff --git a/setup.py b/setup.py index 9737a50..092571d 100644 --- a/setup.py +++ b/setup.py @@ -29,16 +29,14 @@ def read(fname): os.path.splitext(os.path.basename(path))[0] for path in glob.glob('src/*.py') ], - python_requires='>=3.4', + python_requires='>=3.5', setup_requires=[ 'setuptools-scm>=3.5', ], install_requires=[ 'filelock>=3.0', - 'pytest>=3.5,<4.7; python_version<"3.5"', - 'pytest>=3.5; python_version>="3.5"', - 'mypy>=0.500,<0.700; python_version<"3.5"', - 'mypy>=0.500; python_version>="3.5" and python_version<"3.8"', + 'pytest>=3.5', + 'mypy>=0.500; python_version<"3.8"', 'mypy>=0.700; python_version>="3.8"', ], classifiers=[ @@ -48,7 +46,6 @@ def read(fname): 'Topic :: Software Development :: Testing', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', diff --git a/tests/test_pytest_mypy.py b/tests/test_pytest_mypy.py index d00e824..eabca0e 100644 --- a/tests/test_pytest_mypy.py +++ b/tests/test_pytest_mypy.py @@ -255,8 +255,7 @@ def pyfunc(x: int) -> str: testdir.makepyfile(good=''' import bad ''') - xdist_args.append('good.py') # Nothing may come after xdist_args in py34. - result = testdir.runpytest_subprocess('--mypy', *xdist_args) + result = testdir.runpytest_subprocess('--mypy', *xdist_args, 'good.py') assert result.ret != 0 @@ -283,7 +282,7 @@ def pytest_collection_modifyitems(session, config, items): plugin.MypyFileItem(py.path.local('good.py'), session), ) ''') - testdir.mkdir('empty') - xdist_args.append('empty') # Nothing may come after xdist_args in py34. - result = testdir.runpytest_subprocess('--mypy', *xdist_args) + name = 'empty' + testdir.mkdir(name) + result = testdir.runpytest_subprocess('--mypy', *xdist_args, name) assert result.ret != 0 diff --git a/tox.ini b/tox.ini index b4a87cc..e48bb04 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,6 @@ min_version = 3.7.0 isolated_build = true envlist = - py34-pytest{3.5, 3.x, 4.0, 4.x}-mypy{0.50, 0.5x, 0.60, 0.6x} py35-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} py36-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} py37-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} From cd028f4890c562ec2adfb295add8e61a876f2b60 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Sun, 19 Jul 2020 18:04:36 -0700 Subject: [PATCH 2/4] Add a validation workflow for Github Actions --- .github/workflows/validation.yml | 15 +++++++++++++++ tox.ini | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 .github/workflows/validation.yml diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml new file mode 100644 index 0000000..f94974e --- /dev/null +++ b/.github/workflows/validation.yml @@ -0,0 +1,15 @@ +name: Validation +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.5, 3.6, 3.7, 3.8] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - run: python -m pip install --upgrade tox-gh-actions + - run: python -m tox diff --git a/tox.ini b/tox.ini index e48bb04..a22d234 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,13 @@ envlist = py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x} static +[gh-actions] +python = + 3.5: py35-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} + 3.6: py36-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} + 3.7: py37-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} + 3.8: py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x}, static + [testenv] deps = pytest3.5: pytest ~= 3.5.0 From 82418276969d525de0bd4eb4022fad72509e8ad5 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Sun, 19 Jul 2020 18:16:42 -0700 Subject: [PATCH 3/4] Add publish env to tox --- tox.ini | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a22d234..3e64798 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py36-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} py37-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x} + publish static [gh-actions] @@ -14,7 +15,7 @@ python = 3.5: py35-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} 3.6: py36-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} 3.7: py37-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x} - 3.8: py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x}, static + 3.8: py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x}, publish, static [testenv] deps = @@ -88,6 +89,15 @@ deps = pytest-randomly ~= 2.1.1 commands = py.test -p no:mypy --cov pytest_mypy --cov-fail-under 100 --cov-report term-missing {posargs:-n auto} tests +[testenv:publish] +passenv = TWINE_* +deps = + pep517 ~= 0.8.0 + twine ~= 3.2.0 +commands = + {envpython} -m pep517.build --out-dir {distdir} . + twine {posargs:check} {distdir}/* + [testenv:static] deps = bandit ~= 1.6.2 From a88c1291811c679ecd5ee9e4d612553d2a160665 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Sun, 19 Jul 2020 18:30:36 -0700 Subject: [PATCH 4/4] Use Travis CI for publishing only --- .travis.yml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2a0fa29..ea1fb2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,8 @@ dist: xenial language: python -python: -- '3.5' -- '3.6' -- '3.7' -- '3.8' -install: pip install 'tox-travis ~= 0.12.0' -script: tox -jobs: - include: - - name: Static Analysis - python: '3.8' - script: tox -e static +python: '3.8' +install: pip install tox +script: tox -e publish deploy: provider: pypi user: __token__ @@ -23,8 +14,3 @@ deploy: repo: dbader/pytest-mypy tags: true python: '3.8' -before_cache: -- rm -rf $HOME/.cache/pip/log -cache: - directories: - - "$HOME/.cache/pip"