-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update circleCI and gh actions and package to python 3.9 (#137)
* Update circleCI and gh actions and package to python 3.9 --------- Signed-off-by: Adam Li <[email protected]>
- Loading branch information
Showing
7 changed files
with
677 additions
and
1,438 deletions.
There are no files selected for viewing
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,17 +1,13 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
python: circleci/[email protected] | ||
|
||
jobs: | ||
build_doc: | ||
executor: python/default | ||
docker: | ||
- image: cimg/python:3.9 | ||
|
||
steps: | ||
- restore_cache: | ||
name: Restore .git | ||
keys: | ||
- source-cache-graphs | ||
- checkout | ||
|
||
- run: | ||
name: Complete checkout | ||
command: | | ||
|
@@ -34,61 +30,59 @@ jobs: | |
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}." | ||
circleci-agent step halt; | ||
fi | ||
- run: | ||
name: Merge with upstream | ||
command: | | ||
echo $(git log -1 --pretty=%B) | tee gitlog.txt | ||
echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt | ||
if [[ $(cat merge.txt) != "" ]]; then | ||
echo "Merging $(cat merge.txt)"; | ||
git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge"; | ||
fi | ||
- run: | ||
name: Install the latest version of Poetry | ||
command: | | ||
curl -sSL https://install.python-poetry.org | python3 - --version 1.3.0 | ||
poetry --version | ||
- restore_cache: | ||
keys: | ||
- poetry-v1-{{ checksum "poetry.lock" }} | ||
- poetry-v1- | ||
|
||
- run: | ||
name: Set BASH_ENV | ||
command: | | ||
set -e | ||
sudo apt update | ||
sudo apt-get update | ||
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:" | ||
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 --with docs" | ||
cache-version: "v1" # change to clear cache | ||
- run: | ||
name: Check poetry package versions | ||
command: | | ||
poetry --version | ||
poetry show | ||
sudo apt install libspatialindex-dev xdg-utils shared-mime-info | ||
- run: | ||
name: Setup pandoc | ||
command: sudo apt update && sudo apt install -y pandoc optipng | ||
|
||
- run: | ||
name: Install Poetry | ||
command: | | ||
curl -sSL https://install.python-poetry.org | python - | ||
export PATH='$HOME/.poetry/bin:$PATH' | ||
- run: | ||
name: Install Dependencies | ||
command: | | ||
poetry install --no-interaction --no-ansi --with docs --extras viz --extras graph_func | ||
- run: | ||
name: Check installation | ||
name: Show installed versions | ||
command: | | ||
poetry run python -c "import dodiscover;" | ||
poetry run python -c "import numpy; numpy.show_config()" | ||
LIBGL_DEBUG=verbose poetry run python -c "import matplotlib.pyplot as plt; plt.figure()" | ||
poetry show | ||
- save_cache: | ||
paths: | ||
- $HOME/.poetry | ||
key: poetry-v1-{{ checksum "poetry.lock" }} | ||
|
||
- run: | ||
name: Build documentation | ||
name: Build Documentation | ||
command: | | ||
cd doc | ||
poetry run make html | ||
poetry run poe build_docs | ||
# Save the example test results | ||
- store_test_results: | ||
path: doc/_build/test-results | ||
|
@@ -113,53 +107,6 @@ jobs: | |
- html | ||
- html_stable | ||
|
||
linkcheck: | ||
parameters: | ||
scheduled: | ||
type: string | ||
default: "false" | ||
executor: python/default | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- source-cache-graphs | ||
- checkout | ||
- run: | ||
name: Check-skip | ||
command: | | ||
export COMMIT_MESSAGE=$(git log --format=oneline -n 1); | ||
if [[ "$COMMIT_MESSAGE" != *"[circle linkcheck]"* ]] && [ "<< parameters.scheduled >>" != "true" ]; then | ||
echo "Skip detected, exiting job ${CIRCLE_JOB}." | ||
circleci-agent step halt; | ||
fi | ||
- run: | ||
name: Set BASH_ENV | ||
command: | | ||
set -e | ||
echo "set -e" >> $BASH_ENV | ||
echo "export PATH=~/.local/bin/:$PATH" >> $BASH_ENV | ||
- python/install-packages: | ||
pkg-manager: poetry | ||
cache-version: "v1" # change to clear cache | ||
args: "--with docs" | ||
- run: | ||
name: Check poetry package versions | ||
command: | | ||
poetry --version | ||
poetry show | ||
- run: | ||
name: make linkcheck | ||
command: | | ||
make -C doc linkcheck | ||
- run: | ||
name: make linkcheck-grep | ||
when: always | ||
command: | | ||
make -C doc linkcheck-grep | ||
- store_artifacts: | ||
path: doc/_build/linkcheck | ||
destination: linkcheck | ||
|
||
deploy: | ||
docker: | ||
- image: cimg/node:lts | ||
|
@@ -209,8 +156,6 @@ workflows: | |
jobs: | ||
- build_doc: | ||
name: build_doc | ||
- linkcheck: | ||
name: linkcheck | ||
- deploy: | ||
requires: | ||
- build_doc | ||
|
@@ -236,17 +181,3 @@ workflows: | |
branches: | ||
only: | ||
- main | ||
|
||
weekly: | ||
jobs: | ||
- linkcheck: | ||
name: linkcheck_weekly | ||
scheduled: "true" | ||
triggers: | ||
- schedule: | ||
# "At 00:00 on Sunday" should be often enough | ||
cron: "0 0 * * 0" | ||
filters: | ||
branches: | ||
only: | ||
- main |
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
poetry-version: [1.3.0] | ||
poetry-version: [1.5.1] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
@@ -58,8 +58,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
python-version: [3.8, 3.9, "3.10"] | ||
poetry-version: [1.3.0] | ||
python-version: [3.9, "3.10", "3.11"] | ||
poetry-version: [1.5.1] | ||
name: build ${{ matrix.os }} - py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }}-latest | ||
defaults: | ||
|
@@ -121,8 +121,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu, macos, windows] | ||
python-version: [3.8, "3.10"] # oldest and newest supported versions | ||
poetry-version: [1.3.0] | ||
python-version: [3.9, "3.11"] # oldest and newest supported versions | ||
poetry-version: [1.5.1] | ||
networkx: [stable, main] | ||
name: Unit-test ${{ matrix.os }} - py${{ matrix.python-version }} - Networkx ${{ matrix.networkx }} | ||
runs-on: ${{ matrix.os }}-latest | ||
|
@@ -165,8 +165,8 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
os: [ubuntu] | ||
python-version: ["3.10"] # oldest and newest supported versions | ||
poetry-version: [1.3.0] | ||
python-version: ["3.10"] # oldest and newest supported versions | ||
poetry-version: [1.5.1] | ||
networkx: [main] | ||
name: Integration test ${{ matrix.os }} - py${{ matrix.python-version }} - Networkx ${{ matrix.networkx }} | ||
runs-on: ${{ matrix.os }}-latest | ||
|
@@ -180,17 +180,27 @@ jobs: | |
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
architecture: "x64" | ||
- name: Install Poetry ${{ matrix.poetry-version }} | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
|
||
- name: Install packages for Ubuntu | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y graphviz optipng libxft2 graphviz-dev | ||
- name: Setup torch | ||
run: | | ||
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc | ||
- name: Install Poetry Dynamic Versioning Plugin | ||
run: pip install poetry-dynamic-versioning | ||
- name: Install packages via poetry | ||
run: | | ||
poetry install --with test,docs --extras graph_func | ||
- name: Run pytest # headless via Xvfb on linux | ||
- name: Run pytest # headless via Xvfb on linux | ||
run: poetry run poe integration_test | ||
|
||
# release is ran when a release is made on Github | ||
|
@@ -220,7 +230,7 @@ jobs: | |
- name: Build the release artifact | ||
run: | | ||
poetry-dynamic-versioning | ||
poetry build | ||
poetry build | ||
- name: Download package distribution files | ||
uses: actions/download-artifact@v3 | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
"""Version number.""" | ||
|
||
# TODO: Remove try/except once the minimum python requirement is bumped to 3.8 | ||
try: | ||
from importlib.metadata import version # type: ignore | ||
except ImportError: | ||
from importlib_metadata import version # type: ignore | ||
from importlib.metadata import version # type: ignore | ||
|
||
__version__ = version(__package__) |
Oops, something went wrong.