Skip to content

Commit d2fee30

Browse files
committed
PYTHON-5862 Address PR feedback: export UV vars before sourcing setup-dev-env, make UV_EXCLUDE_NEWER conditional in GHA
- combine-coverage.sh: export UV_NO_LOCK and UV_EXCLUDE_NEWER before sourcing setup-dev-env.sh, which calls uv sync internally; without this the first sync ran without the intended settings - test-python.yml: use ${UV_EXCLUDE_NEWER:-$(date ...)} so the computed default does not overwrite a value already set via repository/environment variables
1 parent c1afe0f commit d2fee30

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

.evergreen/combine-coverage.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55

66
set -eu
77

8-
# Set up the virtual env.
9-
. .evergreen/scripts/setup-dev-env.sh
8+
# Export before sourcing so that any uv sync inside setup-dev-env.sh uses them.
109
export UV_NO_LOCK=1
1110
export UV_EXCLUDE_NEWER="${UV_EXCLUDE_NEWER:-$(python3 -c 'from datetime import datetime, timedelta, timezone; print((datetime.now(timezone.utc) - timedelta(days=7)).strftime("%Y-%m-%dT%H:%M:%SZ"))')}"
11+
12+
# Set up the virtual env.
13+
. .evergreen/scripts/setup-dev-env.sh
1214
uv sync --group coverage
1315
source .venv/bin/activate
1416

.github/workflows/test-python.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
enable-cache: true
3535
python-version: "3.10"
3636
- name: Set UV_EXCLUDE_NEWER
37-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
37+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
3838
- name: Install just
3939
run: uv tool install rust-just
4040
- name: Install Python dependencies
@@ -78,7 +78,7 @@ jobs:
7878
enable-cache: true
7979
python-version: ${{ matrix.python-version }}
8080
- name: Set UV_EXCLUDE_NEWER
81-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
81+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
8282
- id: setup-mongodb
8383
uses: mongodb-labs/drivers-evergreen-tools@master
8484
with:
@@ -102,7 +102,7 @@ jobs:
102102
enable-cache: true
103103
python-version: "3.10"
104104
- name: Set UV_EXCLUDE_NEWER
105-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
105+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
106106
- id: setup-mongodb
107107
uses: mongodb-labs/drivers-evergreen-tools@master
108108
with:
@@ -132,7 +132,7 @@ jobs:
132132
enable-cache: true
133133
python-version: "3.10"
134134
- name: Set UV_EXCLUDE_NEWER
135-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
135+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
136136
- name: Install just
137137
run: uv tool install rust-just
138138
- id: setup-mongodb
@@ -159,7 +159,7 @@ jobs:
159159
enable-cache: true
160160
python-version: "3.10"
161161
- name: Set UV_EXCLUDE_NEWER
162-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
162+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
163163
- name: Install just
164164
run: uv tool install rust-just
165165
- name: Install dependencies
@@ -180,7 +180,7 @@ jobs:
180180
enable-cache: true
181181
python-version: "3.10"
182182
- name: Set UV_EXCLUDE_NEWER
183-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
183+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
184184
- name: Install just
185185
run: uv tool install rust-just
186186
- name: Install dependencies
@@ -206,7 +206,7 @@ jobs:
206206
enable-cache: true
207207
python-version: "${{matrix.python}}"
208208
- name: Set UV_EXCLUDE_NEWER
209-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
209+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
210210
- name: Install just
211211
run: uv tool install rust-just
212212
- name: Install dependencies
@@ -229,7 +229,7 @@ jobs:
229229
enable-cache: true
230230
python-version: "3.10"
231231
- name: Set UV_EXCLUDE_NEWER
232-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
232+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
233233
- name: Install just
234234
run: uv tool install rust-just
235235
- name: Install dependencies
@@ -320,7 +320,7 @@ jobs:
320320
with:
321321
python-version: "3.9"
322322
- name: Set UV_EXCLUDE_NEWER
323-
run: echo "UV_EXCLUDE_NEWER=$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
323+
run: echo "UV_EXCLUDE_NEWER=${UV_EXCLUDE_NEWER:-$(date -u -d '7 days ago' '+%Y-%m-%dT%H:%M:%SZ')}" >> $GITHUB_ENV
324324
- id: setup-mongodb
325325
uses: mongodb-labs/drivers-evergreen-tools@master
326326
with:

0 commit comments

Comments
 (0)