Skip to content

build: 🔨 switch to using uv #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 1 addition & 4 deletions .cz.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[tool.commitizen]
bump_message = "build(version): :bookmark: update version from $current_version to $new_version [skip ci]"
update_changelog_on_bump = true
version_provider = "poetry"
version_files = [
"pyproject.toml"
]
version_provider = "uv"
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ justfile
.gitignore
ruff.toml
pyproject.toml
poetry.lock
uv.lock
2 changes: 0 additions & 2 deletions .github/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ group:
dest: .gitignore
- source: justfile
dest: justfile
- source: poetry.toml
dest: poetry.toml
- source: .cz.toml
dest: .cz.toml
- source: ruff.toml
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ gh repo create NAME --template seedcase-project/template-python-project

## Setting things up after cloning

To add Poetry:

``` bash
cd new-project
poetry init
```

Search for `NAME` and `REPO` and replace them with the name of your project and the repository name. Then look for any `TODO` items.

## Setting things up
Expand Down
16 changes: 8 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ run-all: install-deps format-python check-python test-python check-commits build

# Install Python package dependencies
install-deps:
poetry install
uv synch

# Run the Python tests
test-python:
poetry run pytest
uv run pytest

# Check Python code with the linter for any errors that need manual attention
check-python:
poetry run ruff check .
uv run ruff check .

# Reformat Python code to match coding style and general structure
format-python:
poetry run ruff check --fix .
poetry run ruff format .
uv run ruff check --fix .
uv run ruff format .

# Build the documentation website using Quarto
build-website:
Expand All @@ -28,8 +28,8 @@ build-website:
# Delete any previously built files from quartodoc.
# -f is to not give an error if the files don't exist yet.
rm -f docs/reference/*.qmd
poetry run quartodoc build
poetry run quarto render --execute
uv run quartodoc build
uv run quarto render --execute

# Run checks on commits with non-main branches
check-commits:
Expand All @@ -38,7 +38,7 @@ check-commits:
number_of_commits=$(git rev-list --count HEAD ^main)
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
then
poetry run cz check --rev-range main..HEAD
uv run cz check --rev-range main..HEAD
else
echo "Can't either be on ${branch_name} or have more than ${number_of_commits}."
fi
2 changes: 0 additions & 2 deletions poetry.toml

This file was deleted.

49 changes: 23 additions & 26 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
[tool.poetry]
[project]
name = "template-python-package"
version = "0.0.1"
description = ""
version = "0.1.0"
description = "Template Python Package"
authors = [
"Luke W. Johnston <lwjohnst@gmail.com>",
"Kristiane Beicher <kris.beicher@clin.au.dk>",
"Signe Kirk Brødbæk <signekb@clin.au.dk>",
"Marton Vago <marton.vago95@gmail.com >",
{name = "Luke W. Johnston", email = "lwjohnst@gmail.com" },
{name = "Kristiane Beicher", email = "kris.beicher@clin.au.dk" },
{name = "Signe Kirk Brødbæk", email = "signekb@clin.au.dk" },
{name = "Marton Vago", email = "marton.vago95@gmail.com" },
]
maintainers = [
"Luke W. Johnston <lwjohnst@gmail.com>",
"Kristiane Beicher <kris.beicher@clin.au.dk>",
"Signe Kirk Brødbæk <signekb@clin.au.dk>",
"Marton Vago <marton.vago95@gmail.com >",
{name = "Luke W. Johnston", email = "lwjohnst@gmail.com" },
{name = "Kristiane Beicher", email = "kris.beicher@clin.au.dk" },
{name = "Signe Kirk Brødbæk", email = "signekb@clin.au.dk" },
{name = "Marton Vago", email = "marton.vago95@gmail.com" },
]
readme = "README.md"
homepage = "https://NAME.seedcase-project.org"
repository = "https://github.com/seedcase-project/REPO"
license = "MIT"
license-files = ["LICENSE.md"]
requires-python = ">=3.12"
dependencies = []

[tool.poetry.urls]
"Bug Tracker" = "https://github.com/seedcase-project/REPO/issues"

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

[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
# TODO: Update these
[project.urls]
homepage = "https://PROJECT.seedcase-project.org"
repository = "https://github.com/seedcase-project/REPO"
changelog = "https://github.com/seedcase-project/REPO/blob/main/CHANGELOG.md"
issues = "https://github.com/seedcase-project/REPO/issues"

[tool.poetry.group.dev.dependencies]
ruff = "^0.6.2"

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

[tool.pytest.ini_options]
addopts = [
# A short traceback mode to make it easier to view
"--tb=short",
# Use the package in `src/`
# Use the `src/` package
"--import-mode=importlib",
]