Skip to content

Commit f2ce8fb

Browse files
committed
Use uv
1 parent c687060 commit f2ce8fb

File tree

4 files changed

+36
-42
lines changed

4 files changed

+36
-42
lines changed

.github/workflows/run-tests.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,17 @@ jobs:
2424
uses: actions/setup-python@v4
2525
with:
2626
python-version: ${{ matrix.python-version }}
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v3
2729
- name: Install dependencies
2830
run: |
29-
python -m pip install --upgrade pip poetry
30-
pip install ".[dev]"
31+
uv pip install ".[dev]"
3132
- name: Install libsndfile
3233
if: startsWith(matrix.os, 'ubuntu')
3334
run: |
3435
sudo apt-get install -y libsndfile1
3536
- name: Run tests
3637
run: pytest
37-
- name: Validate poetry file
38-
run: poetry check
3938
- name: Check source code format
4039
run: black --check --diff .
4140

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,3 @@ target/
7272

7373
# pyenv
7474
.python-version
75-
76-
# Poetry
77-
poetry.lock

DEVELOPING.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@ black .
1616

1717
## Package and Dependency Management
1818

19-
This project uses [poetry](https://python-poetry.org/docs/) for package management and distribution.
19+
This project uses [uv](https://docs.astral.sh/uv/) for package management and distribution.
2020

21-
Development dependencies are specified as optional dependencies, and then added to the "dev" extra group in the [pyproject.toml](./pyproject.toml) file.
21+
Development dependencies are specified as optional dependencies, at least for now and until [development dependencies](https://docs.astral.sh/uv/concepts/dependencies/#development-dependencies) become more widely used.
2222

2323
```sh
24-
# Do NOT use: poetry add <somepackage> --dev
25-
poetry add --optional <somepackage>
24+
uv add <somepackage> --optional <somegroup>
2625
```
2726

28-
The `[tool.poetry.dev-dependencies]` attribute is NOT used because of a [limitation](https://github.com/python-poetry/poetry/issues/3514) that prevents these dependencies from being pip installable. Therefore, dev dependencies are not installed when purely running `poetry install`, and the `--no-dev` flag has no meaning in this project.
29-
3027
## Creating Distributions
3128

3229
Make sure the versions in [version.py](./wfdb/version.py) and [pyproject.toml](./pyproject.toml) are updated and kept in sync.
@@ -47,10 +44,10 @@ poetry config pypi-token.test-pypi <my-testpypi-token>
4744
To build and upload a new distribution:
4845

4946
```sh
50-
poetry build
47+
uv build
5148

52-
poetry publish -r test-pypi
53-
poetry publish
49+
uv publish --publish-url https://test.pypi.org/legacy/
50+
uv publish
5451
```
5552

5653
## Creating Documentation

pyproject.toml

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
[tool.poetry]
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
26
name = "wfdb"
37
version = "4.1.2"
48
description = "The WFDB Python package: tools for reading, writing, and processing physiologic signals and annotations."
5-
authors = ["The Laboratory for Computational Physiology <[email protected]>"]
9+
authors = [{name = "The Laboratory for Computational Physiology", email = "[email protected]"}]
10+
license = {text = "MIT License"}
611
readme = "README.md"
12+
requires-python = ">= 3.7"
13+
dependencies = [
14+
"numpy >= 1.10.1, < 2.0.0",
15+
"scipy >= 1.0.0",
16+
"pandas >= 1.3.0",
17+
"soundfile >= 0.10.0",
18+
"matplotlib >= 3.2.2",
19+
"requests >= 2.8.1",
20+
]
21+
22+
[project.optional-dependencies]
23+
dev = [
24+
"pytest >= 7.1.1",
25+
"pytest-xdist >= 2.5.0",
26+
"pylint >= 2.13.7",
27+
"black >= 22.3.0",
28+
"sphinx >= 4.5.0",
29+
]
30+
31+
[project.urls]
732
homepage = "https://github.com/MIT-LCP/wfdb-python/"
833
repository = "https://github.com/MIT-LCP/wfdb-python/"
934
documentation = "https://wfdb.readthedocs.io/"
10-
license = "MIT"
11-
12-
[tool.poetry.dependencies]
13-
python = ">=3.7"
14-
numpy = ">=1.10.1,<2.0.0"
15-
scipy = ">=1.0.0"
16-
pandas = ">=1.3.0"
17-
SoundFile = ">=0.10.0"
18-
matplotlib = ">=3.2.2"
19-
requests = ">=2.8.1"
20-
pytest = {version = ">=7.1.1", optional = true}
21-
pytest-xdist = {version = ">=2.5.0", optional = true}
22-
pylint = {version = ">=2.13.7", optional = true}
23-
black = {version = ">=22.3.0", optional = true}
24-
Sphinx = {version = ">=4.5.0", optional = true}
25-
26-
[tool.poetry.extras]
27-
dev = ["pytest", "pytest-xdist", "pylint", "black", "Sphinx"]
28-
29-
# Do NOT use [tool.poetry.dev-dependencies]. See: https://github.com/python-poetry/poetry/issues/3514
3035

3136
[tool.black]
3237
line-length = 80
3338
target-version = ['py37']
34-
35-
[build-system]
36-
requires = ["poetry-core>=1.0.0"]
37-
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)