Skip to content

Commit

Permalink
Merge pull request #443 from jakob-keller/dependencies
Browse files Browse the repository at this point in the history
build(python): migrate from `poetry` to `uv`
  • Loading branch information
jakob-keller authored Oct 27, 2024
2 parents 41a2492 + 1937fab commit 6b39325
Show file tree
Hide file tree
Showing 7 changed files with 556 additions and 659 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
contents: write
pages: write
id-token: write
env:
UV_PYTHON_PREFERENCE: only-system
UV_LOCKED: 1
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
Expand All @@ -36,13 +39,15 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Poetry
run: pipx install poetry
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
version: "0.4.27"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: poetry
- id: cz
name: Create bump and changelog
uses: commitizen-tools/[email protected]
Expand All @@ -51,7 +56,7 @@ jobs:
increment: ${{ inputs.increment }}
check_consistency: true
- name: Build package
run: poetry build
run: uv build
- name: Release to GitHub
uses: softprops/action-gh-release@v2
with:
Expand All @@ -68,7 +73,7 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build documentation
run: poetry run pdoc --html peprock
run: uv run pdoc --html peprock
- name: Upload documentation
uses: actions/upload-pages-artifact@v3
with:
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,31 @@ jobs:
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
env:
PYTHON: ${{ matrix.python-version }}
UV_PYTHON_PREFERENCE: only-system
UV_LOCKED: 1
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Poetry
run: pipx install poetry
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
version: "0.4.27"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install dependencies
run: poetry install
- name: Check code formatting
run: poetry run ruff format --check
run: uv run ruff format --check
- name: Run linter
run: poetry run ruff check
run: uv run ruff check
- name: Run type checker
run: poetry run mypy
run: uv run mypy
- name: Run unit tests
run: poetry run pytest --cov --cov-report=xml
run: uv run pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ repos:
rev: v1.12.0
hooks:
- id: mypy
- repo: https://github.com/python-poetry/poetry
rev: 1.8.4
hooks:
- id: poetry-check
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.29.1
hooks:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Foundational Python library

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/peprock)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![codecov](https://codecov.io/gh/Ponte-Energy-Partners/peprock/branch/main/graph/badge.svg?token=LWI96U2WSI)](https://codecov.io/gh/Ponte-Energy-Partners/peprock)
[![test](https://github.com/Ponte-Energy-Partners/peprock/actions/workflows/test.yml/badge.svg)](https://github.com/Ponte-Energy-Partners/peprock/actions/workflows/test.yml)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![PyPI - Version](https://img.shields.io/pypi/v/peprock)](https://pypi.python.org/pypi/peprock)

**peprock** is a collection of versatile Python libraries, provided as namespace packages:
Expand Down
Loading

0 comments on commit 6b39325

Please sign in to comment.