Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Feb 27, 2023
2 parents 2768d85 + 31ac0c7 commit 2000cc3
Show file tree
Hide file tree
Showing 535 changed files with 6,491 additions and 99,610 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ omit =
*/contrib/*
*/test/*
include=libpysal/*
disable_warnings=include-ignored
[report]
omit =
__init__.py
Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.ipynb linguist-language=Python
libpysal/_version.py export-subst
60 changes: 60 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

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/310.yaml]
experimental: [false]
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repo
uses: actions/checkout@v3

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

- 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
103 changes: 48 additions & 55 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,66 +7,59 @@
# under the user's name, not the organzation.

#--------------------------------------------------
name: release_and_publish

name: Release & Publish
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
name: Create release & publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
- name: Run Changelog
run: |
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python3 tools/gitcount.ipynb
- name: Cat Changelog
uses: pCYSl5EDgo/cat@master
id: changetxt
with:
path: ./tools/changelog.md
env:
TEXT: ${{ steps.changetxt.outputs.text }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # token is provided by GHA, DO NOT create
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changetxt.outputs.text }}
draft: false
prerelease: false
- name: Get Asset name
run: |
export PKG=$(ls dist/)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
- name: Checkout repo
uses: actions/checkout@v3

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

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
- name: run Changelog
run: |
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python3 tools/gitcount.ipynb
- name: cat Changelog
uses: pCYSl5EDgo/cat@master
id: changetxt
with:
path: ./tools/changelog.md
env:
TEXT: ${{ steps.changetxt.outputs.text }}

- name: Get the tag name
run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changetxt.outputs.text }}
body_path: ${{ steps.changetxt.outputs.path }}
name: Release ${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
78 changes: 44 additions & 34 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,56 @@

jobs:
unittests:
name: conda (${{ matrix.os }}, ${{ matrix.environment-file }})
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
# timeout-minutes: 25
env:
FETCH_EXAMPLES: python -c 'import libpysal; libpysal.examples.fetch_all()'
RUN_TEST: pytest -v -n auto libpysal --cov libpysal --cov-config .coveragerc --cov-report xml --color yes --cov-append --cov-report term-missing
#timeout-minutes: 25
strategy:
matrix:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
environment-file: [ci/36.yaml, ci/37.yaml, ci/38.yaml]
exclude:
- environment-file: ci/36.yaml
os: ['ubuntu-latest']
environment-file: [
ci/38-minimal.yaml,
ci/39.yaml,
ci/310.yaml,
ci/311.yaml,
ci/311-dev.yaml
]
include:
- environment-file: ci/311.yaml
os: macos-latest
- environment-file: ci/311.yaml
os: windows-latest
defaults:
run:
shell: bash -l {0}
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles(matrix.environment-file) }}
- uses: conda-incubator/setup-miniconda@v2
- name: checkout repo
uses: actions/checkout@v3

- name: setup micromamba
uses: mamba-org/provision-with-micromamba@main
with:
miniconda-version: 'latest'
mamba-version: '*'
channels: conda-forge
channel-priority: true
auto-update-conda: false
auto-activate-base: false
environment-file: ${{ matrix.environment-file }}
activate-environment: test
use-only-tar-bz2: true
- run: mamba info --all
- run: mamba list
- run: conda config --show-sources
- run: conda config --show
- run: python -c 'import libpysal; libpysal.examples.fetch_all()'
- run: py.test -v libpysal --cov=libpysal --cov-report=xml
- name: codecov (${{ matrix.os }}, ${{ matrix.environment-file }})
uses: codecov/codecov-action@v1
environment-file: ${{ matrix.environment-file }}
micromamba-version: 'latest'
channel-priority: 'flexible'

- name: run tests - bash
shell: bash -l {0}
run: |
${{ env.FETCH_EXAMPLES }}
${{ env.RUN_TEST }}
if: matrix.os != 'windows-latest'

- name: run tests - powershell
shell: powershell
run: |
${{ env.FETCH_EXAMPLES }}
${{ env.RUN_TEST }}
if: matrix.os == 'windows-latest'

- name: codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
language_version: python3.8
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
language_version: python3
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include authors.txt LICENSE.txt THANKS.txt CHANGELOG.md MANIFEST.in pysal/COPYING requirements_dev.txt requirements_plus.txt requirements.txt requirements_plus_conda.txt requirements_plus_pip.txt requirements_docs.txt

include versioneer.py
include libpysal/_version.py
30 changes: 30 additions & 0 deletions ci/310.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.10
- platformdirs
- beautifulsoup4
- jinja2
- pandas
- scipy
- xarray
# testing
- codecov
- matplotlib
- pytest
- pytest-cov
- pytest-xdist
# optional
- geopandas
- joblib
- networkx
- numba
- packaging
- zstd
# for docs build action (this env only)
- nbsphinx
- numpydoc
- sphinx
- sphinxcontrib-bibtex
- sphinx_bootstrap_theme
33 changes: 33 additions & 0 deletions ci/311-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.11
- platformdirs
- beautifulsoup4
- jinja2
- pandas
- scipy
- xarray
# testing
- codecov
- matplotlib
- pytest
- pytest-cov
- pytest-xdist
# optional
- geopandas
- joblib
- networkx
- packaging
- zstd
- Cython
- pip
- pip:
# dev versions of packages
- --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple
- scipy
- pandas
- git+https://github.com/shapely/shapely.git@main
- git+https://github.com/geopandas/geopandas.git@main
- git+https://github.com/pydata/xarray.git@main
25 changes: 25 additions & 0 deletions ci/311.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: test
channels:
- conda-forge
dependencies:
- python=3.11
- platformdirs
- beautifulsoup4
- jinja2
- pandas
- scipy
- xarray
# testing
- codecov
- matplotlib
- pytest
- pytest-cov
- pytest-xdist
# optional
- geopandas>=0.12.0
- joblib
- networkx
- packaging
- shapely>=2.0b1
- xarray
- zstd
Loading

0 comments on commit 2000cc3

Please sign in to comment.