Skip to content

CHORE: validate Python 3.15 RC2 in PR CI - #817

Draft
Gaurav Sharma (bewithgaurav) wants to merge 15 commits into
mainfrom
bewithgaurav/python-3.15-validation
Draft

Gaurav Sharma (bewithgaurav) wants to merge 15 commits into
mainfrom
bewithgaurav/python-3.15-validation

Conversation

@bewithgaurav

@bewithgaurav Gaurav Sharma (bewithgaurav) commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds Python 3.15 RC2 validation while keeping every existing PR-validation leg enabled.

  • Adds Windows x64, macOS x86_64, Linux x86_64, and Linux ARM64 Python 3.15 legs.
  • Uses pinned PyArrow nightly 26.0.0.dev323 because stable PyArrow 25.0.1 does not publish Python 3.15 wheels.
  • Handles Python 3.15 POSIX feature macros, Decimal conversion traceback privacy, and cyclic-GC finalization ordering.
  • Inherits the stable ABI mssql-python-rs 0.3.0 installer contract merged in CHORE: Accept stable ABI Rust wheels and mssql-python-rs 0.3.0 #804.

Validation

Follow-up

The native hardening changes overlap with #810. Pull main again after #810 merges to reconcile that overlap.

Add Python 3.15 RC2 preview legs on Windows, macOS, and Linux x64/ARM64 so the existing PR validation flow can expose product and packaging blockers before GA. Skip Arrow-only tests on 3.15 until PyArrow publishes compatible wheels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AB#48377

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Give each concurrent connect call its own configured native connection mock so MagicMock child creation cannot race during close.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AB#48377

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the pinned PyArrow nightly wheel set and skip every non-3.15 pipeline leg so the validation result measures only 3.15 readiness.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Select compatible abi3 Rust wheels for newer CPython versions and include Python.h before libc-consuming standard headers.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Force Python.h ahead of libc headers in every native translation unit, align the GC stress assertion with Python 3.15 finalization ordering, and preserve focused-pipeline contracts.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Suppress Decimal conversion causes that can retain rejected input and make the cyclic-finalizer stress test explicitly release its synthetic self-cycle.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep Python 3.15 preview coverage additive while preserving every existing validation leg.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

# Conflicts:
#	mssql_python/pybind/CMakeLists.txt
#	tests/test_040_native_binary_hardening.py
Copilot AI lite review requested due to automatic review settings September 25, 2026 05:12

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 nightly dependency index affects existing jobs, and a hardening test can fail outside source checkouts.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Extends PR CI with Python 3.15 RC2 validation across supported platforms and updates compatibility, hardening, and dependency handling.

Changes:

  • Adds Python 3.15 CI legs and PyArrow preview support.
  • Updates ABI3 Rust wheel selection and package pins.
  • Adds native hardening and Python 3.15 compatibility fixes.
File Description
tests/​test_040_native_binary_hardening.py Native hardening regression tests
tests/​test_038_mssql_odbc_daily_validation.py Pipeline and wheel-selection contract tests
tests/​test_009_pooling.py Python 3.15 GC finalization handling
tests/​test_008_auth.py Concurrent authentication test setup
requirements.txt Python 3.15 PyArrow dependency
mssql_python/​pybind/​ddbc_bindings.h Python header include ordering
mssql_python/​pybind/​CMakeLists.txt POSIX build hardening flags
mssql_python/​cursor.py Decimal traceback privacy
eng/​versions/​mssql-python-rs.version Rust package version pin
eng/​versions/​mssql-python-rs-nuget.version NuGet transport version pin
eng/​scripts/​select_mssql_python_rs_wheel.py Compatible wheel selection
eng/​scripts/​install-mssql-py-core.sh Unix installer integration
eng/​scripts/​install-mssql-py-core.ps1 Windows installer integration
eng/​pipelines/​pr-validation-pipeline.yml Python 3.15 validation matrix

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

assert flag in cmake


def test_python_headers_precede_standard_library_headers():
Comment thread mssql_python/cursor.py
Comment on lines 2722 to +2725
# Split str(val) from the decimal parse so we only chain a
# cause we know is value-free. decimal.DecimalException
# messages (e.g. ConversionSyntax) never echo the input, so
# they are safe to preserve for debugging. str(val) itself
# or any other error could carry the value in its message
# and surface through __cause__ / formatted tracebacks, so
# those are re-raised with the chain suppressed (from None).
# cause. Python 3.15's pure-Python decimal implementation
# can retain the rejected input in traceback state, so every
# conversion failure suppresses chaining.
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

84%


📈 Total Lines Covered: 9404 out of 11085
📁 Project: mssql-python


Diff Coverage

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

  • mssql_python/cursor.py (100%)

Summary

  • Total: 2 lines
  • Missing: 0 lines
  • Coverage: 100%

📋 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.ddbc_bindings.cpp: 79.3%
mssql_python.pybind.connection.connection_pool.cpp: 82.9%
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%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

Copilot AI review requested due to automatic review settings September 25, 2026 08:51
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

PR Performance Report

✅ No regression detected

No consistent slowdowns detected across all 2 environments.

0 IMPROVEMENTS 0 SLOWDOWNS 2/2 ENVIRONMENTS

Coverage: 2 of 2 environments completed. Advisory result; does not block merging.

Performance diagnostics

Phase times are inclusive diagnostics and must not be added together. They identify where measured time changed, not why it changed.

No affected phases or call-count changes were recorded.

All database tasks and timings

Unix / SQL Server 2022

