-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from adam2392/cpdag
[ENH] Adding cpdag class
- Loading branch information
Showing
29 changed files
with
4,435 additions
and
1,038 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
raison | ||
GES |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: unit-tests | ||
name: gh-ci-checks | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.type }} | ||
cancel-in-progress: true | ||
|
@@ -10,12 +10,17 @@ on: | |
branches: [main] | ||
paths: | ||
- '**.py' | ||
tags: | ||
- 'v*.*.*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
style: | ||
timeout-minutes: 10 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
poetry-version: [1.1.14] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
@@ -24,42 +29,36 @@ jobs: | |
with: | ||
python-version: '3.9' | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools wheel | ||
python -m pip install --progress-bar off .[style] | ||
- name: Run flake8 | ||
uses: py-actions/flake8@v2 | ||
- name: Install Poetry ${{ matrix.poetry-version }} | ||
uses: abatilo/[email protected] | ||
with: | ||
path: "pywhy_graphs" | ||
- name: Run isort | ||
uses: isort/isort-action@master | ||
- name: Run black | ||
uses: psf/black@stable | ||
with: | ||
options: "--check --verbose" | ||
- name: Run codespell | ||
uses: codespell-project/actions-codespell@master | ||
with: | ||
check_filenames: true | ||
check_hidden: true | ||
skip: './.git,./build,./.mypy_cache,./.pytest_cache' | ||
ignore_words_file: ./.codespellignore | ||
- name: Run pydocstyle | ||
run: pydocstyle . | ||
- name: Run mypy | ||
uses: jpetrucciani/mypy-check@master | ||
with: | ||
path: './pywhy_graphs' | ||
mypy_flags: '--config-file pyproject.toml' | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install Poetry Dynamic Versioning Plugin | ||
run: pip install poetry-dynamic-versioning | ||
|
||
# TODO: once poetry v1.2 is release, we want to only install dev dependencies | ||
- name: Install dependencies | ||
run: poetry install | ||
|
||
# check formatting of the code style | ||
- name: Check code formatting | ||
run: poetry run poe check_format | ||
|
||
# this applies various linting | ||
- name: Lint codebase | ||
run: poetry run poe lint | ||
|
||
- name: Typecheck | ||
run: poetry run poe typecheck | ||
|
||
build: | ||
timeout-minutes: 10 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
python-version: [3.7, 3.8, 3.9, "3.10"] | ||
python-version: [3.8, 3.9, "3.10"] | ||
poetry-version: [1.1.14] | ||
name: build ${{ matrix.os }} - py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }}-latest | ||
defaults: | ||
|
@@ -73,17 +72,25 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
- name: Install Poetry ${{ matrix.poetry-version }} | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install Poetry Dynamic Versioning Plugin | ||
run: pip install poetry-dynamic-versioning | ||
- name: Install from source | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools wheel | ||
python -m pip install --progress-bar off .[build] | ||
poetry install | ||
- name: Test package install | ||
run: python -c "import pywhy_graphs; print(pywhy_graphs.__version__)" | ||
run: poetry run python -c "import pywhy_graphs; print(pywhy_graphs.__version__)" | ||
- name: Remove package install | ||
run: python -m pip uninstall -yq pywhy_graphs | ||
- name: Check poetry lock file | ||
run: poetry update --dry-run | ||
- name: Build package | ||
run: python -m build | ||
run: poetry build | ||
- name: Upload package distribution files | ||
if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: package | ||
|
@@ -108,6 +115,7 @@ jobs: | |
matrix: | ||
os: [ubuntu, macos, windows] | ||
python-version: [3.8, "3.10"] # oldest and newest supported versions | ||
poetry-version: [1.1.14] | ||
networkx: [stable, main] | ||
name: pytest ${{ matrix.os }} - py${{ matrix.python-version }} - Networkx ${{ matrix.networkx }} | ||
runs-on: ${{ matrix.os }}-latest | ||
|
@@ -117,32 +125,27 @@ jobs: | |
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: main # clone repository in a sub-directory | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
- name: Install Qt dependencies | ||
if: "matrix.os == 'ubuntu'" | ||
run: | | ||
sudo apt update | ||
sudo apt install qt5-default | ||
- name: Install package | ||
- name: Install Poetry ${{ matrix.poetry-version }} | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install Poetry Dynamic Versioning Plugin | ||
run: pip install poetry-dynamic-versioning | ||
- name: Install packages via poetry | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools wheel | ||
python -m pip install --progress-bar off main/.[test] | ||
# TODO: remove this eventually | ||
python -m pip install --progress-bar off git+https://github.com/py-why/graphs | ||
poetry install | ||
- name: Install Networkx (main) | ||
if: "matrix.networkx == 'main'" | ||
run: | | ||
python -m pip uninstall -yq networkx | ||
pip uninstall -yq networkx | ||
pip install --progress-bar off git+https://github.com/networkx/networkx | ||
- name: Run pytest # headless via Xvfb on linux | ||
uses: GabrielBB/[email protected] | ||
with: | ||
run: pytest main/pywhy_graphs --cov=main/pywhy_graphs --cov-report=xml --cov-config=main/pyproject.toml | ||
run: poetry run poe unit_test | ||
- name: Upload coverage stats to codecov | ||
if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' && matrix.networkx == 'stable' }} | ||
uses: codecov/codecov-action@v3 | ||
|
@@ -168,7 +171,7 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
python -m pip install --progress-bar off --upgrade pip setuptools wheel | ||
python -m pip install --progress-bar off .[build] | ||
python -m pip install --progress-bar off build twine | ||
- name: Prepare environment | ||
run: | | ||
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.