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/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 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"]),