From 318122abd3fbae7f9595f421e1f14e353de0eb87 Mon Sep 17 00:00:00 2001 From: BirkhoffG <26811230+BirkhoffG@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:06:54 -0500 Subject: [PATCH 1/2] support py>3.9; enable github CI --- .github/workflows/test.yaml | 27 +++++++++++++++++++++++++++ causalgraphicalmodels/cgm.py | 7 ++++++- setup.py | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..96024c4 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,27 @@ +name: CI +on: [workflow_dispatch, pull_request, push] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install -e . + + - name: Test with pytest + run: | + pytest + diff --git a/causalgraphicalmodels/cgm.py b/causalgraphicalmodels/cgm.py index 20de686..2a20ca8 100644 --- a/causalgraphicalmodels/cgm.py +++ b/causalgraphicalmodels/cgm.py @@ -1,7 +1,12 @@ import networkx as nx import graphviz from itertools import combinations, chain -from collections import Iterable +import sys + +if sys.version_info.major == 3 and sys.version_info.minor >= 9: + from collections.abc import Iterable +else: + from collections import Iterable class CausalGraphicalModel: diff --git a/setup.py b/setup.py index 739015f..6ffc189 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ "Intended Audience :: Science/Research", "Topic :: Scientific/Engineering", "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.5 3.6 3.7 3.8 3.9 3.10", ], keywords="causal inference causal graphical models causality", packages=find_packages(exclude=["notebook", "test"]), From cd178afc246160d1d0ec996a4ec0652cba580205 Mon Sep 17 00:00:00 2001 From: BirkhoffG <26811230+BirkhoffG@users.noreply.github.com> Date: Mon, 13 Feb 2023 18:19:41 -0500 Subject: [PATCH 2/2] bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 05b19b1..fa3de58 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.4 \ No newline at end of file +0.0.5 \ No newline at end of file