Skip to content

Commit 3e262ed

Browse files
authored
Switch to UV for package management (#133)
* Source kom version from src * Update conda recipe to use uv * Update test action
1 parent 5ed9bc2 commit 3e262ed

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

.github/workflows/build-test.yml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches: [ main ]
66
workflow_dispatch:
77

8-
98
concurrency:
109
group: ${{ github.workflow }}-${{ github.ref }}
1110
cancel-in-progress: true

.github/workflows/pypi-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ jobs:
3737
env:
3838
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
3939
run: |
40-
sed -i "s/0.0.0/${{ env.tag }}/g" kelp_o_matic/__init__.py pyproject.toml
40+
sed -i "s/0.0.0/${{ env.tag }}/g" kelp_o_matic/__init__.py
4141
uv build
4242
uv publish

.github/workflows/test.yml

+10-11
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,20 @@ jobs:
2929
- "3.10"
3030
steps:
3131
- uses: actions/checkout@v4
32-
- name: Setup python for test ${{ matrix.py }}
33-
uses: actions/setup-python@v5
32+
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v5
3435
with:
35-
python-version: ${{ matrix.py }}
36+
version: "0.5.26"
37+
enable-cache: true
3638

37-
- name: Setup Poetry
38-
uses: abatilo/actions-poetry@v2
39+
- name: "Set up Python"
40+
uses: actions/setup-python@v5
3941
with:
40-
poetry-version: 1.6.1
42+
python-version: ${{ matrix.py }}
4143

4244
- name: Install dependencies
43-
run: |
44-
poetry update
45-
poetry run pip install --upgrade setuptools
46-
poetry install
45+
run: uv sync --all-extras --dev
4746

4847
- name: Run tests
49-
run: poetry run pytest
48+
run: uv run pytest

conda/recipe.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ build:
2121
requirements:
2222
host:
2323
- python >=3.10
24-
- poetry-core
24+
- uv
25+
- hatch
2526
- pip
2627
run:
2728
- python >=3.10

pyproject.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
22
name = "kelp-o-matic"
3-
version = "0.0.0"
3+
dynamic = ["version"]
44
description = "Hakai Segment Tool for GeoTiff RPAS Imagery"
5+
readme = "README.md"
56
authors = [{ name = "Taylor Denouden", email = "taylor.denouden@hakai.org" }]
67
requires-python = ">=3.10, <3.14"
7-
readme = "README.md"
88
license = "MIT"
99
dependencies = [
1010
"numpy>=1.24.2",
@@ -46,6 +46,9 @@ include = ["kelp_o_matic"]
4646
[tool.hatch.build.targets.wheel]
4747
include = ["kelp_o_matic"]
4848

49+
[tool.hatch.version]
50+
path = "kelp_o_matic/__init__.py"
51+
4952
[build-system]
5053
requires = ["hatchling"]
5154
build-backend = "hatchling.build"

uv.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)