Skip to content

FIX: Preserve Python-specific release dependencies - #832

Open
gargsaumya wants to merge 4 commits into
mainfrom
saumya/fix-release-dependency-markers
Open

gargsaumya wants to merge 4 commits into
mainfrom
saumya/fix-release-dependency-markers

Conversation

@gargsaumya

@gargsaumya gargsaumya commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Work Item / Issue Reference

AB#47861


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:

  • Compiles Linux, macOS, and Windows release locks with universal marker preservation.
  • Leaves the ODBC lock generation path unchanged.
  • Regenerates affected locks without upgrading existing package versions and retains SHA256 hashes only.
  • Adds focused regression tests for universal generation and the asyncio backport marker.
  • Preserves Gaurav's fix to skip profiler contracts when repository-only profiler tools are absent from isolated wheel tests.
  • Supplies the narrow set of repository-side mssql-odbc runner contract files to isolated Linux wheel tests and reports runner stdout/stderr if the status artifact is absent.
  • Excludes source-only release-lock/workflow contracts from both manylinux and musllinux installed-wheel suites, with a source-checkout contract guarding both selections.

Validation

  • Release dependency contract module: 3 passed, including the exact asyncio backport regression.
  • Linux pipeline contract tests: 5 passed; the complete runner/pipeline module was 5 passed, 5 skipped on Windows because runner execution requires Linux.
  • Reproduced the isolated fixture failure before the fix; after the fix, pipeline-equivalent collection excluded the repository contract module while an installed-wheel sentinel passed.
  • Targeted dependency-lock and runner contract tests: 12 passed on Linux in the prior follow-up.
  • Isolated Linux wheel-test fixture simulation: 10 passed, 1 profiler module skipped as intended in the prior follow-up.
  • Budget-exhaustion runner test repeated 50 times on Linux in the prior follow-up: 50 passed.
  • Black (line length 100), whitespace, and YAML parse checks: passed.
  • Lock regeneration with repository-pinned uv 0.12.6 repeated byte-for-byte: passed.
  • Production-like pip dry runs with require-hashes on Windows Python 3.10 through 3.14: passed.
  • Confirmed Python 3.10 selects the backport and Python 3.11 through 3.14 do not.
  • Simulated macOS and manylinux x64 resolution on Python 3.10 through 3.14: passed; the ADO native build matrix remains the final validation.

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>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 07:07
@github-actions github-actions Bot added the pr-size: medium Moderate update size label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

PR Performance Report

Performance could not be assessed.

Build provenance validation failed. No result is available.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Medium severity

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.

Comment on lines +23 to +29
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)
Comment on lines +52 to +56
assert re.fullmatch(
r"backports-asyncio-runner==1\.2\.0 ; "
r"python_(?:full_)?version < ['\"]3\.11['\"] \\",
requirement,
)
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

85%


📈 Total Lines Covered: 9445 out of 11094
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No 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

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

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>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Both isolated Linux wheel-test paths omit lock files required by the new regression test, causing FileNotFoundError.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)

Comment on lines +329 to +334
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>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 4 Medium severity · 1 Low severity

Open (6)

Comment on lines +16 to +18
command = next(
line for line in workflow.splitlines() if "uv pip compile" in line and output in line
)
Comment on lines +21 to +23
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants