Skip to content

Commit d1c039c

Browse files
Merge pull request #4 from source-foundry/add-py-ci
Add Python CI
2 parents b4e21da + 7c3f000 commit d1c039c

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

.github/workflows/python-ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Python CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
11+
python-version: [3.9]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Display Python version & architecture
20+
run: |
21+
python -c "import sys; print(sys.version)"
22+
python -c "import struct; print(struct.calcsize('P') * 8)"
23+
- name: Install testing dependencies
24+
run: python -m pip install --upgrade pip setuptools wheel tox tox-gh-actions
25+
- name: Run tox tests
26+
run: python -m tox

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-r requirements.txt
12
pytest
23
pytest-qt
34
tox

setup.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ universal = 0
55
max-line-length = 90
66

77
[tool:pytest]
8+
minversion = 3.0
9+
testpaths = tests
810
qt_log_level_fail = CRITICAL
9-
qt_api=pyqt5
11+
qt_api=pyqt5
12+
addopts =
13+
-r a

tests/test_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from slice.ui.widgets import DragDropLineEdit
77

88

9-
def test_drag_drop_line_edit(qtbot):
9+
def test_drag_drop_line_edit():
1010
widget1 = QWidget()
1111
widget2 = DragDropLineEdit(widget1)
1212
# placeholder text

tox.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@ envlist = py38
33

44
[testenv]
55
commands =
6-
py.test
6+
pytest {posargs}
77
deps =
88
-rrequirements.txt
99
pytest
1010
pytest-qt
11+
12+
[gh-actions]
13+
python =
14+
3.6: py36
15+
3.7: py37
16+
3.8: py38
17+
3.9: py39

0 commit comments

Comments
 (0)