@@ -5,126 +5,122 @@ name: Tests
5
5
6
6
on :
7
7
push :
8
- branches : [ master, development, develop, test, tests ]
8
+ branches : [ test, tests ]
9
9
pull_request :
10
10
branches : [ master, development, develop, test, tests ]
11
11
12
12
jobs :
13
- package -checks :
13
+ build -checks :
14
14
strategy :
15
15
matrix :
16
- python-version : ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
17
- os : [ubuntu-latest, macos-latest, windows-latest]
16
+ os : [ubuntu-latest, macos-12, windows-latest]
18
17
runs-on : ${{ matrix.os }}
18
+
19
19
steps :
20
20
- uses : actions/checkout@v3
21
- - name : Set up Python ${{ matrix.python-version }}
21
+
22
+ - name : Set up Python 3.11
22
23
uses : actions/setup-python@v4
23
24
with :
24
- python-version : ${{ matrix.python-version }}
25
- - uses : actions/cache@v2
26
- with :
27
- path : ~/.cache/pip
28
- key : package-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
29
- - name : Install dependencies
25
+ python-version : " 3.11"
26
+
27
+ - name : Build Wheels
28
+ env :
29
+ CIBW_SKIP : " cp36-* pp* *i686"
30
+ CIBW_BUILD_VERBOSITY : 1
31
+ CIBW_TEST_REQUIRES : " pytest msgpack ruamel.yaml tomli tomli-w"
32
+ CIBW_TEST_COMMAND : " pytest {package}/test"
30
33
run : |
31
34
python -m pip install --upgrade pip
32
- pip install -r requirements.txt
33
- pip install -r requirements-test.txt
34
- pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython
35
- - name : Lint with flake8
36
- run : |
37
- # stop the build if there are Python syntax errors, undefined names or print statements
38
- flake8 box --count --select=E9,F63,F7,F82,T001,T002,T003,T004 --show-source --statistics
39
- # exit-zero treats all errors as warnings.
40
- flake8 . --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics --extend-ignore E203
41
- - name : Run mypy
42
- run : mypy box
43
- - name : Build Wheel and check distrubiton log description
44
- run : |
45
- python setup.py sdist bdist_wheel
46
- twine check dist/*
47
- - name : Test packaged wheel on *nix
48
- if : matrix.os != 'windows-latest'
49
- run : |
50
- pip install dist/*.whl
51
- rm -rf box
52
- python -m pytest
53
- - name : Test packaged wheel on Windows
54
- if : matrix.os == 'windows-latest'
55
- run : |
56
- $wheel = (Get-ChildItem dist\*.whl | Sort lastWriteTime | Select-Object -last 1).Name
57
- pip install dist\${wheel}
58
- Remove-item box -recurse -force
59
- python -m pytest
35
+ python -m pip install cibuildwheel --upgrade
36
+ python -m cibuildwheel --output-dir wheels
37
+
60
38
- name : Upload wheel artifact
61
39
uses : actions/upload-artifact@v2
62
40
with :
63
41
name : python_box
64
- path : dist /*.whl
42
+ path : wheels /*.whl
65
43
66
- package-manylinux-checks :
44
+ lint-and-mypy :
67
45
runs-on : ubuntu-latest
68
46
steps :
69
- - uses : actions/checkout@v3
70
- - name : Set up Python 3.10
71
- uses : actions/setup-python@v4
72
- with :
73
- python-version : " 3.10"
47
+ - uses : actions/checkout@v3
74
48
75
- - uses : actions/cache@v2
76
- with :
77
- path : ~/.cache/pip
78
- key : package-manylinux-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
79
- - name : Install dependencies
80
- run : |
81
- python -m pip install --upgrade pip
82
- pip install -r requirements.txt
83
- pip install -r requirements-test.txt
84
- pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython
49
+ - name : Set up Python 3.11
50
+ uses : actions/setup-python@v4
51
+ with :
52
+ python-version : " 3.11"
85
53
86
- -
uses :
RalfG/[email protected] _x86_64
87
- with :
88
- python-versions : ' cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 '
89
- build-requirements : ' cython '
54
+ - uses : actions/cache@v2
55
+ with :
56
+ path : ~/.cache/pip
57
+ key : lint-and-mypy-${{ hashFiles('pyproject.toml') }}
90
58
91
- - name : Test packaged wheel on linux
92
- run : |
93
- pip install dist/*cp310-manylinux*.whl
94
- rm -rf box
95
- python -m pytest
59
+ - name : Install Dependencies
60
+ run : |
61
+ python -m pip install poetry --upgrade
62
+ poetry config virtualenvs.create false --local
96
63
97
- - name : Upload wheel artifact
98
- uses : actions/upload-artifact@v2
99
- with :
100
- name : python_box
101
- path : dist/*-manylinux*.whl
64
+ - name : Poetry Install
65
+ run : poetry install --with dev
66
+ continue-on-error : true
67
+
68
+ - name : Poetry Install 2
69
+ run : poetry install --with dev
70
+
71
+ - name : Lint with flake8
72
+ run : |
73
+ # stop the build if there are Python syntax errors, undefined names or print statements
74
+ python -m flake8 box --count --select=E9,F63,F7,F82,T001,T002,T003,T004 --show-source --statistics
75
+ # exit-zero treats all errors as warnings.
76
+ python -m flake8 . --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics --extend-ignore E203
102
77
103
- test :
78
+ - name : Run mypy
79
+ run : python -m mypy box
80
+
81
+ - name : Build Wheel and Check Distribution Log Description
82
+ run : |
83
+ poetry build
84
+ python -m twine check dist/*
85
+
86
+ test-non-cython :
104
87
strategy :
105
88
matrix :
106
89
python-version : ["3.7", "3.8", "3.9", "3.10", "3.11"]
107
90
os : [ubuntu-latest, macos-latest, windows-latest]
108
91
runs-on : ${{ matrix.os }}
109
92
steps :
110
93
- uses : actions/checkout@v3
94
+
111
95
- name : Set up Python ${{ matrix.python-version }}
112
96
uses : actions/setup-python@v4
113
97
with :
114
98
python-version : ${{ matrix.python-version }}
99
+
115
100
- uses : actions/cache@v2
116
101
with :
117
102
path : ~/.cache/pip
118
- key : test-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
119
- - name : Install dependencies
103
+ key : test-${{ hashFiles('pyproject.toml') }}
104
+
105
+ - name : Install Dependencies
120
106
run : |
121
107
python -m pip install --upgrade pip
122
- pip install -r requirements.txt
123
- pip install -r requirements-test.txt
124
- pip install setuptools wheel Cython
125
- python setup.py build_ext --inplace
108
+ pip install poetry --upgrade
109
+ poetry config virtualenvs.create false --local
110
+
111
+ - name : Poetry Install
112
+ run : poetry install --with dev --with test
113
+ continue-on-error : true
114
+
115
+ - name : Poetry Install 2
116
+ run : poetry install --with dev --with test
117
+
118
+ - name : Poetry Build
119
+ run : poetry build
120
+ continue-on-error : true
121
+
126
122
- name : Test with pytest
127
123
env :
128
124
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
129
125
run : |
130
- pytest --cov=box test/
126
+ python -m pytest --cov=box test/
0 commit comments