Skip to content

Commit ef40c98

Browse files
committed
Merge branch 'gha' into test_macos
2 parents 635f0a7 + 9d11bae commit ef40c98

File tree

8 files changed

+138
-20
lines changed

8 files changed

+138
-20
lines changed

.github/workflows/ci.yml

Lines changed: 107 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
jobs:
1818
test:
1919
# Should match JOB_NAME below
20-
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.qt_library.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
20+
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
2121
runs-on: ${{ matrix.os.runs-on }}
2222
container: ${{ matrix.os.container[matrix.python.docker] }}
2323
strategy:
@@ -107,7 +107,7 @@ jobs:
107107
matrix: x86
108108
env:
109109
# Should match name above
110-
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.qt_library.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
110+
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
111111
steps:
112112
- uses: actions/checkout@v2
113113
with:
@@ -127,7 +127,7 @@ jobs:
127127
- name: Install
128128
run: |
129129
pip install --upgrade pip setuptools wheel
130-
pip install --upgrade tox coveralls
130+
pip install --upgrade tox
131131
- uses: twisted/[email protected]
132132
- name: Test
133133
run: |
@@ -136,20 +136,120 @@ jobs:
136136
if: matrix.task.coverage
137137
run: |
138138
mkdir coverage_reports
139-
cp .coverage "coverage_reports/coverage.${{ env.JOB_NAME }}"
139+
cp .coverage "coverage_reports/.coverage.${{ env.JOB_NAME }}"
140140
cp coverage.xml "coverage_reports/coverage.${{ env.JOB_NAME }}.xml"
141-
# TODO: deal with the classic secrets and forked PRs issue...
142-
# coveralls
143-
- name: Publish Coverage
141+
- name: Upload Coverage
144142
if: matrix.task.coverage
145143
uses: actions/upload-artifact@v2
146144
with:
147145
name: coverage
148146
path: coverage_reports/*
147+
check:
148+
# Should match JOB_NAME below
149+
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
150+
runs-on: ${{ matrix.os.runs-on }}
151+
container: ${{ matrix.os.container[matrix.python.docker] }}
152+
strategy:
153+
fail-fast: false
154+
matrix:
155+
task:
156+
- name: flake8
157+
tox: flake8
158+
continue_on_error: true
159+
- name: Docs
160+
tox: docs
161+
os:
162+
- name: Linux
163+
runs-on: ubuntu-latest
164+
python_platform: linux
165+
matrix: linux
166+
container:
167+
3.8: docker://python:3.8-buster
168+
python:
169+
- name: CPython 3.8
170+
tox: py38
171+
action: 3.8
172+
docker: 3.8
173+
implementation: cpython
174+
arch:
175+
- name: x64
176+
action: x64
177+
matrix: x64
178+
env:
179+
# Should match name above
180+
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
181+
steps:
182+
- uses: actions/checkout@v2
183+
with:
184+
fetch-depth: 0
185+
- name: Install
186+
run: |
187+
pip install --upgrade pip setuptools wheel
188+
pip install --upgrade tox
189+
- uses: twisted/[email protected]
190+
- name: Test
191+
continue-on-error: ${{ matrix.task.continue_on_error }}
192+
run: |
193+
tox -vv -e ${{ matrix.task.tox }}
194+
coverage:
195+
# Should match JOB_NAME below
196+
name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
197+
runs-on: ${{ matrix.os.runs-on }}
198+
needs:
199+
- test
200+
container: ${{ matrix.os.container[matrix.python.docker] }}
201+
strategy:
202+
fail-fast: false
203+
matrix:
204+
task:
205+
- name: Coverage
206+
tox: combined-coverage
207+
download_coverage: true
208+
os:
209+
- name: Linux
210+
runs-on: ubuntu-latest
211+
python_platform: linux
212+
matrix: linux
213+
container:
214+
3.8: docker://python:3.8-buster
215+
python:
216+
- name: CPython 3.8
217+
tox: py38
218+
action: 3.8
219+
docker: 3.8
220+
implementation: cpython
221+
arch:
222+
- name: x64
223+
action: x64
224+
matrix: x64
225+
env:
226+
# Should match name above
227+
JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }}
228+
steps:
229+
- uses: actions/checkout@v2
230+
with:
231+
fetch-depth: 0
232+
- name: Install
233+
run: |
234+
pip install --upgrade pip setuptools wheel
235+
pip install --upgrade tox
236+
- uses: twisted/[email protected]
237+
- name: Download Coverage
238+
if: matrix.task.download_coverage
239+
uses: actions/download-artifact@v2
240+
with:
241+
name: coverage
242+
path: coverage_reports
243+
- name: Test
244+
continue-on-error: ${{ matrix.task.continue_on_error }}
245+
run: |
246+
tox -vv -e ${{ matrix.task.tox }}
149247
all:
150248
name: All
151249
runs-on: ubuntu-latest
152250
needs:
251+
- check
252+
- coverage
153253
- test
154254
steps:
155255
- name: This

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# ones.
4848

4949
#extensions = ['sphinx.ext.autodoc', 'm2r', 'recommonmark']
50-
extensions = ['sphinx.ext.autodoc', 'm2r']
50+
extensions = ['sphinx.ext.autodoc', 'm2r2']
5151

5252
# Add any paths that contain templates here, relative to this directory.
5353
templates_path = ['_templates']

pymodbus/client/asynchronous/tornado/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def __init__(self, *args, **kwargs):
315315
self.silent_interval = 3.5 * self._t0
316316
self.silent_interval = round(self.silent_interval, 6)
317317
self.last_frame_end = 0.0
318-
super().__init__(*args, **kwargs)
318+
super(AsyncModbusSerialClient, self).__init__(*args, **kwargs)
319319

320320
def get_socket(self):
321321
"""

requirements-coverage.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage >= 4.2

requirements-docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ tornado>=4.5.3 # Required to parse some files
1313
Twisted>=17.1.0 # Required to parse some files
1414
prompt_toolkit>=2.0.4
1515
click>=7.0
16-
m2r>=0.2.0
16+
m2r2>=0.2.0
1717

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
bcrypt>=3.1.6
22
capturer >= 2.2
3-
coverage >= 4.2
3+
-r requirements-coverage.txt
44
cryptography>= 2.3
55
mock >= 1.0.1
66
pyserial-asyncio>=0.4.0;python_version>="3.4"

test/conftest.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
from pymodbus.compat import PYTHON_VERSION
2-
32
if PYTHON_VERSION < (3,):
4-
collect_ignore = [
5-
# TODO: do these really need to be ignored on py2 or can they just get
6-
# super() etc fixed?
7-
"test_client_async.py",
8-
"test_client_async_tornado.py",
9-
"test_server_asyncio.py",
10-
]
3+
# These files use syntax introduced between Python 2 and our lowest
4+
# supported Python 3 version. We just won't run these tests in Python 2.
5+
collect_ignore = ["test_server_asyncio.py"]

tox.ini

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# directory.
55

66
[tox]
7-
envlist = py{27,py27,36,37,38,py36,py37}
7+
envlist = py{27,py27,36,37,38,39,py36,py37}
88

99
[testenv]
1010
deps = -r requirements-tests.txt
@@ -13,6 +13,28 @@ commands =
1313
setenv =
1414
with_gmp=no
1515

16+
[testenv:flake8]
17+
deps = -r requirements-checks.txt
18+
commands =
19+
flake8
20+
21+
[testenv:docs]
22+
allowlist_externals =
23+
make
24+
deps = -r requirements-docs.txt
25+
commands =
26+
make -C doc/ clean
27+
make -C doc/ html
28+
29+
[testenv:combined-coverage]
30+
allowlist_externals =
31+
ls
32+
deps = -r requirements-coverage.txt
33+
commands =
34+
ls -la coverage_reports
35+
coverage combine coverage_reports
36+
coverage report --fail-under=90 --ignore-errors
37+
1638
[flake8]
1739
exclude = .tox
1840
ignore = D211,D400,E731

0 commit comments

Comments
 (0)