Skip to content

Commit 9dcbba3

Browse files
build: migrate from poetry to uv
Convert to PEP 621 pyproject with uv_build backend (flat layout: module-root="", module-name="datastream"). Replace poetry.lock with uv.lock, pin Python 3.10. Migrate test, publish, and gh-pages CI workflows to setup-uv + uv sync/run/build/publish. Library (published to PyPI); no Dockerfiles, no private deps. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7a3e941 commit 9dcbba3

7 files changed

Lines changed: 1580 additions & 2007 deletions

File tree

.github/workflows/gh-pages.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,21 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
18-
- name: Set up Python
19-
uses: actions/setup-python@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
2020
with:
2121
python-version: '3.10'
22-
22+
enable-cache: true
23+
2324
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install poetry
27-
poetry install
28-
25+
run: uv sync --locked
26+
2927
- name: Build documentation
30-
run: poetry run mkdocs build
31-
28+
run: uv run mkdocs build
29+
3230
- name: Deploy to GitHub Pages
3331
uses: peaceiris/actions-gh-pages@v3
3432
with:
3533
github_token: ${{ secrets.GITHUB_TOKEN }}
36-
publish_dir: ./site
34+
publish_dir: ./site

.github/workflows/publish.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,32 @@ jobs:
1212
python-version: [3.9]
1313
steps:
1414
- uses: actions/checkout@v2
15-
- name: Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v2
15+
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
1718
with:
1819
python-version: ${{ matrix.python-version }}
19-
20-
- name: Install poetry
21-
run: |
22-
python -m pip install --upgrade pip
23-
curl -sSL https://install.python-poetry.org | python - --version 1.2.2
24-
echo "${HOME}/.local/bin" >> $GITHUB_PATH
20+
enable-cache: true
2521

2622
- name: Install dependencies
27-
run: |
28-
poetry install --no-root
23+
run: uv sync --locked
2924

3025
- name: Run tests
31-
run: |
32-
poetry run pytest
26+
run: uv run pytest
3327

3428
- name: Build wheels
3529
run: |
36-
poetry version $(git tag --points-at HEAD)
37-
poetry build
30+
uv version "$(git tag --points-at HEAD)"
31+
uv build
3832
3933
- name: Test install package
4034
run: |
41-
poetry new test-install
42-
cd test-install
43-
poetry add ../dist/$(ls ../dist/*.whl)
44-
45-
poetry run python -c "import datastream"
35+
uv venv /tmp/test-install
36+
uv pip install --python /tmp/test-install ./dist/*.whl
37+
/tmp/test-install/bin/python -c "import datastream"
4638
4739
- name: Upload
4840
env:
49-
USERNAME: __token__
50-
PASSWORD: ${{ secrets.PYPI_TOKEN }}
51-
run: |
52-
poetry publish --username=$USERNAME --password=$PASSWORD
41+
UV_PUBLISH_USERNAME: __token__
42+
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_TOKEN }}
43+
run: uv publish

.github/workflows/test.yml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,18 @@ jobs:
1010
python-version: [3.9, "3.10"]
1111
steps:
1212
- uses: actions/checkout@v2
13-
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v2
15-
with:
16-
python-version: ${{ matrix.python-version }}
1713

18-
- name: Cache pip
19-
uses: actions/cache@v2
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
2016
with:
21-
path: ~/.cache/pip
22-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}-${ GITHUB_REF }
23-
restore-keys: |
24-
${{ runner.os }}-pip-
25-
${{ runner.os }}-
26-
27-
- name: Install poetry
28-
run: |
29-
python -m pip install --upgrade pip
30-
curl -sSL https://install.python-poetry.org | python - --version 1.2.2
31-
echo "${HOME}/.local/bin" >> $GITHUB_PATH
17+
python-version: ${{ matrix.python-version }}
18+
enable-cache: true
3219

3320
- name: Install dependencies
34-
run: |
35-
poetry install
21+
run: uv sync --locked
3622

3723
- name: Run tests
38-
run: |
39-
poetry run pytest
24+
run: uv run pytest
4025

4126
- name: Build wheels
42-
run: |
43-
poetry build
27+
run: uv build

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

0 commit comments

Comments
 (0)