Skip to content

Commit eca0d28

Browse files
committed
Use uv instead of poetry
1 parent 718bfab commit eca0d28

7 files changed

Lines changed: 1221 additions & 688 deletions

File tree

.github/workflows/python-app.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,17 @@ jobs:
2828

2929
steps:
3030
- uses: actions/checkout@v4
31-
- name: Install poetry
32-
run: pipx install poetry
33-
- uses: actions/setup-python@v5
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v5
3433
with:
35-
python-version: '3.12'
36-
cache: 'poetry'
37-
- run: poetry install
34+
version: 'latest'
35+
- run: uv sync
3836
- name: Lint with flake8
3937
run: |
4038
# stop the build if there are Python syntax errors or undefined names
41-
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39+
uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
4240
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
uv run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
4442
- name: Set up PostgreSQL
4543
run: |
4644
pg_isready -U postgres -d dspacestatistics
@@ -52,7 +50,7 @@ jobs:
5250
PGPASSWORD: postgres
5351
- name: Test with pytest
5452
run: |
55-
poetry run pytest
53+
uv run pytest
5654
env:
5755
PGHOST: localhost
5856
PGPASSWORD: dspacestatistics

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## Unreleased
8+
### Changed
9+
- Use uv instead of poetry to manage the project and dependencies
810

911
## 1.4.4 - 2024-09-11
1012
### Changed

poetry.lock

Lines changed: 0 additions & 622 deletions
This file was deleted.

pyproject.toml

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
1-
[tool.poetry]
1+
[project]
22
name = "dspace-statistics-api"
33
version = "1.4.5-dev"
44
description = "A simple REST API to expose Solr view and download statistics for items, communities, and collections in a DSpace repository."
5-
authors = ["Alan Orth <git@mjanja.mozmail.com>"]
5+
authors = [
6+
{ name = "Alan Orth", email = "git@mjanja.mozmail.com" }
7+
]
8+
9+
requires-python = ">= 3.8.1"
10+
611
license = "GPL-3.0-only"
12+
license-files = ["LICENSE.txt"]
13+
dependencies = [
14+
"gunicorn==23.0.*",
15+
"falcon==3.1.*",
16+
"psycopg2==2.9.*",
17+
"requests==2.32.*",
18+
"falcon-swagger-ui",
19+
]
720

8-
[tool.poetry.dependencies]
9-
python = "^3.8.1"
10-
gunicorn = "^23.0.0"
11-
falcon = "^3.1.3"
12-
psycopg2 = "^2.9.9"
13-
requests = "^2.32.3"
14-
falcon-swagger-ui = {git = "https://github.com/alanorth/falcon-swagger-ui.git", rev="falcon3-update-swagger-ui"}
21+
[project.urls]
22+
repository = "https://github.com/ilri/dspace-statistics-api"
23+
homepage = "https://github.com/ilri/dspace-statistics-api"
1524

16-
[tool.poetry.group.dev.dependencies]
17-
black = "^24.0.0"
18-
flake8 = "^7.1.1"
19-
isort = "^5.13.2"
20-
pytest = "^8.3.3"
25+
[tool.uv.sources]
26+
falcon-swagger-ui = { git = "https://github.com/alanorth/falcon-swagger-ui", rev = "falcon3-update-swagger-ui" }
2127

28+
# So uv doesn't fall back to setuptools
29+
# See: https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-build-backend
2230
[build-system]
23-
requires = ["poetry>=0.12"]
24-
build-backend = "poetry.masonry.api"
31+
requires = ["hatchling"]
32+
build-backend = "hatchling.build"
33+
34+
[dependency-groups]
35+
dev = [
36+
"flake8==7.1.*",
37+
"isort==5.13.*",
38+
"pytest==8.3.*",
39+
]
2540

2641
[tool.isort]
2742
profile = "black"

requirements-dev.txt

Lines changed: 350 additions & 29 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 277 additions & 12 deletions
Large diffs are not rendered by default.

uv.lock

Lines changed: 554 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)