Skip to content

Commit

Permalink
Update infra and actions (2023-10) (#62)
Browse files Browse the repository at this point in the history
* migrate to setuptools_scm

* swap setup/reqs/etc for pyproject

* bump supported Python 3.{10,11,12}

* re-lint repo

* add file extension to LIC

* remove MAN

* remove tools/

* update GHA

* update docs

* min -> MIN in 310

* update codecov

* update README
  • Loading branch information
jGaboardi authored Oct 28, 2023
1 parent b45e391 commit e9ccc47
Show file tree
Hide file tree
Showing 34 changed files with 265 additions and 4,162 deletions.
16 changes: 0 additions & 16 deletions .coveragerc

This file was deleted.

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:
- "*"
24 changes: 14 additions & 10 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

name: Build Docs

on:
push:
# Sequence of patterns matched against refs/tags
Expand All @@ -21,25 +20,30 @@
strategy:
matrix:
os: ['ubuntu-latest']
environment-file: [ci/311.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 @@ -51,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
45 changes: 0 additions & 45 deletions .github/workflows/release.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#--------------------------------------------------
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@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 build twine
python -m build
twine check --strict dist/*
- name: Create Release Notes
uses: actions/github-script@v6
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 }}
58 changes: 25 additions & 33 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,61 +18,53 @@
required: false

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0

testing:
needs: linting
env:
RUN_TEST: pytest inequality -v -r a -n auto --cov inequality --doctest-modules --cov-config .coveragerc --cov-report xml --color yes --cov-append --cov-report term-missing
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
environment-file:
- ci/38.yaml
- ci/39.yaml
- ci/310.yaml
- ci/310-MIN.yaml
- ci/311.yaml
- ci/311-DEV.yaml
- ci/312.yaml
- ci/312-DEV.yaml
include:
- environment-file: ci/311.yaml
- environment-file: ci/312.yaml
os: macos-latest
- environment-file: ci/311.yaml
- environment-file: ci/312.yaml
os: windows-latest
fail-fast: 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 bleeding edge libpysal (Ubuntu / Python 3.11)
shell: bash -l {0}

- name: run tests
run: |
pip install git+https://github.com/pysal/libpysal.git@main
if: matrix.os == 'ubuntu-latest' && contains(matrix.environment-file, 'DEV')

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

- name: run tests - powershell
shell: powershell
run: ${{ env.RUN_TEST }}
if: matrix.os == 'windows-latest'
pytest inequality \
-v \
-r a \
-n auto \
--color yes \
--cov inequality \
--cov-report xml \
--cov-report term-missing \
--cov-append \
--doctest-modules
- name: codecov
uses: codecov/codecov-action@v3
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/versioneer.yml

This file was deleted.

29 changes: 14 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
files: "inequality\/"
repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
language_version: python3
- repo: https://github.com/psf/black
rev: 23.10.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/psf/black
rev: "23.10.0"
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.2"
hooks:
- id: ruff

ci:
autofix_prs: false
autoupdate_schedule: quarterly
2 changes: 0 additions & 2 deletions .pylintrc

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

Loading

0 comments on commit e9ccc47

Please sign in to comment.