Uh oh!
There was an error while loading. Please reload this page.
FEAT: Add conda packaging recipes and publish tooling for mssql-python - #720
FEAT: Add conda packaging recipes and publish tooling for mssql-python#720Jahnvi Thakkar (jahnvi480) wants to merge 3 commits into
Conversation
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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-pythonandmssql-python-odbcthat 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.
| File | Description |
|---|---|
| conda/onebranch-publish-conda-stage.yml | Draft OneBranch stage to build from signed artifacts, gate on smoke tests, and publish to the microsoft Anaconda channel. |
| conda/mssql-python/meta.yaml | Conda recipe for repackaging the mssql-python wheel and depending on a version-locked mssql-python-odbc. |
| conda/mssql-python-odbc/meta.yaml | Conda recipe for repackaging the proprietary driver wheel into a companion conda package. |
| conda/build_and_test_local.ps1 | Local “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
publishToCondais 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| # 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 |
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.
- 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;" |
Work Item / Issue Reference
Summary
Adds the conda packaging foundation for
mssql-pythonso it can be published to theMicrosoft-owned
microsoftAnaconda 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
microsoftchannel 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 signedwheel (no compilation); version-locked to the
mssql-python-odbccompanion.conda/mssql-python-odbc/meta.yaml— recipe for the proprietary Microsoft ODBC Driver 18companion. It must live on the Microsoft-owned
microsoftchannel, never conda-forge.conda/build_and_test_local.ps1— offline "test-before-live" harness: builds bothpackages, 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 thesigned 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 leanmicrosoftchannel under--strict-channel-priority. This deliberately avoidsconda-forge's
azure-corerecipe, which over-declaresflaskandsixas runtime depsand cascades in
celery/boto3/botocore(~30 extra packages, empirically verified71 -> 42 packages when using the
microsoftchannel). The upstream fix is filed atconda-forge/azure-core-feedstock#71.
Refs #563