FIX: Preserve Python-specific release dependencies - #832
gargsaumya wants to merge 4 commits into
Conversation
Compile supported multi-version locks in universal mode so environment markers remain intact across scheduled refreshes. Keep ODBC generation unchanged and add focused regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR Performance ReportPerformance could not be assessed. Build provenance validation failed. No result is available. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new regression tests contain a cross-entry false positive and hard-code a dependency version that future lock refreshes may legitimately upgrade.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Preserves conditional dependencies across supported Python versions during release-lock generation.
Changes:
- Enables universal marker preservation for Linux, macOS, and Windows locks.
- Regenerates affected dependency locks with environment markers.
- Adds regression tests for workflow configuration and asyncio backport selection.
| File | Description |
|---|---|
.github/workflows/refresh-build-dependencies.yml |
Enables universal compilation while excluding ODBC. |
eng/requirements-build-linux.txt |
Adds preserved platform and Python markers. |
eng/requirements-test-linux.txt |
Preserves conditional test dependencies. |
eng/requirements-build-macos.txt |
Preserves macOS lock environment markers. |
eng/requirements-build-windows.txt |
Preserves Windows lock environment markers. |
tests/test_release_build_dependencies.py |
Adds static regression coverage for lock generation. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| assert re.search( | ||
| r"name: macos\b.*?universal: --universal", workflow, re.DOTALL | ||
| ) | ||
| assert re.search( | ||
| r"name: windows\b.*?universal: --universal", workflow, re.DOTALL | ||
| ) | ||
| assert re.search(r"name: odbc\b.*?universal: \"\"", workflow, re.DOTALL) |
| assert re.fullmatch( | ||
| r"backports-asyncio-runner==1\.2\.0 ; " | ||
| r"python_(?:full_)?version < ['\"]3\.11['\"] \\", | ||
| requirement, | ||
| ) |
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.performance_counter.hpp: 0.7%
mssql_python.pybind.logger_bridge.cpp: 57.9%
mssql_python.pybind.ddbc_bindings.h: 62.6%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.connection.connection_pool.cpp: 82.3%
mssql_python.pybind.connection.connection.cpp: 83.1%
mssql_python.logging.py: 86.2%
mssql_python.pooling.py: 90.1%
mssql_python.pybind.fetch_temporal.hpp: 92.1%
mssql_python.cursor.py: 92.5%🔗 Quick Links
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy the narrow set of repository-side runner contract files into isolated Linux wheel test directories, and surface subprocess diagnostics if the status artifact is absent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| mkdir -p $TEST_DIR/eng/scripts $TEST_DIR/eng/pipelines $TEST_DIR/eng/versions; | ||
| mkdir -p $TEST_DIR/OneBranchPipelines/stages; | ||
| cp /workspace/eng/scripts/run-mssql-odbc-tests.sh /workspace/eng/scripts/verify_mssql_odbc_provider.py $TEST_DIR/eng/scripts/; | ||
| cp /workspace/eng/pipelines/mssql-odbc-daily-validation-pipeline.yml $TEST_DIR/eng/pipelines/; | ||
| cp /workspace/eng/versions/mssql-python-rs-nuget.version $TEST_DIR/eng/versions/; | ||
| cp /workspace/OneBranchPipelines/stages/build-linux-single-stage.yml $TEST_DIR/OneBranchPipelines/stages/; |
Keep installed-wheel validation focused on package behavior while release lock and workflow contracts continue to run from a complete source checkout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (6)
Include lock files in manylinux fixturenext(...)will raiseStopIterationwith a less actionable error if the expected compile line… · New These DOTALL regexes can become brittle and accidentally match across unrelated YAML sections as… · New Avoid hard-coding the version in the marker assertion Bound assertion to the macOS matrix item This assertion includes a trailing space, so it will miss variants likecp -r /workspace/eng(no… · New
| command = next( | ||
| line for line in workflow.splitlines() if "uv pip compile" in line and output in line | ||
| ) |
| assert re.search(r"name: macos\b.*?universal: --universal", workflow, re.DOTALL) | ||
| assert re.search(r"name: windows\b.*?universal: --universal", workflow, re.DOTALL) | ||
| assert re.search(r"name: odbc\b.*?universal: \"\"", workflow, re.DOTALL) |
There was a problem hiding this comment.
Setting macOS’s universal value to "" still satisfies all three assertions: the macOS regex crosses into the Windows entry and matches its --universal. Restrict each assertion to its own matrix entry so removing the macOS flag is detected.
| "OneBranchPipelines/stages/build-linux-single-stage.yml", | ||
| ): | ||
| self.assertEqual(pipeline.count(f"/workspace/{path}"), 2) | ||
| self.assertNotIn("cp -r /workspace/eng ", pipeline) |



Work Item / Issue Reference
Summary
Preserves Python-version environment markers when release dependency locks are refreshed, preventing the Python 3.10-only asyncio backport from being selected on Python 3.11 and newer.
Changes:
Validation