Database task Before After Paired change Result
Connection opening 10.642 ms 10.393 ms -2.9% no signal
SELECT queries 1.057 ms 1.104 ms +4.8% no signal
Row insertion 34.481 ms 36.666 ms +6.9% no signal
Executemany inserts 156.383 ms 157.718 ms -0.0% no signal
Fetch-all queries 120.452 ms 120.628 ms +0.1% no signal
Row-by-row fetching 14.472 ms 14.477 ms +0.1% no signal
Batched row fetching 118.227 ms 117.930 ms -0.3% no signal
Transaction commit and rollback 118.186 ms 113.781 ms -3.8% no signal
Arrow row fetching 93.830 ms 95.759 ms +0.5% no signal
100,000-row insertion 446.689 ms 489.625 ms +3.2% no signal
Row fetching in batches of 100 121.418 ms 123.749 ms +1.5% no signal
Row fetching in batches of 10,000 128.392 ms 137.091 ms +3.9% no signal
Repeated positional queries 33.930 ms 34.142 ms +1.8% no signal
Repeated named-parameter queries 37.158 ms 36.801 ms -1.1% no signal
Legacy 100,000-row insertion 351.559 ms 349.278 ms -0.6% no signal
Insertion with explicit input sizes 486.435 ms 531.712 ms +8.6% no signal
Joined aggregation queries 179.353 ms 179.271 ms +0.2% no signal
Large joined-result fetching 177.567 ms 182.549 ms +2.0% no signal
1.2-million-row fetching 3495.783 ms 3441.290 ms -1.9% no signal
Common table expression queries 5.465 ms 5.469 ms +1.3% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.334 ms 1.328 ms -0.0% no signal

Unix / SQL Server 2025

Database task Before After Paired change Result
Connection opening 97.710 ms 98.270 ms +1.1% no signal
SELECT queries 1.085 ms 1.075 ms -1.3% no signal
Row insertion 34.875 ms 34.595 ms -1.9% no signal
Executemany inserts 153.213 ms 153.939 ms -2.1% no signal
Fetch-all queries 122.079 ms 122.086 ms -0.0% no signal
Row-by-row fetching 14.557 ms 14.473 ms -0.6% no signal
Batched row fetching 119.963 ms 119.470 ms -0.5% no signal
Transaction commit and rollback 118.004 ms 116.854 ms -0.7% no signal
Arrow row fetching 94.280 ms 95.318 ms +1.2% no signal
100,000-row insertion 457.435 ms 454.852 ms -4.7% no signal
Row fetching in batches of 100 122.354 ms 125.766 ms +1.5% no signal
Row fetching in batches of 10,000 140.589 ms 127.515 ms +2.8% no signal
Repeated positional queries 34.028 ms 33.789 ms -0.3% no signal
Repeated named-parameter queries 36.534 ms 37.257 ms +1.0% no signal
Legacy 100,000-row insertion 357.943 ms 346.958 ms -2.2% no signal
Insertion with explicit input sizes 475.354 ms 487.854 ms +1.7% no signal
Joined aggregation queries 162.738 ms 160.616 ms -2.2% no signal
Large joined-result fetching 185.086 ms 186.965 ms +1.8% no signal
1.2-million-row fetching 3473.093 ms 3502.345 ms +0.7% no signal
Common table expression queries 5.299 ms 5.291 ms +1.1% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.474 ms 1.481 ms +4.2% no signal
Build and measurement details

ADO build 179729

PR head: 8084f02c2768ebc4120560d8d0c17d20c18a7c0c
Base: c5831908977f0b8b355fda6f71d86629855d46aa
Measured merge: 5dfe8065c42a5f335204963f740d26244ebd8818

  • Unix / SQL Server 2022: Python 3.12.3, x86_64, SQL 16.0.4295.3; 5 paired comparisons and 1 warmup.
  • Unix / SQL Server 2025: Python 3.12.3, x86_64, SQL 17.0.5005.3; 5 paired comparisons and 1 warmup.

A consistent change requires more than 20% median paired movement, at least 1 ms between the median runtimes, and at least 80% of pairs exceeding the relative threshold in the same direction. A slowdown without enough pair agreement is reported as inconsistent.

The displayed change is the median of paired before-and-after ratios. It is not recalculated from the two displayed median runtimes.

Both revisions use profiling-enabled builds on the same agent and database, with alternating order and discarded warmups. Results are diagnostic and do not represent production-wheel latency.

Raw samples and logs are attached to the ADO run as profiler-* artifacts.

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

Four unresolved moderate findings must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity · 1 Low severity

Open (3)

Comment on lines +819 to +821
apt-get update &&
apt-get install -y cmake curl wget gnupg build-essential
python3 --version
….15-validation

# Conflicts:
#	eng/scripts/install-mssql-py-core.ps1
#	eng/scripts/install-mssql-py-core.sh
#	eng/versions/mssql-python-rs-nuget.version
#	eng/versions/mssql-python-rs.version
#	tests/test_038_mssql_odbc_daily_validation.py
Drop the stable-ABI wheel selection now provided by PR #804 and refresh the pinned Python 3.15 PyArrow nightly after the previous build was pruned.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings October 1, 2026 12:25
Comment thread requirements.txt
unittest-xml-reporting
psutil
pyarrow
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple

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

🔵 Needs a closer look

Four unresolved moderate findings remain in CI failure handling, Decimal behavior documentation/tests, and isolated-wheel validation.

Review effort: Lite
Findings: 2 Medium severity · 1 Low severity

Open (3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants