Skip to content

Commit

Permalink
maturin versions of commands
Browse files Browse the repository at this point in the history
Under maturin, we do not use `--no-install-project`.

This differs from the halfway-house state where we were using poetry
to build where that was needed. Or, perhaps the difference is because
we now have

[tool.uv]
package = false
  • Loading branch information
dandavison committed Feb 16, 2025
1 parent 713b4d7 commit 47e2d0d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ jobs:
# https://github.com/python-poetry/poetry/issues/7611 and
# https://github.com/python-poetry/poetry/pull/7694 are fixed
- run: python -m pip install --upgrade wheel "poetry==1.3.2" poethepoet
- run: uv sync --no-install-project --all-extras
- run: uv sync --all-extras

# Add the source dist only for Linux x64 for now
- if: ${{ matrix.package-suffix == 'linux-amd64' }}
run: poetry build --format sdist
run: uv build --sdist

# Build and fix the wheel
- run: uv run cibuildwheel --output-dir dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: astral-sh/setup-uv@v5
- run: python -m pip install --upgrade wheel poethepoet
- run: uv sync --no-install-project --all-extras
- run: uv sync --all-extras
- run: poe bridge-lint
if: ${{ matrix.clippyLinter }}
- run: poe lint
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
TEMPORAL_TEST_PROTO3: 1
run: |
uv add --python 3.9 "protobuf<4"
uv sync --no-install-project --all-extras
uv sync --all-extras
poe gen-protos
poe format
[[ -z $(git status --porcelain temporalio) ]] || (git diff temporalio; echo "Protos changed"; exit 1)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- uses: astral-sh/setup-uv@v5
# Build
- run: python -m pip install --upgrade wheel poethepoet
- run: uv sync --no-install-project --all-extras
- run: uv sync --all-extras
- run: poe build-develop-with-release

# Run a bunch of bench tests. We run multiple times since results vary.
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1406,10 +1406,10 @@ git clone --recursive https://github.com/temporalio/sdk-python.git
cd sdk-python
```

Install the dependencies (`--no-install-project` because we will build it in the next step):
Install the dependencies:

```bash
uv sync --no-install-project --all-extras
uv sync --all-extras
```

#### Build
Expand All @@ -1420,7 +1420,7 @@ Now perform the release build:
environment](#local-sdk-development-environment) for the quicker approach to local development).

```bash
poetry build
uv build # TODO: is this identical to maturin build?
```

The compiled wheel doesn't have the exact right tags yet for use, so run this script to fix it:
Expand Down Expand Up @@ -1493,7 +1493,7 @@ installing dependencies:
```bash
git clone --recursive https://github.com/temporalio/sdk-python.git
cd sdk-python
uv sync --no-install-project --all-extras
uv sync --all-extras
```

Now compile the Rust extension in develop mode which is quicker than release mode:
Expand Down Expand Up @@ -1526,12 +1526,12 @@ poe test -s --log-cli-level=DEBUG -k test_sync_activity_thread_cancel_caught
#### Proto Generation and Testing

To allow for backwards compatibility, protobuf code is generated on the 3.x series of the protobuf library. To generate
protobuf code, you must be on Python <= 3.10, and then run `uv add "protobuf<4"` +
`uv sync --no-install-project --all-extras`. Then the protobuf files can be generated via `poe gen-protos`. Tests can be run
for protobuf version 3 by setting the `TEMPORAL_TEST_PROTO3` env var to `1` prior to running tests.
protobuf code, you must be on Python <= 3.10, and then run `uv add "protobuf<4"` + `uv sync --all-extras`. Then the
protobuf files can be generated via `poe gen-protos`. Tests can be run for protobuf version 3 by setting the
`TEMPORAL_TEST_PROTO3` env var to `1` prior to running tests.

Do not commit `uv.lock` or `pyproject.toml` changes. To go back from this downgrade, restore both of those files
and run `uv sync --no-install-project --all-extras`. Make sure you `poe format` the results.
Do not commit `uv.lock` or `pyproject.toml` changes. To go back from this downgrade, restore both of those files and run
`uv sync --all-extras`. Make sure you `poe format` the results.

For a less system-intrusive approach, you can:
```shell
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ dev = [
]

[tool.poe.tasks]
build-develop = "uv run python scripts/setup_bridge.py develop"
build-develop-with-release = { cmd = "uv run python scripts/setup_bridge.py develop", env = { TEMPORAL_BUILD_RELEASE = "1" }}
build-develop = "maturin develop --uv"
build-develop-with-release = { cmd = "maturin develop --release --uv" }
fix-wheel = "uv run python scripts/fix_wheel.py"
format = [{cmd = "uv run ruff check --select I --fix"}, {cmd = "uv run ruff format"}, ]
gen-docs = "uv run python scripts/gen_docs.py"
Expand Down
2 changes: 1 addition & 1 deletion scripts/_proto/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VOLUME ["/api_new", "/bridge_new"]
COPY ./ ./

RUN mkdir -p ./temporalio/api
RUN uv sync --no-install-project --all-extras
RUN uv sync --all-extras
RUN uv add "protobuf<4"
RUN poe gen-protos

Expand Down

0 comments on commit 47e2d0d

Please sign in to comment.