Skip to content

Commit

Permalink
chore: use 'uv' instead of 'poetry'
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Jan 27, 2025
1 parent 31a6550 commit 931a760
Show file tree
Hide file tree
Showing 6 changed files with 1,597 additions and 1,534 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: bundle
on:
push:
tags:
- '*'

jobs:
build:
name: build dist files
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: build dist
run: uv build
- uses: actions/upload-artifact@v4
with:
name: artifacts
path: dist/*
if-no-files-found: error

release:
name: create Github release
runs-on: ubuntu-latest
steps:
- uses: softprops/action-gh-release@v2

publish:
name: release to pypi
needs: build
runs-on: ubuntu-latest

environment:
name: pypi-release
url: https://pypi.org/project/pytest-iam/
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
name: artifacts
path: dist

- name: Push build artifacts to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
59 changes: 50 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,68 @@
name: tests
on:
push:
branches:
- main
- '*.*.*'
pull_request:
branches:
- main
- '*.*.*'

jobs:
tests:
name: ${{ matrix.python }}
name: py${{ matrix.python }} unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- '3.13'
- '3.12'
- '3.11'
- '3.10'
- '3.9'
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python }}
cache: 'poetry'
- run: poetry install
- run: poetry run pytest
enable-cache: true
- name: Install Python ${{ matrix.python }}
run: uv python install ${{ matrix.python }}
- name: Install dependencies
run: uv sync --all-extras
- name: Run tests
run: uv run pytest --showlocals

minversions:
name: minimum dependency versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install minimum dependencies
run: uv sync --resolution=lowest-direct --all-extras
- name: Run tests
run: uv run pytest --showlocals

style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/[email protected]

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install dependencies
run: uv sync --group doc
- run: uv run sphinx-build doc build/sphinx/html
6 changes: 3 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ sphinx:
build:
os: "ubuntu-22.04"
tools:
python: "3.11"
python: "3.12"
jobs:
post_create_environment:
- pip install poetry
- poetry export --with doc --output requirements.txt
- pip install uv
- uv export --group doc --no-hashes --output-file requirements.txt
post_install:
- pip install .
- pip install --requirement requirements.txt
Loading

0 comments on commit 931a760

Please sign in to comment.