Skip to content

Commit

Permalink
[DOCS] Fix docs and certain ci builds to include pygraphviz (#19)
Browse files Browse the repository at this point in the history
* Fix docs and certain ci builds for pygraphviz

Signed-off-by: Adam Li <[email protected]>

* Add pygraphviz

Signed-off-by: Adam Li <[email protected]>

* Add pygraphviz

Signed-off-by: Adam Li <[email protected]>

Signed-off-by: Adam Li <[email protected]>
  • Loading branch information
adam2392 authored Aug 21, 2022
1 parent a67b95c commit dd5d26f
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 44 deletions.
24 changes: 14 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,32 @@ jobs:
command: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_UNINSTALL=1 python -
curl -sSL https://install.python-poetry.org | python3 -
- python/install-packages:
pkg-manager: poetry
# args: "--extras docs"
cache-version: "v1" # change to clear cache
- run:
name: Check poetry package versions
command: |
poetry --version
poetry show
- run:
name: Set BASH_ENV
command: |
set -e
sudo apt update
sudo apt install -qq graphviz optipng libxft2
sudo apt install -qq graphviz optipng libxft2 graphviz-dev
echo "set -e" >> $BASH_ENV
echo "export OPENBLAS_NUM_THREADS=4" >> $BASH_ENV
echo "export XDG_RUNTIME_DIR=/tmp/runtime-circleci" >> $BASH_ENV
echo "export PATH=~/.local/bin/:$PATH" >> $BASH_ENV
echo "export DISPLAY=:99" >> $BASH_ENV
echo "BASH_ENV:"
cat $BASH_ENV
- run:
name: Install pysal dependencies
command: |
sudo apt install libspatialindex-dev xdg-utils
- python/install-packages:
pkg-manager: poetry
args: "-E graph_func -E viz"
cache-version: "v1" # change to clear cache
- run:
name: Check poetry package versions
command: |
poetry --version
poetry show
- run:
name: Setup pandoc
command: sudo apt update && sudo apt install -y pandoc optipng
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exclude =
.circleci
paper
setup.py
docs
doc

per-file-ignores =
# __init__.py files are allowed to have unused imports
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/circle_artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
on: [status]
jobs:
circleci_artifacts_redirector_job:
runs-on: ubuntu-20.04
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
uses: larsoner/circleci-artifacts-redirector-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifact-path: 0/dev/index.html
circleci-jobs: build_doc
job-title: Check the rendered docs here!
jobs:
circleci_artifacts_redirector_job:
runs-on: ubuntu-20.04
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
uses: larsoner/circleci-artifacts-redirector-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
artifact-path: 0/dev/index.html
circleci-jobs: build_doc
job-title: Check the rendered docs here!
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
run: poetry run poe typecheck

build:
timeout-minutes: 10
# TODO: modify back to 10 mins after we improve poetry install
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
Expand All @@ -79,11 +80,10 @@ jobs:
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: |
poetry install
pip install -e .
- name: Test package install
run: poetry run python -c "import dodiscover; print(dodiscover.__version__)"
- name: Remove package install
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ Minimally, dodiscover requires:
* numpy
* scipy
* networkx
* pandas

For explicit graph functionality for representing various causal graphs, such as ADMG, or CPDAGs, you will also need:

* pywhy-graphs
* graphs # this is a development version for PRable MixedEdgeGraph to networkx

For explicitly representing causal graphs, we recommend using `pywhy-graphs` package, but if you have a graph library that adheres to the graph protocols we require, then you can in principle use those graphs.

Expand All @@ -41,5 +46,8 @@ To install the package from github, clone the repository and then `cd` into the

poetry install

# for graph functionality
poetry install --extras graph_func

# if you would like an editable install of dodiscover for dev purposes
pip install -e .
46 changes: 29 additions & 17 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ pandas = "^1.1"
importlib-resources = { version = "*", python = "<3.9" }
graphs = { git = "https://github.com/py-why/graphs.git", branch = 'main', optional = true }
pywhy-graphs = { git = "https://github.com/py-why/pywhy-graphs.git", branch = 'main', optional = true }
# pywhy-graphs = { path = "../pywhy-graphs", develop = true }
pygraphviz = { version = "*", optional = true }

# TODO: the below needs to be refactored into separate dev-dependencies
# https://github.com/python-poetry/poetry/is
Expand Down Expand Up @@ -80,6 +82,8 @@ nbsphinx = { version = "^0.8" }

[tool.poetry.extras]
graph_func = ['pywhy-graphs', 'graphs']
viz = ['pygraphviz']


[build-system]
requires = ["poetry-core>=1.0.0"]
Expand All @@ -97,7 +101,7 @@ _isort = 'isort .'
_black_check = 'black --check dodiscover examples'
_isort_check = 'isort --check .'
_pydocstyle = 'pydocstyle .'
_codespell = 'codespell dodiscover/ doc/ examples/ --ignore-words=.codespellignore --skip "**/_build/*"'
_codespell = 'codespell dodiscover/ doc/ examples/ --ignore-words=.codespellignore --skip "**/_build/*,**/auto_examples/*"'
_changelog = 'semversioner changelog > CHANGELOG.md'
_apply_version = 'semversioner release'

Expand Down

0 comments on commit dd5d26f

Please sign in to comment.