Skip to content

Commit ff24616

Browse files
authored
Merge pull request #165 from SCAI-BIO/refactor/migrate-poetry-to-uv
Refactor/migrate poetry to uv
2 parents 1567ec7 + 5515ab4 commit ff24616

7 files changed

Lines changed: 2753 additions & 3878 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "pip" # See documentation for possible values
8+
- package-ecosystem: "uv" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"

.github/workflows/python-publish.yaml

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,31 @@ on:
1212
release:
1313
types: [published]
1414

15-
permissions:
16-
contents: read
17-
1815
jobs:
19-
deploy:
20-
16+
run:
2117
runs-on: ubuntu-latest
22-
18+
environment:
19+
name: pypi
20+
permissions:
21+
id-token: write
22+
contents: read
2323
steps:
24-
- uses: actions/checkout@v4
25-
- name: Set up Python
26-
uses: actions/setup-python@v5
27-
with:
28-
python-version: '3.12'
29-
30-
- name: Install Poetry
31-
run: |
32-
curl -sSL https://install.python-poetry.org | python3 -
33-
34-
- name: Update package version
35-
run: |
36-
VERSION=${{ github.event.release.tag_name }}
37-
sed -i 's/__version__ = ".*"/__version__ = "'${VERSION}'"/' datastew/_version.py
38-
sed -i "s/^version = \".*\"/version = \"${VERSION}\"/" pyproject.toml
39-
40-
- name: Install dependencies
41-
run: |
42-
poetry install
43-
44-
- name: Build package
45-
run: |
46-
poetry build
47-
48-
- name: Publish package
49-
env:
50-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
51-
run: |
52-
poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI
24+
- name: Checkout
25+
uses: actions/checkout@v5
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v7
28+
- name: Install Python 3.13
29+
run: uv python install 3.13
30+
- name: Update package version
31+
run: |
32+
VERSION=${{ github.event.release.tag_name }}
33+
sed -i 's/__version__ = ".*"/__version__ = "'${VERSION}'"/' datastew/_version.py
34+
uv version "$VERSION"
35+
- name: Build
36+
run: uv build
37+
- name: Smoke test (wheel)
38+
run: uv run --isolated --no-project --with dist/*.whl tests/smoke_test.py
39+
- name: Smoke test (source distribution)
40+
run: uv run --isolated --no-project --with dist/*.tar.gz tests/smoke_test.py
41+
- name: Publish
42+
run: uv publish

.github/workflows/tests.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,24 @@ jobs:
3737
TEST_POSTGRES_URI: postgresql://testuser:testpass@localhost:5432/testdb
3838

3939
steps:
40-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v5
4141

4242
- name: Set up Python ${{ matrix.python-version }}
4343
uses: actions/setup-python@v5
4444
with:
4545
python-version: ${{ matrix.python-version }}
4646

47-
- name: Install Poetry
48-
run: curl -sSL https://install.python-poetry.org | python3 -
49-
50-
- name: Configure Poetry environment
51-
run: |
52-
poetry config virtualenvs.create true
53-
poetry env use python${{ matrix.python-version }}
47+
- name: Install the latest version of uv
48+
uses: astral-sh/setup-uv@v7
49+
with:
50+
python-version: ${{ matrix.python-version }}
5451

5552
- name: Install dependencies
56-
run: poetry install
53+
run: uv sync --locked --all-extras --dev
5754

5855
- name: Wait for PostgreSQL to become ready
5956
run: |
6057
until pg_isready -h localhost -U testuser -d testdb; do sleep 1; done
6158
6259
- name: Run tests
63-
run: poetry run pytest
60+
run: uv run pytest tests

poetry.lock

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

pyproject.toml

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,69 @@
11
[build-system]
2-
requires = [
3-
"poetry-core>=1.0.0",
4-
"setuptools>=65.0",
5-
"wheel",
6-
]
7-
build-backend = "poetry.core.masonry.api"
2+
requires = ["uv_build>=0.9.10,<0.10.0"]
3+
build-backend = "uv_build"
4+
5+
[tool.uv.build-backend]
6+
module-name = "datastew"
7+
module-root = ""
88

9-
[tool.poetry]
9+
[project]
1010
name = "datastew"
1111
version = "0.1.0"
1212
description = "Datastew is a python library for intelligent data harmonization using Large Language Model (LLM) vector embeddings."
13-
authors = ["Tim Adams <tim.adams@scai.fraunhofer.de>", "Mehmet Can Ay <mehmet.ay@scai.fraunhofer.de>"]
14-
license = "Apache-2.0"
1513
readme = "README.md"
16-
homepage = "https://github.com/SCAI-BIO/datastew"
17-
repository = "https://github.com/SCAI-BIO/datastew"
18-
documentation = "https://github.com/SCAI-BIO/datastew#readme"
14+
license = { file = "LICENSE" }
15+
requires-python = ">=3.10,<3.14"
16+
authors = [
17+
{ name = "Tim Adams", email = "tim.adams@scai.fraunhofer.de" },
18+
{ name = "Mehmet Can Ay", email = "mehmet.ay@scai.fraunhofer.de" },
19+
]
1920
keywords = ["data-harmonization", "LLM", "embeddings", "data-steward"]
2021
classifiers = [
2122
"Development Status :: 3 - Alpha",
2223
"Intended Audience :: Developers",
23-
"License :: OSI Approved :: Apache Software License",
2424
"Programming Language :: Python :: 3.10",
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
2727
"Programming Language :: Python :: 3.13",
2828
]
2929

30-
[tool.poetry.urls]
31-
homepage = "https://github.com/SCAI-BIO/datastew"
32-
repository = "https://github.com/SCAI-BIO/datastew"
33-
documentation = "https://github.com/SCAI-BIO/datastew#readme"
34-
tracker = "https://github.com/SCAI-BIO/datastew/issues"
30+
dependencies = [
31+
"matplotlib>=3.10.7,<4.0.0",
32+
"numpy>=2.2.6,<3.0.0",
33+
"openai>=2.7.1,<3.0.0",
34+
"openpyxl>=3.1.5,<4.0.0",
35+
"pandas>=2.3.3,<3.0.0",
36+
"plotly>=6.4.0,<7.0.0",
37+
"python-dateutil>=2.9.0.post0,<3.0.0",
38+
"python-dotenv>=1.2.1,<2.0.0",
39+
"pytz>=2025.2,<2026.0",
40+
"seaborn>=0.13.2,<1.0.0",
41+
"sentence-transformers>=5.1.2,<6.0.0",
42+
"scikit-learn>=1.7.2,<2.0.0",
43+
"six>=1.17.0,<2.0.0",
44+
"thefuzz>=0.22.1,<1.0.0",
45+
"tzdata>=2025.2,<2026.0",
46+
"wheel>=0.45.1,<1.0.0",
47+
"aiofiles>=25.1.0,<26.0.0",
48+
"SQLAlchemy>=2.0.44,<3.0.0",
49+
"scipy>=1.15.3,<2.0.0",
50+
"pydantic>=2.12.4,<3.0.0",
51+
"requests>=2.32.5,<3.0.0",
52+
"uuid>=1.30,<2.0.0",
53+
"weaviate-client>=4.17.0,<5.0.0",
54+
"cachetools>=6.2.1,<7.0.0",
55+
"ollama>=0.6.0,<1.0.0",
56+
"pgvector>=0.4.1,<1.0.0",
57+
"psycopg2-binary>=2.9.11,<3.0.0",
58+
"torch>=2.9.0,<3.0.0",
59+
]
3560

36-
[[tool.poetry.packages]]
37-
include = "datastew"
61+
[project.optional-dependencies]
62+
dev = ["flake8>=7.3.0,<8.0.0", "pytest>=9.0.0,<10.0.0"]
3863

39-
[tool.poetry.dependencies]
40-
python = ">=3.10,<3.14"
41-
matplotlib = "^3.10.7"
42-
numpy = "^2.2.6"
43-
openai = "^2.7.1"
44-
openpyxl = "^3.1.5"
45-
pandas = "^2.3.3"
46-
plotly = "^6.4.0"
47-
python-dateutil = "^2.9.0.post0"
48-
python-dotenv = "^1.2.1"
49-
pytz = "^2025.2"
50-
seaborn = "^0.13.2"
51-
sentence-transformers = "^5.1.2"
52-
scikit-learn = "^1.7.2"
53-
six = "^1.17.0"
54-
thefuzz = "^0.22.1"
55-
tzdata = "^2025.2"
56-
wheel = "^0.45.1"
57-
aiofiles = "^25.1.0"
58-
SQLAlchemy = "^2.0.44"
59-
scipy = "^1.15.3"
60-
pydantic = "^2.12.4"
61-
requests = "^2.32.5"
62-
uuid = "^1.30"
63-
weaviate-client = "^4.17.0"
64-
cachetools = "^6.2.1"
65-
ollama = "^0.6.0"
66-
pgvector = "^0.4.1"
67-
psycopg2-binary = "^2.9.11"
68-
torch = "^2.9.0"
6964

70-
[tool.poetry.group.dev.dependencies]
71-
flake8 = "^7.3.0"
72-
pytest = "^9.0.0"
65+
[project.urls]
66+
Homepage = "https://github.com/SCAI-BIO/datastew"
67+
Repository = "https://github.com/SCAI-BIO/datastew"
68+
Documentation = "https://github.com/SCAI-BIO/datastew#readme"
69+
Tracker = "https://github.com/SCAI-BIO/datastew/issues"

tests/smoke_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def test_package_imports():
2+
"""
3+
Basic check that the installed wheel can be imported.
4+
"""
5+
import datastew
6+
7+
assert datastew is not None
8+
9+
10+
def test_version_exists():
11+
"""
12+
Ensure version metadata is accessible.
13+
"""
14+
from datastew import __version__
15+
16+
assert isinstance(__version__, str)
17+
assert len(__version__) > 0

0 commit comments

Comments
 (0)