Skip to content

Commit 75e916b

Browse files
authored
ADO pipeline tweaks (#143)
* Fix test install * Fix durabletask crash, gate pipelines on environment * Cut back azuremanged tests again * Final azuremanaged test fix * Install with optionals to validate wheel
1 parent 87de6e2 commit 75e916b

2 files changed

Lines changed: 43 additions & 15 deletions

File tree

eng/ci/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extends:
2727
templateContext:
2828
type: releaseJob
2929
isProduction: true
30+
environment: durabletask-pypi-prod
3031
inputs:
3132
- input: pipelineArtifact
3233
pipeline: DurableTaskPythonBuildPipeline
@@ -63,6 +64,7 @@ extends:
6364
templateContext:
6465
type: releaseJob
6566
isProduction: true
67+
environment: durabletask-pypi-prod
6668
inputs:
6769
- input: pipelineArtifact
6870
pipeline: DurableTaskPythonBuildPipeline

eng/templates/build.yml

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ jobs:
2525
inputs:
2626
artifactFeeds: "internal/PythonSDK_Internal_PublicPackages"
2727

28-
# Install build + lint + test tooling
28+
# Install build + lint + test tooling. Note: we deliberately do NOT
29+
# install the SDK's runtime dependencies (grpcio, protobuf, etc.) here.
30+
# Those are pulled in later via the built wheels' declared metadata so
31+
# that a wheel which accidentally drops a declared dependency surfaces
32+
# the missing dep instead of being silently masked.
2933
- script: |
3034
python -m pip install --upgrade pip
31-
python -m pip install build flake8 pytest pytest-asyncio aiohttp
35+
python -m pip install build flake8 pytest pytest-asyncio
3236
displayName: "Install build tooling"
3337
3438
# Lint core SDK
@@ -57,24 +61,46 @@ jobs:
5761
ls -la $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask-azuremanaged
5862
displayName: "List build outputs"
5963
60-
# Install the built wheels and run unit tests against them. We exclude
61-
# tests marked `dts` (require the Durable Task Scheduler emulator) and
62-
# `azurite` (require the Azurite blob emulator) since those external
63-
# services aren't provisioned in this network-isolated pool. The full
64-
# matrix (including emulator-backed tests) runs in GitHub Actions on
65-
# PRs to main and main itself; this step is defense-in-depth to ensure
66-
# the artifacts we're about to ship are at least importable and pass
67-
# the pure-Python unit tests.
64+
# Install the built wheels with all declared optional extras and let
65+
# pip resolve their runtime dependencies (grpcio, protobuf, packaging,
66+
# azure-identity, azure-storage-blob, opentelemetry-*, etc.). This is
67+
# intentional: if a wheel ever accidentally drops a declared
68+
# dependency, this step will surface the missing dependency at install
69+
# or test time instead of being masked by a preinstalled
70+
# requirements.txt. Test-only tools (pytest, pytest-asyncio) are
71+
# already installed in the "Install build tooling" step above.
72+
#
73+
# >>> MAINTENANCE NOTE <<<
74+
# When a new optional extra is added to either package's
75+
# `pyproject.toml` under `[project.optional-dependencies]`, append it
76+
# to the extras list below (e.g., add `,my-new-extra` inside the
77+
# brackets). This keeps the smoke tests and dependency-resolution
78+
# check exercising every shipping configuration.
79+
#
80+
# We exclude tests marked `dts` (require the Durable Task Scheduler
81+
# emulator) and `azurite` (require the Azurite blob emulator) since
82+
# those external services aren't provisioned in this network-isolated
83+
# pool. The full matrix (including emulator-backed tests) runs in
84+
# GitHub Actions on PRs to main and main itself.
6885
- script: |
6986
set -e
70-
python -m pip install $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask/*.whl
71-
python -m pip install $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask-azuremanaged/*.whl
87+
# Resolve the wheel filename explicitly because bash treats
88+
# `*.whl[extra]` as a glob with a character class and would not
89+
# append the extras correctly.
90+
DT_WHEEL=$(ls $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask/*.whl)
91+
DT_AM_WHEEL=$(ls $(Build.ArtifactStagingDirectory)/buildoutputs/durabletask-azuremanaged/*.whl)
92+
python -m pip install "${DT_WHEEL}[opentelemetry,azure-blob-payloads]"
93+
python -m pip install "${DT_AM_WHEEL}[azure-blob-payloads]"
7294
displayName: "Install built wheels"
7395
7496
- script: pytest -m "not dts and not azurite" --verbose
7597
displayName: "pytest: durabletask (unit tests, no emulators)"
7698
workingDirectory: tests/durabletask
7799

78-
- script: pytest -m "not dts" --verbose
79-
displayName: "pytest: durabletask-azuremanaged (unit tests, no emulators)"
80-
workingDirectory: tests/durabletask-azuremanaged
100+
# `tests/durabletask-azuremanaged/` is NOT exercised here.
101+
# Those tests require the Durable Task Scheduler emulator which is
102+
# not available in the network-isolated pools.
103+
- script: |
104+
set -e
105+
python -P -c "import durabletask.azuremanaged; from durabletask.azuremanaged.client import DurableTaskSchedulerClient; from durabletask.azuremanaged.worker import DurableTaskSchedulerWorker; print('durabletask.azuremanaged smoke import OK')"
106+
displayName: "smoke import: durabletask-azuremanaged"

0 commit comments

Comments
 (0)