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
117 changes: 50 additions & 67 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,50 @@
name: Build Docs

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
inputs:
version:
description: Manual Doc Build Reason
default: test
required: false
jobs:
docs:
name: build & push docs
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/312-latest.yaml]
experimental: [false]
defaults:
run:
shell: bash -l {0}

steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

- name: install pulp via pip
run: pip install pulp

- name: install package
run: pip install .

- name: make docs
run: cd docs; make html

- name: commit docs
run: |
git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages
cp -r docs/_build/html/* gh-pages/
cd gh-pages
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
# The above command will fail if no changes were present,
# so we ignore the return code.

- name: push to gh-pages
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
---
name: Build Docs
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
version:
description: Manual Doc Build Reason
default: test
required: false
jobs:
docs:
name: build & push docs
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
matrix:
os:
- ubuntu-latest
environment-file:
- ci/py313_spopt-latest.yaml
experimental:
- false
defaults:
run:
shell: bash -l {0}
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: latest
- name: install pulp via pip
run: pip install pulp
- name: install package
run: pip install .
- name: make docs
run: cd docs; make html
- name: Publish to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html/
keep_files: false
67 changes: 30 additions & 37 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,44 @@
---
name: Release Package

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
- v*
workflow_dispatch:
inputs:
version:
description: Manual Release
default: test
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*

- name: Create Release Notes
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Create Release Notes
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: >
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
155 changes: 73 additions & 82 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,78 @@
name: Continuous Integration
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '59 23 * * *'
workflow_dispatch:
---
name: Continuous Integration
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
schedule:
- cron: 59 23 * * *
workflow_dispatch:
inputs:
version:
description: Manual CI Run
default: test
required: false

jobs:
tests:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
environment-file: [
ci/310-oldest.yaml,
ci/310-latest.yaml,
ci/311-latest.yaml,
ci/312-latest.yaml,
ci/312-dev.yaml,
]
include:
- environment-file: ci/312-latest.yaml
os: macos-13 # Intel
- environment-file: ci/312-latest.yaml
os: macos-14 # Apple Silicon
- environment-file: ci/312-latest.yaml
os: windows-latest
fail-fast: false

defaults:
run:
shell: bash -l {0}

steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'

##############################################################################
#- name: install pulp via pip
# run: |
# pip install pulp
# pulptest
##############################################################################

- name: environment info
run: |
micromamba info
micromamba list

- name: spatial versions
run: 'python -c "import geopandas; geopandas.show_versions();"'

- name: run tests
run: |
pytest spopt \
-v \
-r a \
-n logical \
--color yes \
--cov spopt \
--cov-append \
--cov-report term-missing \
--cov-report xml .

- name: codecov
uses: codecov/codecov-action@v4
jobs:
tests:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os:
- ubuntu-latest
environment-file:
- ci/py311_spopt-oldest.yaml
- ci/py311_spopt-latest.yaml
- ci/py312_spopt-latest.yaml
- ci/py313_spopt-latest.yaml
- ci/py313_spopt-dev.yaml
include:
- environment-file: ci/py313_spopt-latest.yaml
os: macos-13
- environment-file: ci/py313_spopt-latest.yaml
os: macos-14
- environment-file: ci/py313_spopt-latest.yaml
os: windows-latest
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: latest
- name: environment info
run: |
micromamba info
micromamba list
- name: spatial versions
run: python -c "import geopandas; geopandas.show_versions();"
- name: Download test files
run: |
python -c '
import libpysal
libpysal.examples.fetch_all()
'
- name: run tests
run: |
pytest spopt \
-v \
-r a \
-n logical \
--color yes \
--cov spopt \
--cov-append \
--cov-report term-missing \
--cov-report xml .
- name: codecov
uses: codecov/codecov-action@v5
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
files: "spopt\/"
files: "spopt\/|notebooks\/"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
rev: "v0.12.2"
hooks:
- id: ruff
- id: ruff-check
- id: ruff-format

ci:
Expand Down
Loading