Skip to content

Commit

Permalink
Merge pull request #92 from dmtucker/actions
Browse files Browse the repository at this point in the history
Drop py34, add GitHub Actions and a tox env for publishing
  • Loading branch information
dmtucker authored Jul 21, 2020
2 parents 8c99601 + a88c129 commit f243369
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 31 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 3 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
dist: xenial
language: python
python:
- '3.4'
- '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__
Expand All @@ -24,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"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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'
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand All @@ -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',
Expand Down
9 changes: 4 additions & 5 deletions tests/test_pytest_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
18 changes: 17 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@
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}
py38-pytest{3.5, 3.x, 4.0, 4.x, 5.0, 5.x}-mypy{0.71, 0.7x}
publish
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}, publish, static

[testenv]
deps =
pytest3.5: pytest ~= 3.5.0
Expand Down Expand Up @@ -82,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
Expand Down

0 comments on commit f243369

Please sign in to comment.