Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b1c09f6
minimal gha
altendky Jan 16, 2021
d923e21
add in actual testing
altendky Jan 16, 2021
9dddf84
misc
altendky Jan 16, 2021
a669510
actually use coverage in tox
altendky Jan 16, 2021
6f114d0
coverage xml
altendky Jan 16, 2021
e09746c
skip coveralls upload for now
altendky Jan 16, 2021
1117b1b
remove travis to avoid continued spamming with pointless builds
altendky Jan 16, 2021
d755332
adjust py2 exclusions
altendky Jan 16, 2021
a0fb7f9
coverage xml --ignore-errors
altendky Jan 16, 2021
e52dfa2
fix python action for pypy
altendky Jan 16, 2021
612dbfb
add matrix.python.implementation
altendky Jan 16, 2021
f62b12d
use twisted's serial extra
altendky Jan 16, 2021
f599c3b
pytest-cov for xml
altendky Jan 16, 2021
d64ec35
exclude windows and macos
altendky Jan 16, 2021
36dba19
Fixup test_client_async[_tornado].py for py2 testing
altendky Jan 16, 2021
b12dd6a
add cpython39 to tox.ini
altendky Jan 16, 2021
9a98534
preliminary addition of checks
altendky Jan 16, 2021
9615b68
switch to the maintained m2r2 fork
altendky Jan 16, 2021
5faa8fe
python3.7 for checks
altendky Jan 17, 2021
5fe4e4a
a bit more for flake8
altendky Jan 17, 2021
26c0f16
back to 3.8 for checks and continue on error for flake8
altendky Jan 17, 2021
b490edb
${{ }}
altendky Jan 17, 2021
42a93cc
remove coveralls for now
altendky Jan 20, 2021
35e1468
touchup conftest.py
altendky Jan 20, 2021
50c723a
drop basepython for flake8 environment
altendky Jan 20, 2021
4f7413d
intra-gha combined coverage
altendky Jan 20, 2021
5e03ca7
coverage: true
altendky Jan 20, 2021
99e24a2
.
altendky Jan 20, 2021
cc5c0d6
ls -la coverage_reports
altendky Jan 20, 2021
9d11bae
remove copy/paste error qt references
altendky Jan 20, 2021
4993a38
Handle unspecified continue_on_error better
altendky Jan 27, 2021
e5157c2
Handle unspecified continue_on_error better (again)
altendky Jan 27, 2021
c4ddc9f
Merge branch 'dev' into gha
altendky Feb 9, 2021
1f2c18e
--fail-under=85
altendky Feb 9, 2021
1cae331
skip test_client_async_asyncio as well in py2
altendky Feb 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
name: CI

on:
push:
branches:
- dev
- master
tags:
- v*
pull_request:
branches:
- "*"
schedule:
# Daily at 05:14
- cron: '14 5 * * *'

