Skip to content

Commit f0c7a06

Browse files
authored
build: 🔨 switch to using uv (#51)
## Description Basically just reflects the changes made in Sprout. Closes #41 <!-- Select quick/in-depth as necessary --> This PR needs a quick review.
1 parent 4097498 commit f0c7a06

File tree

8 files changed

+34
-50
lines changed

8 files changed

+34
-50
lines changed

.cz.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
[tool.commitizen]
22
bump_message = "build(version): :bookmark: update version from $current_version to $new_version [skip ci]"
33
update_changelog_on_bump = true
4-
version_provider = "poetry"
5-
version_files = [
6-
"pyproject.toml"
7-
]
4+
version_provider = "uv"

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ justfile
1010
.gitignore
1111
ruff.toml
1212
pyproject.toml
13-
poetry.lock
13+
uv.lock

.github/sync.yml

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ group:
1111
dest: .gitignore
1212
- source: justfile
1313
dest: justfile
14-
- source: poetry.toml
15-
dest: poetry.toml
1614
- source: .cz.toml
1715
dest: .cz.toml
1816
- source: ruff.toml

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

README.md

-7
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ gh repo create NAME --template seedcase-project/template-python-project
99

1010
## Setting things up after cloning
1111

12-
To add Poetry:
13-
14-
``` bash
15-
cd new-project
16-
poetry init
17-
```
18-
1912
Search for `NAME` and `REPO` and replace them with the name of your project and the repository name. Then look for any `TODO` items.
2013

2114
## Setting things up

justfile

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ run-all: install-deps format-python check-python test-python check-commits build
66

77
# Install Python package dependencies
88
install-deps:
9-
poetry install
9+
uv sync
1010

1111
# Run the Python tests
1212
test-python:
13-
poetry run pytest
13+
uv run pytest
1414

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

1919
# Reformat Python code to match coding style and general structure
2020
format-python:
21-
poetry run ruff check --fix .
22-
poetry run ruff format .
21+
uv run ruff check --fix .
22+
uv run ruff format .
2323

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

3434
# Run checks on commits with non-main branches
3535
check-commits:
@@ -38,7 +38,7 @@ check-commits:
3838
number_of_commits=$(git rev-list --count HEAD ^main)
3939
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
4040
then
41-
poetry run cz check --rev-range main..HEAD
41+
uv run cz check --rev-range main..HEAD
4242
else
4343
echo "Can't either be on ${branch_name} or have more than ${number_of_commits}."
4444
fi

poetry.toml

-2
This file was deleted.

pyproject.toml

+23-26
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
1-
[tool.poetry]
1+
[project]
22
name = "template-python-package"
3-
version = "0.0.1"
4-
description = ""
3+
version = "0.1.0"
4+
description = "Template Python Package"
55
authors = [
6-
"Luke W. Johnston <[email protected]>",
7-
"Kristiane Beicher <[email protected]>",
8-
"Signe Kirk Brødbæk <[email protected]>",
9-
"Marton Vago <[email protected] >",
6+
{name = "Luke W. Johnston", email = "[email protected]" },
7+
{name = "Kristiane Beicher", email = "[email protected]" },
8+
{name = "Signe Kirk Brødbæk", email = "[email protected]" },
9+
{name = "Marton Vago", email = "[email protected]" },
1010
]
1111
maintainers = [
12-
"Luke W. Johnston <[email protected]>",
13-
"Kristiane Beicher <[email protected]>",
14-
"Signe Kirk Brødbæk <[email protected]>",
15-
"Marton Vago <[email protected] >",
12+
{name = "Luke W. Johnston", email = "[email protected]" },
13+
{name = "Kristiane Beicher", email = "[email protected]" },
14+
{name = "Signe Kirk Brødbæk", email = "[email protected]" },
15+
{name = "Marton Vago", email = "[email protected]" },
1616
]
1717
readme = "README.md"
18-
homepage = "https://NAME.seedcase-project.org"
19-
repository = "https://github.com/seedcase-project/REPO"
2018
license = "MIT"
19+
license-files = ["LICENSE.md"]
20+
requires-python = ">=3.12"
21+
dependencies = []
2122

22-
[tool.poetry.urls]
23-
"Bug Tracker" = "https://github.com/seedcase-project/REPO/issues"
24-
25-
[tool.poetry.dependencies]
26-
python = "^3.12"
27-
28-
[tool.poetry.group.test.dependencies]
29-
pytest = "^8.3.2"
23+
# TODO: Update these
24+
[project.urls]
25+
homepage = "https://PROJECT.seedcase-project.org"
26+
repository = "https://github.com/seedcase-project/REPO"
27+
changelog = "https://github.com/seedcase-project/REPO/blob/main/CHANGELOG.md"
28+
issues = "https://github.com/seedcase-project/REPO/issues"
3029

31-
[tool.poetry.group.dev.dependencies]
32-
ruff = "^0.6.2"
3330

3431
[build-system]
35-
requires = ["poetry-core"]
36-
build-backend = "poetry.core.masonry.api"
32+
requires = ["hatchling"]
33+
build-backend = "hatchling.build"
3734

3835
[tool.pytest.ini_options]
3936
addopts = [
4037
# A short traceback mode to make it easier to view
4138
"--tb=short",
42-
# Use the package in `src/`
39+
# Use the `src/` package
4340
"--import-mode=importlib",
4441
]

0 commit comments

Comments
 (0)