Skip to content

Commit f243369

Browse files
authored
Merge pull request #92 from dmtucker/actions
Drop py34, add GitHub Actions and a tox env for publishing
2 parents 8c99601 + a88c129 commit f243369

File tree

6 files changed

+43
-31
lines changed

6 files changed

+43
-31
lines changed

.github/workflows/validation.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Validation
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
python-version: [3.5, 3.6, 3.7, 3.8]
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-python@v2
12+
with:
13+
python-version: ${{ matrix.python-version }}
14+
- run: python -m pip install --upgrade tox-gh-actions
15+
- run: python -m tox

.travis.yml

+3-18
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
dist: xenial
22
language: python
3-
python:
4-
- '3.4'
5-
- '3.5'
6-
- '3.6'
7-
- '3.7'
8-
- '3.8'
9-
install: pip install 'tox-travis ~= 0.12.0'
10-
script: tox
11-
jobs:
12-
include:
13-
- name: Static Analysis
14-
python: '3.8'
15-
script: tox -e static
3+
python: '3.8'
4+
install: pip install tox
5+
script: tox -e publish
166
deploy:
177
provider: pypi
188
user: __token__
@@ -24,8 +14,3 @@ deploy:
2414
repo: dbader/pytest-mypy
2515
tags: true
2616
python: '3.8'
27-
before_cache:
28-
- rm -rf $HOME/.cache/pip/log
29-
cache:
30-
directories:
31-
- "$HOME/.cache/pip"

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ['setuptools ~= 43.0.0', 'setuptools-scm ~= 3.5.0', 'wheel ~= 0.33.6']
2+
requires = ['setuptools ~= 45.2.0', 'setuptools-scm ~= 3.5.0', 'wheel ~= 0.34.0']
33
build-backend = 'setuptools.build_meta'

setup.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,14 @@ def read(fname):
2929
os.path.splitext(os.path.basename(path))[0]
3030
for path in glob.glob('src/*.py')
3131
],
32-
python_requires='>=3.4',
32+
python_requires='>=3.5',
3333
setup_requires=[
3434
'setuptools-scm>=3.5',
3535
],
3636
install_requires=[
3737
'filelock>=3.0',
38-
'pytest>=3.5,<4.7; python_version<"3.5"',
39-
'pytest>=3.5; python_version>="3.5"',
40-
'mypy>=0.500,<0.700; python_version<"3.5"',
41-
'mypy>=0.500; python_version>="3.5" and python_version<"3.8"',
38+
'pytest>=3.5',
39+
'mypy>=0.500; python_version<"3.8"',
4240
'mypy>=0.700; python_version>="3.8"',
4341
],
4442
classifiers=[
@@ -48,7 +46,6 @@ def read(fname):
4846
'Topic :: Software Development :: Testing',
4947
'Programming Language :: Python',
5048
'Programming Language :: Python :: 3',
51-
'Programming Language :: Python :: 3.4',
5249
'Programming Language :: Python :: 3.5',
5350
'Programming Language :: Python :: 3.6',
5451
'Programming Language :: Python :: 3.7',

tests/test_pytest_mypy.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,7 @@ def pyfunc(x: int) -> str:
255255
testdir.makepyfile(good='''
256256
import bad
257257
''')
258-
xdist_args.append('good.py') # Nothing may come after xdist_args in py34.
259-
result = testdir.runpytest_subprocess('--mypy', *xdist_args)
258+
result = testdir.runpytest_subprocess('--mypy', *xdist_args, 'good.py')
260259
assert result.ret != 0
261260

262261

@@ -283,7 +282,7 @@ def pytest_collection_modifyitems(session, config, items):
283282
plugin.MypyFileItem(py.path.local('good.py'), session),
284283
)
285284
''')
286-
testdir.mkdir('empty')
287-
xdist_args.append('empty') # Nothing may come after xdist_args in py34.
288-
result = testdir.runpytest_subprocess('--mypy', *xdist_args)
285+
name = 'empty'
286+
testdir.mkdir(name)
287+
result = testdir.runpytest_subprocess('--mypy', *xdist_args, name)
289288
assert result.ret != 0

tox.ini

+17-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
min_version = 3.7.0
44
isolated_build = true
55
envlist =
6-
py34-pytest{3.5, 3.x, 4.0, 4.x}-mypy{0.50, 0.5x, 0.60, 0.6x}
76
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}
87
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}
98
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}
109
py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x}
10+
publish
1111
static
1212

13+
[gh-actions]
14+
python =
15+
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}
16+
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}
17+
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}
18+
3.8: py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x}, publish, static
19+
1320
[testenv]
1421
deps =
1522
pytest3.5: pytest ~= 3.5.0
@@ -82,6 +89,15 @@ deps =
8289
pytest-randomly ~= 2.1.1
8390
commands = py.test -p no:mypy --cov pytest_mypy --cov-fail-under 100 --cov-report term-missing {posargs:-n auto} tests
8491

92+
[testenv:publish]
93+
passenv = TWINE_*
94+
deps =
95+
pep517 ~= 0.8.0
96+
twine ~= 3.2.0
97+
commands =
98+
{envpython} -m pep517.build --out-dir {distdir} .
99+
twine {posargs:check} {distdir}/*
100+
85101
[testenv:static]
86102
deps =
87103
bandit ~= 1.6.2

0 commit comments

Comments
 (0)