jobs:
test:
# Should match JOB_NAME below
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on }}
container: ${{ matrix.os.container[matrix.python.docker] }}
strategy:
fail-fast: false
matrix:
task:
- name: Test
tox: test
coverage: true
os:
- name: Linux
runs-on: ubuntu-latest
python_platform: linux
matrix: linux
container:
2.7: docker://python:2.7-buster
3.6: docker://python:3.6-buster
3.7: docker://python:3.7-buster
3.8: docker://python:3.8-buster
3.9: docker://python:3.9-buster
pypy2: docker://pypy:2-jessie
pypy3: docker://pypy:3-stretch
# - name: Windows
# runs-on: windows-latest
# python_platform: win32
# matrix: windows
# - name: macOS
# runs-on: macos-latest
# python_platform: darwin
# matrix: macos
python:
- name: CPython 2.7
tox: py27
action: 2.7
docker: 2.7
implementation: cpython
- name: PyPy 2.7
tox: pypy27
action: pypy-2.7
docker: pypy2.7
implementation: pypy
- name: CPython 3.6
tox: py36
action: 3.6
docker: 3.6
implementation: cpython
- name: CPython 3.7
tox: py37
action: 3.7
docker: 3.7
implementation: cpython
- name: CPython 3.8
tox: py38
action: 3.8
docker: 3.8
implementation: cpython
- name: CPython 3.9
tox: py39
action: 3.9
docker: 3.9
implementation: cpython
- name: PyPy 3.6
tox: pypy36
action: pypy-3.6
docker: pypy3.6
implementation: pypy
- name: PyPy 3.7
tox: pypy37
action: pypy-3.7
docker: pypy3.7
implementation: pypy
arch:
- name: x86
action: x86
matrix: x86
- name: x64
action: x64
matrix: x64
exclude:
- os:
matrix: linux
arch:
matrix: x86
- os:
matrix: macos
arch:
matrix: x86
env:
# Should match name above
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up ${{ matrix.python.name }} (if CPython)
if: ${{ job.container == '' && matrix.python.implementation == 'cpython'}}
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python.action }}.0-alpha - ${{ matrix.python.action }}.X'
architecture: '${{ matrix.arch.action }}'
- name: Set up ${{ matrix.python.name }} (if PyPy)
if: ${{ job.container == '' && matrix.python.implementation == 'pypy'}}
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python.action }}'
architecture: '${{ matrix.arch.action }}'
- name: Install
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade tox
- uses: twisted/python-info-action@v1.0.1
- name: Test
run: |
tox -vv -e ${{ matrix.python.tox }}
- name: Coverage Processing
if: matrix.task.coverage
run: |
mkdir coverage_reports
cp .coverage "coverage_reports/.coverage.${{ env.JOB_NAME }}"
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_NAME }}.xml"
- name: Upload Coverage
if: matrix.task.coverage
uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage_reports/*
check:
# Should match JOB_NAME below
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on }}
container: ${{ matrix.os.container[matrix.python.docker] }}
strategy:
fail-fast: false
matrix:
task:
- name: flake8
tox: flake8
continue_on_error: true
- name: Docs
tox: docs
os:
- name: Linux
runs-on: ubuntu-latest
python_platform: linux
matrix: linux
container:
3.8: docker://python:3.8-buster
python:
- name: CPython 3.8
tox: py38
action: 3.8
docker: 3.8
implementation: cpython
arch:
- name: x64
action: x64
matrix: x64
env:
# Should match name above
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade tox
- uses: twisted/python-info-action@v1.0.1
- name: Test
continue-on-error: ${{ matrix.task.continue_on_error == true }}
run: |
tox -vv -e ${{ matrix.task.tox }}
coverage:
# Should match JOB_NAME below
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on }}
needs:
- test
container: ${{ matrix.os.container[matrix.python.docker] }}
strategy:
fail-fast: false
matrix:
task:
- name: Coverage
tox: combined-coverage
download_coverage: true
os:
- name: Linux
runs-on: ubuntu-latest
python_platform: linux
matrix: linux
container:
3.8: docker://python:3.8-buster
python:
- name: CPython 3.8
tox: py38
action: 3.8
docker: 3.8
implementation: cpython
arch:
- name: x64
action: x64
matrix: x64
env:
# Should match name above
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install
run: |
pip install --upgrade pip setuptools wheel
pip install --upgrade tox
- uses: twisted/python-info-action@v1.0.1
- name: Download Coverage
if: matrix.task.download_coverage
uses: actions/download-artifact@v2
with:
name: coverage
path: coverage_reports
- name: Test
continue-on-error: ${{ matrix.task.continue_on_error == true }}
run: |
tox -vv -e ${{ matrix.task.tox }}
all:
name: All
runs-on: ubuntu-latest
needs:
- check
- coverage
- test
steps:
- name: This
shell: python
run: |
import this
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# ones.

#extensions = ['sphinx.ext.autodoc', 'm2r', 'recommonmark']
extensions = ['sphinx.ext.autodoc', 'm2r']
extensions = ['sphinx.ext.autodoc', 'm2r2']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
1 change: 1 addition & 0 deletions requirements-coverage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage >= 4.2
2 changes: 1 addition & 1 deletion requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ tornado>=4.5.3 # Required to parse some files
Twisted>=17.1.0 # Required to parse some files
prompt_toolkit>=2.0.4
click>=7.0
m2r>=0.2.0
m2r2>=0.2.0

4 changes: 2 additions & 2 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bcrypt>=3.1.6
capturer >= 2.2
coverage >= 4.2
-r requirements-coverage.txt
cryptography>= 2.3
mock >= 1.0.1
pyserial-asyncio>=0.4.0;python_version>="3.4"
Expand All @@ -14,6 +14,6 @@ sqlalchemy>=1.1.15
#wsgiref>=0.1.2
verboselogs >= 1.5
tornado==4.5.3
Twisted>=20.3.0
Twisted[serial]>=20.3.0
zope.interface>=4.4.0
asynctest>=0.10.0
11 changes: 0 additions & 11 deletions scripts/travis.sh

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
'sphinx_rtd_theme',
'humanfriendly'],
'twisted': [
'twisted >= 20.3.0',
'twisted[serial] >= 20.3.0',
'pyasn1 >= 0.1.4',
],
'tornado': [
Expand Down
11 changes: 8 additions & 3 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
from pymodbus.compat import IS_PYTHON3, PYTHON_VERSION
if not IS_PYTHON3 or IS_PYTHON3 and PYTHON_VERSION.minor < 7:
collect_ignore = ["test_server_asyncio.py"]
from pymodbus.compat import PYTHON_VERSION
if PYTHON_VERSION < (3,):
# These files use syntax introduced between Python 2 and our lowest
# supported Python 3 version. We just won't run these tests in Python 2.
collect_ignore = [
"test_client_async_asyncio.py",
"test_server_asyncio.py",
]
30 changes: 27 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,36 @@
# directory.

[tox]
envlist = py27, py35, py36, py37, pypy
envlist = py{27,py27,36,37,38,39,py36,py37}

[testenv]
deps = -r requirements-tests.txt
commands = py.test {posargs}
setenv = with_gmp=no
commands =
pytest {posargs:--cov=pymodbus/ --cov-report=term-missing --cov-report=xml}
setenv =
with_gmp=no

[testenv:flake8]
deps = -r requirements-checks.txt
commands =
flake8

[testenv:docs]
allowlist_externals =
make
deps = -r requirements-docs.txt
commands =
make -C doc/ clean
make -C doc/ html

[testenv:combined-coverage]
allowlist_externals =
ls
deps = -r requirements-coverage.txt
commands =
ls -la coverage_reports
coverage combine coverage_reports
coverage report --fail-under=85 --ignore-errors

[flake8]
exclude = .tox
Expand Down