Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Tests

on: [push]
on:
push:
pull_request:

jobs:
build:
Expand All @@ -11,22 +13,69 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 lingam --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 lingam --count --exit-zero --ignore=E203,E501,E741,C901 --max-line-length=127 --statistics

- name: Test with pytest
run: |
pytest -v --cov=lingam --cov-report=term-missing

build-and-install:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Build sdist & wheel via pyproject.toml
run: |
python -m venv venv_b
source venv_b/bin/activate
python -m pip install --upgrade pip setuptools wheel build
python -m build
ls -la dist/
echo "List sdist contents:"
tar -tf dist/*.tar.gz | head -n 50

- name: Test install from wheel
run: |
python -m venv venv_w
source venv_w/bin/activate
pip install --no-cache-dir dist/*.whl
python -c "import lingam; print(lingam.__version__)"
pip check

- name: Test install from sdist
run: |
python -m venv venv_s
source venv_s/bin/activate
pip install --no-cache-dir dist/*.tar.gz
python -c "import lingam; print(lingam.__version__)"
pip check
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "lingam"
description = "Python package for causal discovery based on LiNGAM."
readme = "README.md"
authors = [
{ name = "Takashi Ikeuchi" },
{ name = "Genya Haraoka" },
{ name = "Mayumi Ide" },
{ name = "Kouhei Nishikawa" },
{ name = "Yan Zeng" },
{ name = "Takashi Nicholas Maeda" },
{ name = "Wataru Kurebayashi" },
{ name = "Shohei Shimizu" }
]
license = { file = "LICENSE" }
requires-python = ">=3.9"
dependencies = [
"numpy",
"scipy",
"scikit-learn",
"graphviz",
"statsmodels",
"networkx",
"pandas",
"pygam",
"matplotlib",
"psy",
"semopy",
"autograd"
]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
]
dynamic = ["version"]

[project.urls]
Homepage = "https://github.com/cdt15/lingam"

[tool.setuptools.packages.find]
exclude = ["tests"]

[tool.setuptools.dynamic]
version = { attr = "lingam.__version__" }
39 changes: 0 additions & 39 deletions setup.py

This file was deleted.

Loading