Skip to content

Commit 9dcec7b

Browse files
committed
use uv workspace
1 parent e2f3d95 commit 9dcec7b

File tree

7 files changed

+74
-47
lines changed

7 files changed

+74
-47
lines changed
Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
name: Publish datacrunch package
22

33
on:
4-
workflow_run:
5-
workflows: ["Publish verda package"]
6-
types:
7-
- completed
4+
release:
5+
types: [published]
86

97
jobs:
108
deploy:
119
runs-on: ubuntu-24.04
12-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1310

1411
environment:
1512
name: pypi
@@ -19,48 +16,41 @@ jobs:
1916
contents: read
2017

2118
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v5
19+
- uses: actions/checkout@v5
2420

2521
- name: Install uv
2622
uses: astral-sh/setup-uv@v7
2723
with:
2824
version: "0.9.11"
2925

26+
- name: Set up Python
27+
run: uv python install
28+
3029
- name: Sync datacrunch version and dependency to verda
31-
working-directory: datacrunch_compat
3230
run: |
3331
# read version from top-level project
34-
VERSION=$(uv version --short --project ..)
32+
VERSION=$(uv version --short --package verda)
3533
echo "Syncing datacrunch to verda==$VERSION"
3634
37-
uv version "$VERSION"
38-
uv add "verda==$VERSION"
35+
uv version --package datacrunch "$VERSION"
36+
uv add --package datacrunch "verda==$VERSION"
3937
4038
echo
4139
echo "Resulting pyproject.toml:"
42-
cat pyproject.toml
43-
44-
- name: Set up Python
45-
working-directory: datacrunch_compat
46-
run: uv python install
40+
cat datacrunch_compat/pyproject.toml
4741
48-
- name: Build
49-
working-directory: datacrunch_compat
50-
run: uv build
42+
- name: Build all packages
43+
run: uv build --all-packages
5144

52-
# check that basic features work and we didn't miss to include crucial files
53-
- name: Smoke test (wheel)
54-
working-directory: datacrunch_compat
55-
run: uv run --isolated --no-project --with dist/*.whl --with "responses==0.25.8" tests/smoke_datacrunch.py
45+
- name: Smoke test datacrunch (wheel)
46+
run: uv run --isolated --no-project --with dist/datacrunch-*.whl --with dist/verda-*.whl --with "responses==0.25.8" datacrunch_compat/tests/smoke_datacrunch.py
5647

57-
- name: Smoke test (source distribution)
58-
working-directory: datacrunch_compat
59-
run: uv run --isolated --no-project --with dist/*.tar.gz --with "responses==0.25.8" tests/smoke_datacrunch.py
48+
- name: Smoke test datacrunch (source distribution)
49+
run: uv run --isolated --no-project --with dist/datacrunch-*.tar.gz --with dist/verda-*.tar.gz --with "responses==0.25.8" datacrunch_compat/tests/smoke_datacrunch.py
6050

61-
- name: Publish
62-
working-directory: datacrunch_compat
51+
# we don't use Trusted publishing for datacrunch package yet, thus we need secrets
52+
- name: Publish datacrunch
6353
env:
6454
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }}
6555
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
66-
run: uv publish
56+
run: uv publish dist/datacrunch-*

.github/workflows/publish_verda.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ jobs:
2626
- name: Set up Python
2727
run: uv python install
2828

29-
- name: Build
29+
- name: Build verda
3030
run: uv build
3131

32-
# check that basic features work and we didn't miss to include crucial files
33-
- name: Smoke test (wheel)
34-
run: uv run --isolated --no-project --with dist/*.whl --with "responses==0.25.8" tests/smoke.py
32+
- name: Smoke test verda (wheel)
33+
run: uv run --isolated --no-project --with dist/verda-*.whl --with "responses==0.25.8" tests/smoke_verda.py
3534

36-
- name: Smoke test (source distribution)
37-
run: uv run --isolated --no-project --with dist/*.tar.gz --with "responses==0.25.8" tests/smoke.py
35+
- name: Smoke test verda (source distribution)
36+
run: uv run --isolated --no-project --with dist/verda-*.tar.gz --with "responses==0.25.8" tests/smoke_verda.py
3837

39-
# we use Trusted publishing, no keys necessary: https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi
40-
- name: Publish
41-
run: uv publish
38+
# we use Trusted publishing for verda package, no keys necessary: https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi
39+
- name: Publish verda package
40+
run: uv publish dist/verda-*

.github/workflows/unit_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ jobs:
3939
uses: codecov/codecov-action@v1
4040
with:
4141
fail_ci_if_error: false
42+
43+
- name: Test datacrunch_compat with pytest
44+
working-directory: datacrunch_compat
45+
run: |
46+
uv run pytest

datacrunch_compat/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "datacrunch"
3-
version = "0.0.0" # version set by .github/workflows/publish_datacrunch.yml before release
3+
version = "0.0.0" # version will be set by .github/workflows/publish.yml before release
44
description = "datacrunch is now verda"
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -33,9 +33,12 @@ build-backend = "uv_build"
3333
module-name = "datacrunch"
3434
module-root = ""
3535

36+
[tool.uv.sources]
37+
verda = { workspace = true }
38+
3639
[dependency-groups]
3740
dev = [
38-
"pytest>=9.0.1",
41+
"pytest>=8.1,<9",
3942
"pytest-responses>=0.5.1",
4043
"responses>=0.25.8",
4144
]

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ dependencies = ["requests>=2.25.1,<3", "dataclasses_json>=0.6.7"]
2626
[dependency-groups]
2727
dev = [
2828
"pytest-cov>=2.10.1,<3",
29-
"pytest-responses>=0.4.0,<1",
29+
"pytest-responses>=0.5.1",
3030
"pytest>=8.1,<9",
3131
"python-dotenv>=1.1.1",
32-
"responses>=0.12.1,<1",
32+
"responses>=0.25.8",
3333
"ruff>=0.14.2",
3434
]
3535

@@ -47,6 +47,9 @@ build-backend = "uv_build"
4747
module-name = "verda"
4848
module-root = ""
4949

50+
[tool.uv.workspace]
51+
members = ["datacrunch_compat"]
52+
5053
[tool.ruff]
5154
line-length = 100
5255

File renamed without changes.

uv.lock

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

0 commit comments

Comments
 (0)