Skip to content

Commit 4adc7aa

Browse files
committed
Adding poetry lock and updated CI
1 parent 26de3ea commit 4adc7aa

File tree

5 files changed

+3380
-125
lines changed

5 files changed

+3380
-125
lines changed

.github/workflows/main.yml

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
style:
1919
timeout-minutes: 10
2020
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
poetry-version: [1.1.14]
2124
steps:
2225
- name: Checkout repository
2326
uses: actions/checkout@v3
@@ -26,10 +29,14 @@ jobs:
2629
with:
2730
python-version: '3.9'
2831
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
2938
- 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
3340
- name: Run flake8
3441
uses: py-actions/flake8@v2
3542
with:
@@ -62,6 +69,7 @@ jobs:
6269
matrix:
6370
os: [ubuntu, macos, windows]
6471
python-version: [3.8, 3.9, "3.10"]
72+
poetry-version: [1.1.14]
6573
name: build ${{ matrix.os }} - py${{ matrix.python-version }}
6674
runs-on: ${{ matrix.os }}-latest
6775
defaults:
@@ -75,18 +83,25 @@ jobs:
7583
with:
7684
python-version: ${{ matrix.python-version }}
7785
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
7993
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 .
8395
- name: Test package install
8496
run: python -c "import pywhy_graphs; print(pywhy_graphs.__version__)"
8597
- name: Remove package install
8698
run: python -m pip uninstall -yq pywhy_graphs
99+
- name: Check poetry lock file
100+
run: poetry update --dry-run
87101
- name: Build package
88-
run: python -m build
102+
run: poetry build
89103
- name: Upload package distribution files
104+
if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' }}
90105
uses: actions/upload-artifact@v3
91106
with:
92107
name: package
@@ -111,6 +126,7 @@ jobs:
111126
matrix:
112127
os: [ubuntu, macos, windows]
113128
python-version: [3.8, "3.10"] # oldest and newest supported versions
129+
poetry-version: [1.1.14]
114130
networkx: [stable, main]
115131
name: pytest ${{ matrix.os }} - py${{ matrix.python-version }} - Networkx ${{ matrix.networkx }}
116132
runs-on: ${{ matrix.os }}-latest
@@ -127,23 +143,22 @@ jobs:
127143
with:
128144
python-version: ${{ matrix.python-version }}
129145
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
136153
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
141155
- name: Install Networkx (main)
142156
if: "matrix.networkx == 'main'"
143157
run: |
144158
python -m pip uninstall -yq networkx
159+
python -m pip install --progress-bar off git+https://github.com/networkx/networkx
145160
- 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
147162
- name: Upload coverage stats to codecov
148163
if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' && matrix.networkx == 'stable' }}
149164
uses: codecov/codecov-action@v3
@@ -169,7 +184,7 @@ jobs:
169184
- name: Install dependencies
170185
run: |
171186
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
173188
- name: Prepare environment
174189
run: |
175190
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ __pycache__/
44
*$py.class
55

66
.vscode
7+
junit-results.xml
78

89
# C extensions
910
*.so

junit-results.xml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)