Skip to content

Commit f45ccac

Browse files
committed
chore: migrate to uv
1 parent 6a69142 commit f45ccac

File tree

8 files changed

+1385
-64
lines changed

8 files changed

+1385
-64
lines changed

.github/workflows/pypi-publish.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
- uses: actions/setup-python@v4
1919
with:
2020
python-version: 3.8
21-
- name: Install Poetry
22-
uses: snok/install-poetry@v1
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v5
2323
with:
24-
version: 1.8.5
24+
version: "0.7.12"
2525
- name: Compare tag and project version
2626
run: |
27-
if [ "v$(poetry version | cut -d' ' -f2)" != "${{ github.ref_name }}" ]; then echo "Version mismatch"; exit 1; fi
28-
- name: Poetry Build
27+
if [ "v$(uv version | cut -d' ' -f2)" != "${{ github.ref_name }}" ]; then echo "Version mismatch"; exit 1; fi
28+
- name: Build package
2929
run: |
30-
poetry build
30+
uv build
3131
- name: Publish package distributions to PyPI
3232
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
python-version: ${{ matrix.python-version }}
2828
cache: 'pip'
2929

30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
32+
with:
33+
version: "0.7.12"
34+
3035
- name: Check install local
3136
run: |
3237
pip install ".[test]"
@@ -35,8 +40,7 @@ jobs:
3540
3641
- name: Check build
3742
run: |
38-
pip install poetry
39-
poetry build
43+
uv build
4044
4145
- name: Check install sdist
4246
run: |

.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
21
.vscode
3-
poetry.lock
42

53
# Byte-compiled / optimized / DLL files
64
__pycache__/
@@ -98,13 +96,6 @@ ipython_config.py
9896
# install all needed dependencies.
9997
#Pipfile.lock
10098

101-
# poetry
102-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103-
# This is especially recommended for binary packages to ensure reproducibility, and is more
104-
# commonly ignored for libraries.
105-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106-
#poetry.lock
107-
10899
# pdm
109100
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110101
#pdm.lock

CONTRIBUTING.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
# Contributor Guidance
22

3-
## Development
4-
5-
Note: this project is explicitly meant to support Python versions as old
6-
as 3.8. This (unfortunately) means it requires Poetry 1.8.x to install
7-
and build correctly.
8-
9-
```
10-
$ brew install pipx
11-
$ pipx ensurepath
12-
$ pipx install poetry==1.8.5
13-
$ poetry update
14-
```
3+
This project uses `uv`. Run `uv sync` after checking out the repository
4+
to initialize your virtualenv with the project's dependencies.
155

166
## Publish package to PyPI
177

188
When we are ready to release a new version `vx.y.z`, one of the maintainers should:
199

20-
1. Execute `poetry version {minor,patch}` to update the project version
10+
1. Execute `uv version {minor,patch}` to update the project version
2111
1. Commit the version change and any release-related changes
2212
1. Create a new tag with `git tag -s -m "Version x.y.z" vx.y.z`.
2313
If the tag doesn't match with the project version, step 4 validation will fail.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ runtime and execute Spatial SQL queries.
66

77
## Installation
88

9-
If you use [Poetry](https://python-poetry.org) in your project, add the
10-
dependency with `poetry add`:
9+
To add this library as a dependency in your Python project, use `uv add`
10+
or `poetry add` as appropriate:
1111

1212
```
13+
# For uv-managed projects
14+
$ uv add wherobots-python-dbapi
15+
16+
# For poetry-managed projects
1317
$ poetry add wherobots-python-dbapi
1418
```
1519

poetry.toml

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

pyproject.toml

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
[project]
22
name = "wherobots-python-dbapi"
3-
4-
[tool.poetry]
5-
name = "wherobots-python-dbapi"
63
version = "0.15.0"
74
description = "Python DB-API driver for Wherobots DB"
8-
authors = ["Maxime Petazzoni <[email protected]>"]
9-
license = "Apache 2.0"
5+
authors = [{ name = "Maxime Petazzoni", email = "[email protected]" }]
6+
requires-python = "~=3.8"
107
readme = "README.md"
11-
packages = [{ include = "wherobots" }]
8+
license = "Apache-2.0"
9+
dependencies = [
10+
"packaging",
11+
"requests>=2.31.0",
12+
"websockets>=13.0",
13+
"tenacity>=8.2.3",
14+
"cbor2>=5.6.3",
15+
"StrEnum>=0.4.15,<0.5",
16+
"pyarrow>=14.0.2",
17+
"pandas",
18+
]
19+
20+
[project.optional-dependencies]
21+
test = ["pytest>=8.0.2"]
1222

1323
[project.urls]
1424
Homepage = "https://github.com/wherobots/wherobots-python-dbapi-driver"
1525
Tracker = "https://github.com/wherobots/wherobots-python-dbapi-driver/issues"
1626

17-
[tool.poetry.dependencies]
18-
python = "^3.8"
19-
packaging = "*"
20-
requests = ">=2.31.0"
21-
websockets = ">=13.0"
22-
tenacity = ">=8.2.3"
23-
cbor2 = ">=5.6.3"
24-
StrEnum = "^0.4.15"
25-
pyarrow = { version = ">=14.0.2" }
26-
pandas = { version = "*" }
27-
pytest = { version = ">=8.0.2", optional = true }
28-
29-
[tool.poetry.extras]
30-
test = [ "pytest" ]
31-
32-
[tool.poetry.group.dev.dependencies]
33-
pre-commit = "*"
34-
pytest = ">=8.0.2"
35-
pyarrow = ">=14.0.2"
36-
pandas = "*"
37-
rich = ">=13.7.1"
27+
[dependency-groups]
28+
dev = [
29+
"pre-commit",
30+
"pytest>=8.0.2",
31+
"pyarrow>=14.0.2",
32+
"pandas",
33+
"rich>=13.7.1",
34+
]
35+
36+
[tool.hatch.build.targets.sdist]
37+
include = ["wherobots"]
38+
39+
[tool.hatch.build.targets.wheel]
40+
include = ["wherobots"]
3841

3942
[build-system]
40-
requires = ["poetry-core>=1.9.1"]
41-
build-backend = "poetry.core.masonry.api"
43+
requires = ["hatchling"]
44+
build-backend = "hatchling.build"
4245

4346
[tool.pylint.format]
4447
max-line-length = "88"

0 commit comments

Comments
 (0)