Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ jobs:
- name: 🛎️ Check out repository
uses: actions/checkout@v4

- name: 📦 Set up Poetry
run: pipx install poetry==2.0.0
- name: 📦 Set up UV
uses: astral-sh/setup-uv@v5
with:
version: "0.6.5"
enable-cache: true

- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: poetry
python-version-file: "pyproject.toml"

- name: 🔨 Install dependencies
run: poetry install --without dev
run: uv sync --group test

- name: ✅ Run unit tests
run: poetry run pytest -vvv
run: uv run pytest -vvv
33 changes: 5 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# IntelliJ project files
# IDE and system files
.vscode/
.idea/
.DS_Store

# IntelliJ project files
.run/
*.iml
out
Expand Down Expand Up @@ -89,33 +93,6 @@ target/
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

Expand Down
10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
ci:
autoupdate_schedule: quarterly
skip: ["identity", "poetry-lock", "pytest", "coverage-badge"]
skip: ["identity", "uv-lock", "pytest", "coverage-badge"]

repos:
- repo: meta
Expand Down Expand Up @@ -31,12 +31,10 @@ repos:
- id: check-ast
name: Validate Python

- repo: https://github.com/python-poetry/poetry
rev: 2.0.0
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.6.5
hooks:
- id: poetry-check
name: Check that the Poetry configuration is valid
- id: poetry-lock
- id: uv-lock
name: Check that the lock file is up-to-date

# Formatting
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">

[![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://www.python.org/downloads/release/python-3110/)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![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)
[![tests](https://github.com/Bilbottom/python-template/actions/workflows/tests.yaml/badge.svg)](https://github.com/Bilbottom/python-template/actions/workflows/tests.yaml)
[![coverage](coverage.svg)](https://github.com/dbrgn/coverage-badge)
[![GitHub last commit](https://img.shields.io/github/last-commit/Bilbottom/python-template)](https://shields.io/badges/git-hub-last-commit)
Expand Down
34 changes: 14 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "python-template"
version = "0.0.0"
description = ""
authors = [{name = "Bilbottom"}]
readme = "README.md"
requires-python = ">=3.11"
dynamic = ["dependencies"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

dependencies = []

[tool.poetry]
packages = [{include = "src"}]

[tool.poetry.group]
dev.optional = false
test.optional = false

[tool.poetry.group.dev.dependencies]
coverage-badge = "^1.1.0"
pre-commit = "^3.6.2"

[tool.poetry.group.test.dependencies]
pytest = "^8.0.2"
pytest-cov = "^4.1.0"
[dependency-groups]
dev = [
"coverage-badge>=1.1.0",
"pre-commit>=4.1.0",
]
test = [
"pytest>=8.3.5",
"pytest-cov>=6.0.0",
]


[tool.pytest.ini_options]
Expand Down
Loading