Skip to content

Commit 6fb0eb9

Browse files
authored
MAINT Removing poetry based setup (#110)
* Removing poetry based setup --------- Signed-off-by: Adam Li <[email protected]>
1 parent 6c3ee23 commit 6fb0eb9

File tree

13 files changed

+340
-4424
lines changed

13 files changed

+340
-4424
lines changed

.circleci/config.yml

Lines changed: 82 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,128 @@
11
version: 2.1
22

3-
orbs:
4-
python: circleci/[email protected]
5-
6-
jobs:
7-
build_doc:
8-
executor:
9-
name: python/default
10-
tag: "3.10"
3+
# document commands used by downstream jobs
4+
commands:
5+
check-skip:
116
steps:
12-
- restore_cache:
13-
name: Restore .git
14-
keys:
15-
- source-cache-graphs
16-
- checkout
17-
- run:
18-
name: Complete checkout
19-
command: |
20-
if ! git remote -v | grep upstream; then
21-
git remote add upstream https://github.com/py-why/pywhy-graphs.git
22-
fi
23-
git remote set-url upstream https://github.com/py-why/pywhy-graphs.git
24-
git fetch upstream
25-
- save_cache:
26-
name: Save .git
27-
key: source-cache-graphs
28-
paths:
29-
- ".git"
307
- run:
318
name: Check-skip
329
command: |
33-
set -e
34-
export COMMIT_MESSAGE=$(git log --format=oneline -n 1);
35-
if [[ -v CIRCLE_PULL_REQUEST ]] && ([[ "$COMMIT_MESSAGE" == *"[skip circle]"* ]] || [[ "$COMMIT_MESSAGE" == *"[circle skip]"* ]]); then
36-
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
10+
if [ ! -d "sktree" ]; then
11+
echo "Build was not run due to skip, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
3712
circleci-agent step halt;
3813
fi
39-
- run:
40-
name: Merge with upstream
41-
command: |
42-
echo $(git log -1 --pretty=%B) | tee gitlog.txt
43-
echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt
44-
if [[ $(cat merge.txt) != "" ]]; then
45-
echo "Merging $(cat merge.txt)";
46-
git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge";
14+
export git_log=$(git log --max-count=1 --pretty=format:"%B" | tr "\n" " ")
15+
echo "Got commit message:"
16+
echo "${git_log}"
17+
if [[ -v CIRCLE_PULL_REQUEST ]] && ([[ "$git_log" == *"[skip circle]"* ]] || [[ "$git_log" == *"[circle skip]"* ]]); then
18+
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
19+
circleci-agent step halt;
4720
fi
21+
apt-install:
22+
steps:
4823
- run:
49-
name: Install the latest version of Poetry
24+
name: Install apt packages
5025
command: |
51-
curl -sSL https://install.python-poetry.org | python3 - --version 1.6.1
52-
python --version
53-
poetry --version
26+
sudo apt-get update
27+
sudo apt-get install libopenblas-dev gfortran libgmp-dev libmpfr-dev ccache
28+
# make sure pandoc is on the system
29+
sudo apt-get update && sudo apt-get install -y pandoc optipng
30+
31+
# install pysal dependencies
32+
sudo apt install libspatialindex-dev xdg-utils
33+
5434
- run:
5535
name: Set BASH_ENV
5636
command: |
5737
set -e
5838
sudo apt update
39+
sudo apt-get update
5940
sudo apt install -qq graphviz optipng libxft2 graphviz-dev
60-
echo "set -e" >> $BASH_ENV
61-
echo "export OPENBLAS_NUM_THREADS=4" >> $BASH_ENV
62-
echo "export XDG_RUNTIME_DIR=/tmp/runtime-circleci" >> $BASH_ENV
63-
echo "export PATH=~/.local/bin/:$PATH" >> $BASH_ENV
64-
echo "export DISPLAY=:99" >> $BASH_ENV
65-
echo "BASH_ENV:"
41+
echo 'set -e' >> $BASH_ENV
42+
echo 'export OPENBLAS_NUM_THREADS=4' >> $BASH_ENV
43+
echo 'export XDG_RUNTIME_DIR=/tmp/runtime-circleci' >> $BASH_ENV
44+
echo 'export PATH=~/.local/bin/:$PATH' >> $BASH_ENV
45+
echo 'export DISPLAY=:99' >> $BASH_ENV
46+
echo 'BASH_ENV:'
6647
cat $BASH_ENV
48+
merge:
49+
steps:
50+
- run:
51+
name: merge with upstream
52+
command: |
53+
echo $(git log -1 --pretty=%B) | tee gitlog.txt
54+
echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt
55+
if [[ $(cat merge.txt) != "" ]]; then
56+
echo "Merging $(cat merge.txt)";
57+
git remote add upstream https://github.com/neurodata/scikit-tree.git;
58+
git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge";
59+
git fetch upstream main;
60+
fi
61+
62+
jobs:
63+
build_doc:
64+
docker:
65+
# CircleCI maintains a library of pre-built images
66+
# documented at https://circleci.com/doc/2.0/circleci-images/
67+
- image: cimg/python:3.9
68+
steps:
69+
- checkout
70+
- check-skip
71+
- merge
72+
- apt-install
73+
74+
- restore_cache:
75+
name: Restore .git
76+
keys:
77+
- source-cache-graphs
78+
- save_cache:
79+
name: Save .git
80+
key: source-cache-graphs
81+
paths:
82+
- ".git"
6783
- run:
6884
name: Install pysal dependencies
6985
command: |
7086
sudo apt install libspatialindex-dev xdg-utils shared-mime-info desktop-file-utils
7187
- run:
7288
name: Setup pandoc
7389
command: sudo apt update && sudo apt install -y pandoc optipng
74-
75-
- python/install-packages:
76-
pkg-manager: poetry
77-
cache-version: "v2" # change to clear cache
78-
args: "--with docs --extras viz --extras sims"
7990
- run:
80-
name: Check poetry package versions
91+
name: setup Python venv
8192
command: |
82-
poetry --version
83-
poetry show
84-
93+
pip install --upgrade pip
94+
pip install .[build,doc]
8595
- run:
8696
name: Setup torch for pgmpy
8797
command: |
8898
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
8999
- run:
90100
name: Check installation
91101
command: |
92-
poetry run python -c "import pywhy_graphs;"
93-
poetry run python -c "import numpy; numpy.show_config()"
94-
LIBGL_DEBUG=verbose poetry run python -c "import matplotlib.pyplot as plt; plt.figure()"
102+
python -c "import pywhy_graphs;"
103+
python -c "import numpy; numpy.show_config()"
104+
LIBGL_DEBUG=verbose python -c "import matplotlib.pyplot as plt; plt.figure()"
95105
96106
# dowhy currently requires an older version of numpy
97107
- run:
98108
name: Temporary Hack for numpy
99109
command: |
100-
poetry run python -m pip install numpy==1.22.0
110+
python -m pip install numpy==1.22.0
101111
102112
- run:
103113
name: Build documentation
104114
command: |
105-
cd doc
106-
poetry run poe build_docs
115+
make -C doc html
116+
117+
- save_cache:
118+
key: deps_ccache-{{ .Branch }}
119+
paths:
120+
- ~/.ccache
121+
- ~/.cache/pip
122+
- run:
123+
name: ccache performance
124+
command: |
125+
ccache -s
107126
# Save the example test results
108127
- store_test_results:
109128
path: doc/_build/test-results
@@ -127,56 +146,6 @@ jobs:
127146
paths:
128147
- html
129148
- html_stable
130-
131-
linkcheck:
132-
parameters:
133-
scheduled:
134-
type: string
135-
default: "false"
136-
executor: python/default
137-
steps:
138-
- restore_cache:
139-
keys:
140-
- source-cache-graphs
141-
- checkout
142-
- run:
143-
name: Check-skip
144-
command: |
145-
export COMMIT_MESSAGE=$(git log --format=oneline -n 1);
146-
if [[ "$COMMIT_MESSAGE" != *"[circle linkcheck]"* ]] && [ "<< parameters.scheduled >>" != "true" ]; then
147-
echo "Skip detected, exiting job ${CIRCLE_JOB}."
148-
circleci-agent step halt;
149-
fi
150-
- run:
151-
name: Set BASH_ENV
152-
command: |
153-
set -e
154-
sudo apt update
155-
sudo apt install -qq graphviz optipng libxft2 graphviz-dev
156-
echo "set -e" >> $BASH_ENV
157-
echo "export OPENBLAS_NUM_THREADS=4" >> $BASH_ENV
158-
echo "export XDG_RUNTIME_DIR=/tmp/runtime-circleci" >> $BASH_ENV
159-
echo "export PATH=~/.local/bin/:$PATH" >> $BASH_ENV
160-
echo "export DISPLAY=:99" >> $BASH_ENV
161-
echo "BASH_ENV:"
162-
cat $BASH_ENV
163-
- python/install-packages:
164-
pkg-manager: poetry
165-
cache-version: "v1" # change to clear cache
166-
args: "--with docs"
167-
- run:
168-
name: make linkcheck
169-
command: |
170-
poetry run make -C doc linkcheck
171-
- run:
172-
name: make linkcheck-grep
173-
when: always
174-
command: |
175-
poetry run make -C doc linkcheck-grep
176-
- store_artifacts:
177-
path: doc/_build/linkcheck
178-
destination: linkcheck
179-
180149
deploy:
181150
docker:
182151
- image: cimg/node:lts
@@ -226,8 +195,6 @@ workflows:
226195
jobs:
227196
- build_doc:
228197
name: build_doc
229-
- linkcheck:
230-
name: linkcheck
231198
- deploy:
232199
requires:
233200
- build_doc
@@ -253,17 +220,3 @@ workflows:
253220
branches:
254221
only:
255222
- main
256-
257-
weekly:
258-
jobs:
259-
- linkcheck:
260-
name: linkcheck_weekly
261-
scheduled: "true"
262-
triggers:
263-
- schedule:
264-
# "At 00:00 on Sunday" should be often enough
265-
cron: "0 0 * * 0"
266-
filters:
267-
branches:
268-
only:
269-
- main

0 commit comments

Comments
 (0)