Skip to content

Commit 7151bed

Browse files
authored
[CI] Fix CI and update networkx dependency (#99)
* Remove python3.8 support --------- Signed-off-by: Adam Li <adam2392@gmail.com>
1 parent 608206e commit 7151bed

File tree

30 files changed

+1683
-1253
lines changed

30 files changed

+1683
-1253
lines changed

.circleci/config.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ orbs:
55

66
jobs:
77
build_doc:
8-
executor: python/default
8+
executor:
9+
name: python/default
10+
tag: "3.10"
911
steps:
1012
- restore_cache:
1113
name: Restore .git
@@ -46,7 +48,8 @@ jobs:
4648
- run:
4749
name: Install the latest version of Poetry
4850
command: |
49-
curl -sSL https://install.python-poetry.org | python3 - --version 1.5.0
51+
curl -sSL https://install.python-poetry.org | python3 - --version 1.6.1
52+
python --version
5053
poetry --version
5154
- run:
5255
name: Set BASH_ENV
@@ -65,30 +68,37 @@ jobs:
6568
name: Install pysal dependencies
6669
command: |
6770
sudo apt install libspatialindex-dev xdg-utils shared-mime-info desktop-file-utils
68-
- run:
69-
name: Setup torch for pgmpy
70-
command: |
71-
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
72-
7371
- run:
7472
name: Setup pandoc
7573
command: sudo apt update && sudo apt install -y pandoc optipng
7674

7775
- python/install-packages:
7876
pkg-manager: poetry
79-
cache-version: "v1" # change to clear cache
77+
cache-version: "v2" # change to clear cache
8078
args: "--with docs --extras viz --extras sims"
8179
- run:
8280
name: Check poetry package versions
8381
command: |
8482
poetry --version
8583
poetry show
84+
85+
- run:
86+
name: Setup torch for pgmpy
87+
command: |
88+
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
8689
- run:
8790
name: Check installation
8891
command: |
8992
poetry run python -c "import pywhy_graphs;"
9093
poetry run python -c "import numpy; numpy.show_config()"
9194
LIBGL_DEBUG=verbose poetry run python -c "import matplotlib.pyplot as plt; plt.figure()"
95+
96+
# dowhy currently requires an older version of numpy
97+
- run:
98+
name: Temporary Hack for numpy
99+
command: |
100+
poetry run python -m pip install numpy==1.22.0
101+
92102
- run:
93103
name: Build documentation
94104
command: |
@@ -152,7 +162,7 @@ jobs:
152162
cat $BASH_ENV
153163
- python/install-packages:
154164
pkg-manager: poetry
155-
cache-version: "v1" # change to clear cache
165+
cache-version: "v1" # change to clear cache
156166
args: "--with docs"
157167
- run:
158168
name: make linkcheck
@@ -256,4 +266,4 @@ workflows:
256266
filters:
257267
branches:
258268
only:
259-
- main
269+
- main

.github/workflows/main.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ concurrency:
55
on:
66
pull_request:
77
paths:
8-
- '**.py'
8+
- "**.py"
9+
- "**.yml"
10+
- "**.toml"
911
push:
1012
branches: [main]
1113
paths:
12-
- '**.py'
14+
- "**.py"
1315
tags:
14-
- 'v*.*.*'
16+
- "v*.*.*"
1517
workflow_dispatch:
1618

1719
jobs:
@@ -20,25 +22,25 @@ jobs:
2022
runs-on: ubuntu-latest
2123
strategy:
2224
matrix:
23-
poetry-version: [1.5.1]
25+
poetry-version: [1.6.1]
2426
steps:
2527
- name: Checkout repository
2628
uses: actions/checkout@v4
2729
- name: Setup Python 3.9
2830
uses: actions/setup-python@v4
2931
with:
30-
python-version: '3.9'
31-
architecture: 'x64'
32+
python-version: "3.9"
33+
architecture: "x64"
3234
- name: Install Poetry ${{ matrix.poetry-version }}
3335
uses: abatilo/actions-poetry@v2.3.0
3436
with:
3537
poetry-version: ${{ matrix.poetry-version }}
3638
- name: Install Poetry Dynamic Versioning Plugin
3739
run: pip install poetry-dynamic-versioning
38-
40+
3941
- name: Install dependencies
4042
run: poetry install --only style
41-
43+
4244
# check formatting of the code style
4345
- name: Check code formatting
4446
run: poetry run poe format_check
@@ -57,7 +59,7 @@ jobs:
5759
matrix:
5860
os: [ubuntu, macos, windows]
5961
python-version: [3.9, "3.10", "3.11"]
60-
poetry-version: [1.5.1]
62+
poetry-version: [1.6.1]
6163
name: build ${{ matrix.os }} - py${{ matrix.python-version }}
6264
runs-on: ${{ matrix.os }}-latest
6365
defaults:
@@ -70,7 +72,7 @@ jobs:
7072
uses: actions/setup-python@v4
7173
with:
7274
python-version: ${{ matrix.python-version }}
73-
architecture: 'x64'
75+
architecture: "x64"
7476
- name: Install Poetry ${{ matrix.poetry-version }}
7577
uses: abatilo/actions-poetry@v2.3.0
7678
with:
@@ -113,9 +115,12 @@ jobs:
113115
fail-fast: false
114116
matrix:
115117
os: [ubuntu, macos, windows]
116-
python-version: [3.9, "3.11"] # oldest and newest supported versions
117-
poetry-version: [1.5.1]
118+
python-version: [3.9, "3.11"] # oldest and newest supported versions
119+
poetry-version: [1.6.1]
118120
networkx: [stable, main]
121+
exclude:
122+
- python-version: 3.9
123+
networkx: main
119124
name: Unit-test ${{ matrix.os }} - py${{ matrix.python-version }} - Networkx ${{ matrix.networkx }}
120125
runs-on: ${{ matrix.os }}-latest
121126
defaults:
@@ -128,29 +133,34 @@ jobs:
128133
uses: actions/setup-python@v4
129134
with:
130135
python-version: ${{ matrix.python-version }}
131-
architecture: 'x64'
136+
architecture: "x64"
132137
- name: Install Poetry ${{ matrix.poetry-version }}
133138
uses: abatilo/actions-poetry@v2.3.0
134139
with:
135140
poetry-version: ${{ matrix.poetry-version }}
136141
- name: Install Poetry Dynamic Versioning Plugin
137-
run: pip install poetry-dynamic-versioning
142+
run: |
143+
pip install --upgrade pip
144+
pip install poetry-dynamic-versioning
138145
- name: Install packages via poetry
139146
run: |
140147
poetry install --with test
141148
- name: Install Networkx (main)
142149
if: "matrix.networkx == 'main'"
143150
run: |
144151
pip uninstall -yq networkx
145-
pip install --progress-bar off git+https://github.com/networkx/networkx
146-
152+
git clone https://github.com/networkx/networkx.git
153+
cd networkx
154+
pip install .[default]
155+
# pip install --progress-bar off git+https://github.com/networkx/networkx
156+
147157
- name: Setup torch for pgmpy
148158
if: "matrix.os == 'ubuntu'"
149159
shell: bash
150160
run: |
151161
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
152-
153-
- name: Run pytest # headless via Xvfb on linux
162+
163+
- name: Run pytest # headless via Xvfb on linux
154164
run: poetry run poe unit_test
155165
- name: Upload coverage stats to codecov
156166
if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.11' && matrix.networkx == 'stable' }}
@@ -173,7 +183,7 @@ jobs:
173183
uses: actions/setup-python@v4
174184
with:
175185
python-version: 3.9
176-
architecture: 'x64'
186+
architecture: "x64"
177187
- name: Install dependencies
178188
run: |
179189
python -m pip install --progress-bar off --upgrade pip setuptools wheel

.pre-commit-config.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
repos:
55
- repo: https://github.com/floatingpurr/sync_with_poetry
6-
rev: "0.4.0" # the revision or tag to clone at
6+
rev: "0.4.0" # the revision or tag to clone at
77
hooks:
88
- id: sync_with_poetry
9-
args: ["--all"] # optional args
9+
args: ["--all"] # optional args
1010
- repo: https://github.com/psf/black
1111
rev: 22.12.0
1212
hooks:
@@ -27,18 +27,17 @@ repos:
2727
rev: "6.0.0"
2828
hooks:
2929
- id: flake8
30-
- repo: https://github.com/pre-commit/mirrors-mypy
30+
- repo: https://github.com/pre-commit/mirrors-mypy
3131
rev: "v0.971"
3232
hooks:
3333
- id: mypy
3434
name: mypy (dodiscover)
3535
args: ["--config-file", "pyproject.toml"]
3636
files: ^dodiscover/
37-
- repo: https://github.com/pre-commit/mirrors-mypy
37+
- repo: https://github.com/pre-commit/mirrors-mypy
3838
rev: "v0.971"
3939
hooks:
4040
- id: mypy
4141
name: mypy (tests)
4242
args: ["--config-file", "pyproject.toml"]
4343
files: ^tests/
44-

.yamllint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: default
2+
3+
rules:
4+
line-length: disable
5+
document-start: disable
6+
truthy: disable
7+
comments: disable

doc/reference/functional/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ model. Currently, we only support linear models, but we plan to support non-line
1313
and we also do not support latent confounders yet.
1414

1515
To add a latent confounder, one can add a confounder explicitly, generate the data
16-
and then drop the confounder varialble in the final dataset. In the roadmap of this submodule,
16+
and then drop the confounder variable in the final dataset. In the roadmap of this submodule,
1717
the plan is to represent any bidirected edge as a uniformly randomly distributed variable
1818
that has an additive noise effect on both variables simultaneously.
1919

doc/whats_new/v0.2.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Changelog
2828
- |Feature| Implement and test functions to validate an MAG and check the presence of almost directed cycles, by `Aryan Roy`_ (:pr:`91`)
2929
- |Feature| Implement and test functions to convert a DAG to MAG, by `Aryan Roy`_ (:pr:`96`)
3030
- |Feature| Implement and test functions to convert a PAG to MAG, by `Aryan Roy`_ (:pr:`93`)
31+
- |API| Remove support for Python 3.8 by `Adam Li`_ (:pr:`99`)
3132

3233
Code and Documentation Contributors
3334
-----------------------------------

0 commit comments

Comments
 (0)