Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into centroid
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis committed Oct 21, 2023
2 parents afe4f12 + 5d09bc6 commit bdc647e
Show file tree
Hide file tree
Showing 89 changed files with 8,537 additions and 5,089 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
19 changes: 19 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
categories:
- title: Bug Fixes
labels:
- bug
- title: Enhancements
labels:
- enhancement
- title: Maintenance
labels:
- maintenance
- title: Other Changes
labels:
- "*"
23 changes: 14 additions & 9 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,30 @@
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/310.yaml]
environment-file: [ci/312.yaml]
experimental: [false]
defaults:
run:
shell: bash -l {0}

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

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

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


- name: Install
run: pip install -e . --no-deps --force-reinstall

- 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
Expand All @@ -50,8 +55,8 @@
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
- name: Push to gh-pages
uses: ad-m/github-push-action@master
with:
branch: gh-pages
Expand Down
67 changes: 31 additions & 36 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,60 @@
# Release package on GitHub and publish to PyPI

# Important: In order to trigger this workflow for the organization
# repo (organzation-name/repo-name vs. user-name/repo-name), a tagged
# commit must be made to *organzation-name/repo-name*. If the tagged
# commit is made to *user-name/repo-name*, a release will be published
# under the user's name, not the organzation.

#--------------------------------------------------
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

workflow_dispatch:
inputs:
version:
description: Manual Release
default: test
required: false

jobs:
build:
name: Create release & publish to PyPI
runs-on: ubuntu-latest

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

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

- name: Set up python
uses: actions/setup-python@v3
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
python -m pip install --upgrade pip build twine
python -m build
twine check --strict dist/*
- name: Create Release Notes
uses: actions/github-script@v6
with:
body: ${{ steps.changetxt.outputs.text }}
body_path: ${{ steps.changetxt.outputs.path }}
name: Release ${{ env.TAG }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
130 changes: 72 additions & 58 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,72 @@
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '59 21 * * *'

jobs:
unittests:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
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: ['ubuntu-latest']
environment-file: [ci/37-minimal.yaml, ci/37.yaml, ci/38.yaml, ci/39.yaml, ci/310.yaml]
include:
- environment-file: ci/310.yaml
os: macos-latest
- environment-file: ci/310.yaml
os: windows-latest

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: 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
name: libpysal-codecov
name: Tests

on:
push:
branches: [main]
pull_request:
branches:
- "*"
schedule:
- cron: "0 0 * * 1,4"
workflow_dispatch:
inputs:
version:
description: Manual Unittest Run
default: test
required: false

jobs:
Test:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
environment-file:
- ci/310-oldest.yaml
- ci/310.yaml
- ci/311.yaml
- ci/312.yaml
- ci/312-dev.yaml
- ci/312-no-optional.yaml
include:
- environment-file: ci/312.yaml
os: macos-latest
- environment-file: ci/312.yaml
os: windows-latest
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 libpysal
run: pip install .; python -c 'import libpysal; libpysal.examples.fetch_all()'

- name: Test libpysal
run: |
pytest -v --color yes --cov libpysal --cov-append --cov-report term-missing --cov-report xml .
- name: Codecov
uses: codecov/codecov-action@v3

- name: Generate and publish the report
if: |
failure()
&& steps.status.outcome == 'failure'
&& github.event_name == 'schedule'
&& github.repository_owner == 'pysal'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: pytest-log.jsonl
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/psf/black
rev: 21.12b0
hooks:
- id: black
language_version: python3.9
- repo: https://github.com/psf/black
rev: "23.10.0"
hooks:
- id: black
language_version: python3
2 changes: 0 additions & 2 deletions Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

47 changes: 0 additions & 47 deletions Makefile

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Python Spatial Analysis Library Core
.. image:: https://github.com/pysal/libpysal/workflows/.github/workflows/unittests.yml/badge.svg
:target: https://github.com/pysal/libpysal/actions?query=workflow%3A.github%2Fworkflows%2Funittests.yml

.. image:: https://codecov.io/gh/pysal/libpysal/branch/master/graph/badge.svg
.. image:: https://codecov.io/gh/pysal/libpysal/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pysal/libpysal

.. image:: https://badge.fury.io/py/libpysal.svg
Expand Down Expand Up @@ -59,7 +59,7 @@ If you have any suggestions, feature requests, or bug reports,
please open new `issues <https://github.com/pysal/libpysal/issues>`_ on GitHub.
To submit patches, please review `PySAL's documentation for developers <https://pysal.org/docs/devs/>`_,
the PySAL `development guidelines <https://github.com/pysal/pysal/wiki>`_,
the `libpysal contributing guidelines <https://github.com/pysal/libpysal/blob/master/.github/CONTRIBUTING.md>`_
the `libpysal contributing guidelines <https://github.com/pysal/libpysal/blob/main/.github/CONTRIBUTING.md>`_
before opening a `pull request <https://github.com/pysal/libpysal/pulls>`_.
Once your changes get merged, you’ll automatically be added to
the `Contributors List <https://github.com/pysal/libpysal/graphs/contributors>`_.
Expand All @@ -76,6 +76,6 @@ To search for or report bugs, please see `libpysal's issues <https://github.com/
License information
*******************

See the `LICENSE <https://github.com/pysal/libpysal/blob/master/LICENSE.txt>`_
See the `LICENSE <https://github.com/pysal/libpysal/blob/main/LICENSE.txt>`_
for information on the history of this software, terms & conditions for usage,
and a DISCLAIMER OF ALL WARRANTIES.
Loading

0 comments on commit bdc647e

Please sign in to comment.