Skip to content

Commit

Permalink
chore: migrate migrate packaging to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke committed Dec 20, 2024
1 parent 199cb64 commit b63967c
Show file tree
Hide file tree
Showing 7 changed files with 580 additions and 679 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,13 @@ jobs:
name: "Template: ${{ matrix.python-version }} - ${{ matrix.os }}"
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: poetry install
- uses: astral-sh/setup-uv@v5
- run: uv sync --no-python-downloads
shell: bash
- name: Test with Pytest
run: poetry run pytest
- run: uv run pytest
shell: bash

# Generate package, run test, run linting and build docs
Expand Down Expand Up @@ -94,7 +89,6 @@ jobs:
PIPX_DEFAULT_PYTHON: ${{ steps.setup-python.outputs.python-path }}
- run: cat pyproject.toml
working-directory: my-project
- run: pipx install poetry
env:
PIPX_DEFAULT_PYTHON: ${{ steps.setup-python.outputs.python-path }}
- run: poetry install --with docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
upgrade:
uses: browniebroke/github-actions/.github/workflows/poetry-upgrade.yml@v1
uses: browniebroke/github-actions/.github/workflows/uv-upgrade.yml@v1
secrets:
gh_pat: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
4 changes: 2 additions & 2 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tasks:
- command: |
pip install poetry
PIP_USER=false poetry install
pip install uv
PIP_USER=false uv sync
- command: |
pip install pre-commit
pre-commit install
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: "{{package_name}}|.all-contributorsrc"
default_stages: [commit]
default_stages: [pre-commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -22,10 +22,10 @@ repos:
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/python-poetry/poetry
rev: 1.8.5
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.11
hooks:
- id: poetry-check
- id: uv-lock
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
Expand Down
645 changes: 0 additions & 645 deletions poetry.lock

This file was deleted.

37 changes: 20 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
[build-system]
build-backend = "poetry.core.masonry.api"
requires = [ "poetry-core>=1" ]

[tool.poetry]
name = "pypackage-template"
version = "0.1.0"
description = "A template for generating a Python package"
authors = [ "Bruno Alla <[email protected]>" ]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.9"

[tool.poetry.group.dev.dependencies]
copier = "^9.0.0"
pytest = "^8.0.0"
pytest-mock = "^3.3"
build-backend = "setuptools.build_meta"
requires = [ "setuptools" ]

[tool.ruff]
target-version = "py39"
Expand Down Expand Up @@ -61,3 +46,21 @@ lint.per-file-ignores."tests/**/*" = [
[tool.pytest.ini_options]
addopts = "-v -Wdefault"
testpaths = "tests/"

[dependency-groups]
dev = [
"copier<10.0.0,>=9.0.0",
"pytest<9.0.0,>=8.0.0",
"pytest-mock<4.0,>=3.3",
]

[project]
authors = [
{name = "Bruno Alla", email = "[email protected]"},
]
license = {text = "MIT"}
requires-python = ">=3.9"
dependencies = []
name = "pypackage-template"
version = "0.1.0"
description = "A template for generating a Python package"
549 changes: 549 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit b63967c

Please sign in to comment.