Skip to content

Commit

Permalink
Merge pull request #7 from simonprovost/refactor/uv_migration
Browse files Browse the repository at this point in the history
  • Loading branch information
simonprovost authored Dec 30, 2024
2 parents 298774d + 2b5735f commit 6cd6a92
Show file tree
Hide file tree
Showing 12 changed files with 3,045 additions and 3,466 deletions.
6 changes: 0 additions & 6 deletions .env.example

This file was deleted.

29 changes: 18 additions & 11 deletions .github/workflows/documentation-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,33 @@ on:
- main
paths:
- 'docs/**'

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material==9.5.27 mkdocs-get-deps==0.2.0 mkdocs-material[imaging] mkdocs-material-extensions==1.3.1 mkdocs-minify-plugin==0.8.0
- run: mkdocs gh-deploy --force --remote-branch gh-pages
version: "0.5.11"
enable-cache: true
cache-dependency-glob: "docs/**"
python-version: "cpython-3.9.21-linux-x86_64-gnu"

- name: Install mkdocs deps
run: |
uv sync --only-group doc
- name: Deploy Docs
run: |
uv run mkdocs gh-deploy --force --remote-branch gh-pages
73 changes: 40 additions & 33 deletions .github/workflows/publish-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,50 @@ on:
branches:
- main

permissions:
contents: read

jobs:
check_build_trigger:
name: Check build trigger
runs-on: ubuntu-latest
outputs:
build: ${{ steps.check_build_trigger.outputs.build }}

steps:
- name: Checkout auto-sklong
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- id: check_build_trigger
name: Check build trigger
name: Run check_build_trigger.sh
run: bash build_tools/github/check_build_trigger.sh

unit_testing:
runs-on: ${{ matrix.os }}
needs: check_build_trigger
if: needs.check_build_trigger.outputs.build
strategy:
matrix:
python-version: [ 3.9 ]
os: [ ubuntu-latest ]

runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Checkout this repository
uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@main
name: Setup PDM
- name: Install uv & Python
uses: astral-sh/setup-uv@v4
with:
python-version: 3.9
architecture: x64
prerelease: false
enable-pep582: true
version: "0.5.11"
enable-cache: true
python-version: "cpython-3.9.21-linux-x86_64-gnu"

- name: Install dependencies from pdm.lock
- name: Lock & Sync All Dependencies
run: |
pdm install
uv lock
uv sync --all-groups
- name: Run tests
run: pdm run tests
- name: Run Tests Unit
run: |
uv run pytest -sv tests/unit
pypi-publish:
name: ☁️ upload release to PyPI
name: ☁️ upload release to TestPyPI
runs-on: ubuntu-latest
needs: [check_build_trigger, unit_testing]
needs: [ check_build_trigger, unit_testing ]
if: |
always() &&
needs.check_build_trigger.outputs.build &&
Expand All @@ -67,9 +57,26 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v3
- name: Install uv & Python
uses: astral-sh/setup-uv@v4
with:
version: "0.5.11"
enable-cache: true
python-version: "cpython-3.9.21-linux-x86_64-gnu"

- name: Lock & Sync for Release
run: |
uv lock
uv sync --all-groups
- name: Publish package distributions to PyPI
run: pdm publish
- name: Build distribution
run: |
uv build
- name: Publish package to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
uv publish
77 changes: 22 additions & 55 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,35 @@
name: pytest
name: ci-tests

on:
workflow_dispatch:
pull_request:

jobs:
unit:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
permissions:
contents: read

- name: Checkout this repository
uses: actions/checkout@v3
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@main
name: Setup PDM
- name: Install uv & Python
uses: astral-sh/setup-uv@v4
with:
architecture: x64
prerelease: false
enable-pep582: true
version: "0.5.11"
enable-cache: true
python-version: "cpython-3.9.21-linux-x86_64-gnu"

- name: Install dependencies from pdm.lock
- name: Lock & Sync All Dependencies
run: |
pdm install --dev
- name: Run tests
run: pdm run tests_unit

system:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: [ubuntu-latest]
uv lock
uv sync --all-groups
runs-on: ${{ matrix.os }}

steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Checkout this repository
uses: actions/checkout@v3

- uses: pdm-project/setup-pdm@main
name: Setup PDM
with:
architecture: x64
prerelease: false
enable-pep582: true

- name: Install dependencies from pdm.lock
- name: Run Tests Unit
run: |
pdm install --dev
uv run pytest -sv tests/unit
- name: Run tests
run: pdm run tests_system
- name: Run Tests System
run: |
uv run pytest -sv tests/system
37 changes: 17 additions & 20 deletions .github/workflows/test-with-pre.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
name: Test --pre

on:
workflow_dispatch:
schedule:
- cron: "00 0 * * 1"

jobs:
unit:
name: Run tests with prereleases
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
python-version: ["3.9.21"]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Checkout this repository
uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@main
name: Setup PDM
- name: Install uv & Python
uses: astral-sh/setup-uv@v4
with:
architecture: x64
prerelease: false
enable-pep582: true
use-cache: false
pip-args: "--pre"
pytest-args: "-W error -W ignore::sklearn.exceptions.ConvergenceWarning"
version: "0.5.11"
enable-cache: true
python-version: "cpython-3.9.21-linux-x86_64-gnu"

- name: Install dependencies from pdm.lock
- name: Lock dependencies with pre-releases
run: |
pdm install --dev
uv lock --prerelease allow
- name: Sync All Groups
run: |
uv sync --all-groups
- name: Run tests
run: pdm run tests_unit
run: |
uv run pytest -sv tests/unit
Loading

0 comments on commit 6cd6a92

Please sign in to comment.