18
18
style :
19
19
timeout-minutes : 10
20
20
runs-on : ubuntu-latest
21
+ strategy :
22
+ matrix :
23
+ poetry-version : [1.1.14]
21
24
steps :
22
25
- name : Checkout repository
23
26
uses : actions/checkout@v3
@@ -26,10 +29,14 @@ jobs:
26
29
with :
27
30
python-version : ' 3.9'
28
31
architecture : ' x64'
32
+ - name : Install Poetry ${{ matrix.poetry-version }}
33
+ uses : abatilo/actions-poetry@v2.0.0
34
+ with :
35
+ poetry-version : ${{ matrix.poetry-version }}
36
+ - name : Install Poetry Dynamic Versioning Plugin
37
+ run : pip install poetry-dynamic-versioning
29
38
- name : Install dependencies
30
- run : |
31
- python -m pip install --progress-bar off --upgrade pip setuptools wheel
32
- python -m pip install --progress-bar off .[style]
39
+ run : poetry install
33
40
- name : Run flake8
34
41
uses : py-actions/flake8@v2
35
42
with :
62
69
matrix :
63
70
os : [ubuntu, macos, windows]
64
71
python-version : [3.8, 3.9, "3.10"]
72
+ poetry-version : [1.1.14]
65
73
name : build ${{ matrix.os }} - py${{ matrix.python-version }}
66
74
runs-on : ${{ matrix.os }}-latest
67
75
defaults :
@@ -75,18 +83,25 @@ jobs:
75
83
with :
76
84
python-version : ${{ matrix.python-version }}
77
85
architecture : ' x64'
78
- - name : Install dependencies
86
+ - name : Install Poetry ${{ matrix.poetry-version }}
87
+ uses : abatilo/actions-poetry@v2.0.0
88
+ with :
89
+ poetry-version : ${{ matrix.poetry-version }}
90
+ - name : Install Poetry Dynamic Versioning Plugin
91
+ run : pip install poetry-dynamic-versioning
92
+ - name : Install from source
79
93
run : |
80
- python -m pip install --progress-bar off git+https://github.com/py-why/graphs
81
- python -m pip install --progress-bar off --upgrade pip setuptools wheel
82
- python -m pip install --progress-bar off .[build]
94
+ python -m pip install -e .
83
95
- name : Test package install
84
96
run : python -c "import pywhy_graphs; print(pywhy_graphs.__version__)"
85
97
- name : Remove package install
86
98
run : python -m pip uninstall -yq pywhy_graphs
99
+ - name : Check poetry lock file
100
+ run : poetry update --dry-run
87
101
- name : Build package
88
- run : python -m build
102
+ run : poetry build
89
103
- name : Upload package distribution files
104
+ if : ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' }}
90
105
uses : actions/upload-artifact@v3
91
106
with :
92
107
name : package
@@ -111,6 +126,7 @@ jobs:
111
126
matrix :
112
127
os : [ubuntu, macos, windows]
113
128
python-version : [3.8, "3.10"] # oldest and newest supported versions
129
+ poetry-version : [1.1.14]
114
130
networkx : [stable, main]
115
131
name : pytest ${{ matrix.os }} - py${{ matrix.python-version }} - Networkx ${{ matrix.networkx }}
116
132
runs-on : ${{ matrix.os }}-latest
@@ -127,23 +143,22 @@ jobs:
127
143
with :
128
144
python-version : ${{ matrix.python-version }}
129
145
architecture : ' x64'
130
- - name : Install Qt dependencies
131
- if : " matrix.os == 'ubuntu'"
132
- run : |
133
- sudo apt update
134
- sudo apt install qt5-default
135
- - name : Install package
146
+ - name : Install Poetry ${{ matrix.poetry-version }}
147
+ uses : abatilo/actions-poetry@v2.0.0
148
+ with :
149
+ poetry-version : ${{ matrix.poetry-version }}
150
+ - name : Install Poetry Dynamic Versioning Plugin
151
+ run : pip install poetry-dynamic-versioning
152
+ - name : Install packages via poetry
136
153
run : |
137
- python -m pip install --progress-bar off --upgrade pip setuptools wheel
138
- python -m pip install --progress-bar off main/.[test]
139
- # TODO: remove this eventually
140
- python -m pip install --progress-bar off git+https://github.com/py-why/graphs
154
+ python -m poetry install
141
155
- name : Install Networkx (main)
142
156
if : " matrix.networkx == 'main'"
143
157
run : |
144
158
python -m pip uninstall -yq networkx
159
+ python -m pip install --progress-bar off git+https://github.com/networkx/networkx
145
160
- name : Run pytest # headless via Xvfb on linux
146
- run : pytest main/pywhy_graphs --cov=main/pywhy_graphs --cov-report=xml --cov-config=main/pyproject.toml
161
+ run : poetry run poe unit_test
147
162
- name : Upload coverage stats to codecov
148
163
if : ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' && matrix.networkx == 'stable' }}
149
164
uses : codecov/codecov-action@v3
@@ -169,7 +184,7 @@ jobs:
169
184
- name : Install dependencies
170
185
run : |
171
186
python -m pip install --progress-bar off --upgrade pip setuptools wheel
172
- python -m pip install --progress-bar off .[ build]
187
+ python -m pip install --progress-bar off build twine
173
188
- name : Prepare environment
174
189
run : |
175
190
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
0 commit comments