diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..638d9093 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: python -m pip install --upgrade pip wheel tox + - run: tox -e flake8 + tests: + name: tests + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - run: python -m pip install --upgrade pip wheel + - run: pip install tox tox-gh-actions + - run: tox + coverage: + name: coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: python -m pip install --upgrade pip wheel + - run: pip install tox codecov + - run: tox -e covarage + - run: codecov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8c59515a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: python - -python: - - "2.7" - - "3.5" - - "3.6" - - "3.7" - - "3.8" - -# command to install dependencies -install: - - pip install . - - pip install coverage coveralls flake8 flask-wtf flask-sqlalchemy pytest pytest-runner - -# command to run tests -script: - - coverage run --source=flask_bootstrap setup.py test - - flake8 flask_bootstrap tests - -after_success: coveralls diff --git a/flask_bootstrap/__init__.py b/flask_bootstrap/__init__.py index c87323a6..bab5c2ba 100644 --- a/flask_bootstrap/__init__.py +++ b/flask_bootstrap/__init__.py @@ -7,7 +7,7 @@ """ from flask import current_app, Markup, Blueprint, url_for -try: # pragma: no cover +try: # pragma: no cover from wtforms.fields import HiddenField except ImportError: def is_hidden_field_filter(field): diff --git a/setup.cfg b/setup.cfg index de9602f1..5d578c2c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,12 +17,8 @@ exclude = static,.git,*migrations*,build,.tox,docs max-line-length = 119 max-complexity = 7 -[options] -setup_requires = pytest-runner -tests_require = pytest - [aliases] test = pytest [tool:pytest] -testpaths = tests \ No newline at end of file +testpaths = tests diff --git a/tests/test_bootstrap.py b/tests/test_bootstrap.py index 1c266cbe..ec0f5411 100644 --- a/tests/test_bootstrap.py +++ b/tests/test_bootstrap.py @@ -55,7 +55,7 @@ def test_cdn_resources(self, bootstrap, client): assert '/bootstrap/static/js/bootstrap.min.js' not in js_rv assert 'https://cdn.jsdelivr.net/npm/bootstrap' in css_rv assert 'https://cdn.jsdelivr.net/npm/bootstrap' in js_rv - + @pytest.mark.parametrize( ['with_jquery', 'with_popper'], [ diff --git a/tox.ini b/tox.ini index ad1f1a7e..4f849ca2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,31 +1,36 @@ [tox] -envlist = py27, py35, py36, py37, py38 +envlist = py27, py35, py36, py37, py38, py39 skip_missing_interpreters = true skipsdist = true +[gh-actions] +python = + 2.7: py27 + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + [testenv] deps = pytest flask-wtf flask-sqlalchemy commands = - python setup.py test - -[testenv:coverage] -basepython = python2.7 -deps = pytest - coverage - flask-wtf - flask-sqlalchemy -commands = - coverage run --source=flask_bootstrap setup.py test - coverage report - coverage html [testenv:flake8] -basepython = python2.7 +deps = + flake8 commands = flake8 flask_bootstrap tests + +[testenv:covarage] deps = - flake8 + pytest + pytest-cov + flask-wtf + flask-sqlalchemy +commands = + pytest --cov=flask_bootstrap --cov-branch