Skip to content

Commit

Permalink
Merge branch 'develop' into polars
Browse files Browse the repository at this point in the history
# Conflicts:
#	poetry.lock
  • Loading branch information
AdrianDAlessandro committed Oct 1, 2024
2 parents 6096feb + 8829dcf commit 63420ba
Show file tree
Hide file tree
Showing 8 changed files with 894 additions and 672 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dependabot and Pre-commit auto-merge

# This workflow is triggered when a PR is opened or synchronized
# by dependabot or pre-commit-ci. It will approve and merge the PR
# automatically.

# Source: auto-merge.yml from dalonsoa and alexdewar

on:
pull_request:

permissions:
contents: write
pull-requests: write # Needed if in a private repository

jobs:
auto-merge:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
steps:
- name: Enable auto-merge for dependabot and pre-commit-ci PRs
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
# GitHub provides this variable in the CI env. You don't
# need to add anything to the secrets vault.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Check links in Markdown files

on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 1" # midnight every Monday

Expand Down
78 changes: 6 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,9 @@
name: Test and build

on: [push, pull_request, release]
on:
push:
branches:
- main
pull_request:

jobs:
qa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pre-commit/action@v3.0.0

check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
name: Check links in markdown files
with:
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'

test:
needs: qa
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest, macos-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.5.1

- name: Install dependencies
run: poetry install --with dev

- name: Run tests
run: poetry run pytest

- name: Upload coverage to Codecov
if: success() && (matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9)
uses: codecov/codecov-action@v3


deploy-docs:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.5.1

- name: Install dependencies
run: poetry install --with docs

- name: Deploy Docs
run: poetry run mkdocs gh-deploy --force
uses: ./.github/workflows/ci_template.yml
43 changes: 43 additions & 0 deletions .github/workflows/ci_template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test

on:
workflow_call:
inputs:
os:
description: 'Operating system'
default: '["ubuntu-latest", "windows-latest"]'
type: string
python-version:
description: 'Python version'
default: '["3.12"]'
type: string

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{fromJson(inputs.os)}}
python-version: ${{fromJson(inputs.python-version)}}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.3

- name: Install dependencies
run: poetry install --with dev

- name: Run tests
run: poetry run pytest

- name: Upload coverage to Codecov
if: success() && (matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9)
uses: codecov/codecov-action@v3

94 changes: 94 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
on:
release:
types: [published]

permissions:
contents: write
attestations: write
id-token: write

jobs:
test:
uses: ./.github/workflows/ci_template.yml
with:
os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
python-version: '["3.9", "3.10", "3.11", "3.12"]'

build-wheel:
needs: test
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v2
with:
attest-build-provenance-github: true
skip-wheel: true

publish-docs:
needs: build-wheel
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.8.3

- name: Install dependencies
run: poetry install --with docs

- name: Deploy Docs
run: poetry run mkdocs gh-deploy --force

publish-TestPyPI:
needs: publish-docs
name: Publish to TestPyPI
runs-on: ubuntu-latest

steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist

- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v1
with:
subject-path: dist

- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true

publish-PyPI:
needs: publish-TestPyPI
name: Publish to PyPI
runs-on: ubuntu-latest

steps:
- name: Download packages built by build-and-inspect-python-package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist

- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v1
with:
subject-path: dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ repos:
rev: "23.1.0"
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
# - repo: https://github.com/PyCQA/flake8
# rev: 6.0.0
# hooks:
# - id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.991"
hooks:
Expand Down
Loading

0 comments on commit 63420ba

Please sign in to comment.