Skip to content

FEAT: Add conda packaging recipes and publish tooling for mssql-python - #720

Open
Jahnvi Thakkar (jahnvi480) wants to merge 3 commits into
mainfrom
jahnvi/conda-onboarding
Open

FEAT: Add conda packaging recipes and publish tooling for mssql-python#720
Jahnvi Thakkar (jahnvi480) wants to merge 3 commits into
mainfrom
jahnvi/conda-onboarding

Conversation

@jahnvi480

@jahnvi480Jahnvi Thakkar (jahnvi480) commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Work Item / Issue Reference

AB#47315


Summary

Adds the conda packaging foundation for mssql-python so it can be published to the
Microsoft-owned microsoft Anaconda channel alongside the existing PyPI wheels.

This is prototype / foundational tooling. The publish stage is a DRAFT and is not
wired into the official release pipeline yet — it activates only after the microsoft
channel onboarding and an org-scoped Anaconda token are provisioned. The recipes and the
local harness build and validate 100% of the mechanics offline today.

What's included

  • conda/mssql-python/meta.yaml — recipe for the Python binding. Repackages the signed
    wheel (no compilation); version-locked to the mssql-python-odbc companion.
  • conda/mssql-python-odbc/meta.yaml — recipe for the proprietary Microsoft ODBC Driver 18
    companion. It must live on the Microsoft-owned microsoft channel, never conda-forge.
  • conda/build_and_test_local.ps1 — offline "test-before-live" harness: builds both
    packages, assembles a local channel, installs into a clean env, and runs import +
    optional live-connect smoke tests. Needs no channel onboarding or permissions.
  • conda/onebranch-publish-conda-stage.yml — DRAFT OneBranch stage that builds from the
    signed release artifacts, gates on the smoke test, then publishes both packages together,
    version-locked.

Dependency hygiene

Azure SDK dependencies (azure-core / azure-identity / msal) resolve from the lean
microsoft channel under --strict-channel-priority. This deliberately avoids
conda-forge's azure-core recipe, which over-declares flask and six as runtime deps
and cascades in celery / boto3 / botocore (~30 extra packages, empirically verified
71 -> 42 packages when using the microsoft channel). The upstream fix is filed at
conda-forge/azure-core-feedstock#71.

Refs #563

Adds conda recipes for mssql-python and its mssql-python-odbc companion, a local build/test-before-live harness, and a draft OneBranch conda publish stage. Azure SDK deps resolve from the lean 'microsoft' Anaconda channel under --strict-channel-priority so conda-forge's azure-core recipe (which over-declares flask/six -> celery/boto3/botocore) does not bloat the environment. See conda-forge/azure-core-feedstock#71.
CopilotAI lite review requested due to automatic review settings August 14, 2026 08:50
@github-actionsgithub-actionsBot added the pr-size: medium Moderate update size label Aug 14, 2026
Comment threadconda/mssql-python-odbc/meta.yaml Fixed

CopilotAI 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.

Pull request overview

This PR adds initial conda packaging assets for mssql-python (and its mssql-python-odbc companion) so the project can be published to the Microsoft-owned microsoft Anaconda channel, alongside the existing PyPI wheel distribution.

Changes:

  • Adds conda recipes for mssql-python and mssql-python-odbc that repackage existing wheels (no compilation).
  • Adds a local PowerShell harness to build both recipes, create a local channel, and validate import / optional live-connect.
  • Adds a draft OneBranch stage to build/test/publish conda artifacts from signed release artifacts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

FileDescription
conda/onebranch-publish-conda-stage.ymlDraft OneBranch stage to build from signed artifacts, gate on smoke tests, and publish to the microsoft Anaconda channel.
conda/mssql-python/meta.yamlConda recipe for repackaging the mssql-python wheel and depending on a version-locked mssql-python-odbc.
conda/mssql-python-odbc/meta.yamlConda recipe for repackaging the proprietary driver wheel into a companion conda package.
conda/build_and_test_local.ps1Local “test-before-live” harness to build, index, install, and smoke test the conda packages.
Suppressed comments (1)

conda/onebranch-publish-conda-stage.yml:133

  • Same string-vs-boolean condition issue here: quoting the template expression turns it into a string, which can cause the publish step to be skipped unexpectedly even when publishToConda is true.
 - task: PowerShell@2
displayName: 'Publish to anaconda.org/microsoft'
condition: and(succeeded(), eq('${{ parameters.publishToConda }}', true))

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadconda/mssql-python/meta.yaml Outdated
Comment threadconda/mssql-python-odbc/meta.yaml Outdated
Comment threadconda/build_and_test_local.ps1 Outdated
Comment threadconda/onebranch-publish-conda-stage.yml Outdated
Comment threadconda/mssql-python-odbc/meta.yaml Outdated
Comment on lines +42 to +45
# Proprietary Microsoft ODBC Driver 18 payload — Microsoft EULA.
# TODO(before publish): point license_file at the driver EULA text, not repo LICENSE.
license: LicenseRef-Microsoft-Proprietary
license_file: ../../LICENSE
Comment threadconda/build_and_test_local.ps1 Outdated
Recipes now honor ARTIFACTS_PY/ARTIFACTS_ODBC to install signed wheels offline (--no-index --find-links) instead of always hitting PyPI. build_and_test_local.ps1 adds --override-channels for reproducible solves and its header no longer claims an offline/no-microsoft-channel run. Draft publish stage condition compares the boolean parameter directly (eq(param, true)) instead of a quoted string.
Comment threadconda/mssql-python-odbc/meta.yaml Fixed
- Single-source versions via MSSQL_PYTHON_VERSION/MSSQL_ODBC_VERSION env (wired from the publish-stage params) so the package version and the companion pin can't drift.
- Point mssql-python-odbc license_file at the actual ODBC Driver 18 EULA + VC++ license (was MIT-primary root LICENSE); remove the resolved TODO.
- Drop the no-op azure-identity >=1.12.0 floor (microsoft channel ships CalVer).
- Re-assert the wheel platform floor via __glibc/__osx virtual-package run constraints.
- Add conda/driver_load_probe.py + run it in the gate and local harness so we prove the native ODBC driver loads, not just the Python shim.
- Publish stage: require signed wheels (no PyPI fallback), publish companion-first with --skip-existing and a #706 pair guard, and document the required resources.pipelines declaration.
# Unreachable endpoint (nothing listens on TCP port 1) -> fast connection
# refusal AFTER the driver has loaded and attempted the socket.
conn_str = (
"Server=127.0.0.1,1;Database=x;Uid=x;Pwd=x;"
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: mediumModerate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jahnvi480@github-advanced-security