From b4054fbc3db076017ff36425953f06de515031ce Mon Sep 17 00:00:00 2001 From: Jahnvi Thakkar Date: Wed, 5 Aug 2026 10:12:51 +0530 Subject: [PATCH 1/3] RELEASE: mssql-python-odbc 18.6.2.1 - correct license metadata + PyPI description Metadata-only re-release of the standalone mssql-python-odbc package (identical driver binaries as 18.6.2): - License: MIT -> Other/Proprietary License (setup.py license field + trove classifier). The wheel redistributes Microsoft's proprietary ODBC Driver 18 and VC++ runtime, so the MIT label was incorrect. The build script's own source stays MIT. - PyPI long_description: replaced the plain one-liner with a rendered Markdown description (project role, do-not-install-directly guidance, docs link, and a License information section linking both redistributed Microsoft license texts, azure-cognitiveservices-speech style). - Added committed canonical mssql_python_odbc/licenses/ dir (byte-exact copies of the ODBC driver and Visual Studio license texts) so the description links resolve and license_files embeds deterministically, independent of the build-time libs/ tree. - Version 18.6.2 -> 18.6.2.1 (packaging revision 1; literal 'v1' and +local are not PyPI-publishable, so a fourth numeric component is used). - Relaxed mssql_python/pybind/CMakeLists.txt version parser to accept a trailing packaging-revision component; only leading MAJOR.MINOR is used for the driver filename (validated with CMake: 18.6.2.1 -> MAJOR=18, MAJOR_MINOR=18.6). --- mssql_python/pybind/CMakeLists.txt | 12 ++- mssql_python_odbc/__init__.py | 11 +- ...OFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt | 100 ++++++++++++++++++ .../MICROSOFT_VISUAL_STUDIO_LICENSE.txt | 54 ++++++++++ setup_odbc.py | 60 +++++++++-- 5 files changed, 226 insertions(+), 11 deletions(-) create mode 100644 mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt create mode 100644 mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt diff --git a/mssql_python/pybind/CMakeLists.txt b/mssql_python/pybind/CMakeLists.txt index d5b8c1bea..c75eb23e4 100644 --- a/mssql_python/pybind/CMakeLists.txt +++ b/mssql_python/pybind/CMakeLists.txt @@ -90,12 +90,18 @@ if(NOT EXISTS "${MSODBCSQL_VERSION_SOURCE}") "build from a full repository checkout.") endif() file(STRINGS "${MSODBCSQL_VERSION_SOURCE}" _msodbcsql_version_line REGEX "^__version__") -string(REGEX REPLACE ".*['\"]([0-9]+\\.[0-9]+\\.[0-9]+)['\"].*" "\\1" +# Capture the full quoted version literal (e.g. 18.6.2, 18.6.2.1, 18.6.2.post1). +# Only a leading MAJOR.MINOR.PATCH must be numeric; a trailing packaging-revision +# component or PEP 440 suffix is allowed because mssql-python-odbc ships +# metadata-only re-releases as e.g. 18.6.2.1. The native driver filename is +# derived solely from MAJOR and MAJOR.MINOR below, so a trailing revision has no +# effect on which driver is loaded. +string(REGEX REPLACE ".*['\"]([^'\"]+)['\"].*" "\\1" MSODBCSQL_VERSION "${_msodbcsql_version_line}") -if(NOT MSODBCSQL_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+$") +if(NOT MSODBCSQL_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+") message(FATAL_ERROR "Failed to parse __version__ from ${MSODBCSQL_VERSION_SOURCE} " - "(got '${MSODBCSQL_VERSION}').") + "(got '${MSODBCSQL_VERSION}'); expected a leading MAJOR.MINOR.PATCH.") endif() string(REGEX MATCH "^[0-9]+" MSODBCSQL_VERSION_MAJOR "${MSODBCSQL_VERSION}") string(REGEX MATCH "^[0-9]+\\.[0-9]+" MSODBCSQL_VERSION_MAJOR_MINOR "${MSODBCSQL_VERSION}") diff --git a/mssql_python_odbc/__init__.py b/mssql_python_odbc/__init__.py index 8355021a4..33e6ded10 100644 --- a/mssql_python_odbc/__init__.py +++ b/mssql_python_odbc/__init__.py @@ -28,7 +28,16 @@ # CMakeLists.txt``) derives the driver filename version from it and injects it # into ``GetDriverPathCpp`` -- so the C++ resolver and this package can never # drift. Bump this one value to move to a new driver release. -__version__ = "18.6.2" +# +# The bundled Microsoft ODBC driver is 18.6; the trailing components are +# mssql-python-odbc's own packaging-revision counter. 18.6.2.1 is a metadata-only +# re-release of 18.6.2 (license label corrected MIT -> proprietary; identical +# binaries) -- the trailing ".1" is packaging revision 1. A literal "v1" suffix +# is not a valid PEP 440 version and +local versions are rejected by PyPI, so the +# revision is expressed as a fourth numeric component. ``mssql_python/pybind/ +# CMakeLists.txt`` parses only the leading MAJOR.MINOR from this value, so the +# extra component does not affect the resolved driver filename. +__version__ = "18.6.2.1" def get_libs_dir() -> str: diff --git a/mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt b/mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt new file mode 100644 index 000000000..ccd8cc2b8 --- /dev/null +++ b/mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt @@ -0,0 +1,100 @@ +MICROSOFT SOFTWARE LICENSE TERMS +MICROSOFT ODBC DRIVER 18 FOR SQL SERVER + +These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft services or software updates (except to the extent such services or updates are accompanied by new or additional terms, in which case those different terms apply prospectively and do not alter your or Microsoft’s rights relating to pre-updated software or services). IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. + +1. INSTALLATION AND USE RIGHTS. + + a) General. You may install and use any number of copies of the software to develop and test your applications. + + b) Third Party Software. The software may include third party applications that Microsoft, not the third party, licenses to you under this agreement. Any included notices for third party applications are for your information only. + +2. DISTRIBUTABLE CODE. The software may contain code you are permitted to distribute (i.e. make available for third parties) in applications you develop, as described in this Section. + + a) Distribution Rights. The code and test files described below are distributable if included with the software. + + i. REDIST.TXT Files. You may copy and distribute the object code form of code listed on the REDIST list in the software, if any, or listed at REDIST (https://aka.ms/odbc18eularedist); + + ii. Image Library. You may copy and distribute images, graphics, and animations in the Image Library as described in the software documentation; + + iii. Sample Code, Templates, and Styles. You may copy, modify, and distribute the source and object code form of code marked as “sample”, “template”, “simple styles”, and “sketch styles”; and + + iv. Third Party Distribution. You may permit distributors of your applications to copy and distribute any of this distributable code you elect to distribute with your applications. + + b) Distribution Requirements. For any code you distribute, you must: + + i. add significant primary functionality to it in your applications; + + ii. require distributors and external end users to agree to terms that protect it and Microsoft at least as much as this agreement; and + + iii. indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your applications, except to the extent that any claim is based solely on the unmodified distributable code. + + c) Distribution Restrictions. You may not: + + i. use Microsoft’s trademarks or trade dress in your application in any way that suggests your application comes from or is endorsed by Microsoft; or + + ii. modify or distribute the source code of any distributable code so that any part of it becomes subject to any license that requires that the distributable code, any other part of the software, or any of Microsoft’s other intellectual property be disclosed or distributed in source code form, or that others have the right to modify it. + +3. DATA COLLECTION. Some features in the software may enable collection of data from users of your applications that access or use the software. If you use these features to enable data collection in your applications, you must comply with applicable law, including getting any required user consent, and maintain a prominent privacy policy that accurately informs users about how you use, collect, and share their data. You agree to comply with all applicable provisions of the Microsoft Privacy Statement at [https://go.microsoft.com/fwlink/?LinkId=521839]. + +4. SCOPE OF LICENSE. The software is licensed, not sold. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you will not (and have no right to): + + a) work around any technical limitations in the software that only allow you to use it in certain ways; + + b) reverse engineer, decompile or disassemble the software; + + c) remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; + + d) use the software in any way that is against the law or to create or propagate malware; or + + e) share, publish, distribute, or lend the software (except for any distributable code, subject to the terms above), provide the software as a stand-alone hosted solution for others to use, or transfer the software or this agreement to any third party. + +5. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit http://aka.ms/exporting. + +6. SUPPORT SERVICES. Microsoft is not obligated under this agreement to provide any support services for the software. Any support provided is “as is”, “with all faults”, and without warranty of any kind. + +7. UPDATES. The software may periodically check for updates, and download and install them for you. You may obtain updates only from Microsoft or authorized sources. Microsoft may need to update your system to provide you with updates. You agree to receive these automatic updates without any additional notice. Updates may not include or support all existing software features, services, or peripheral devices. + +8. ENTIRE AGREEMENT. This agreement, and any other terms Microsoft may provide for supplements, updates, or third-party applications, is the entire agreement for the software. + +9. APPLICABLE LAW AND PLACE TO RESOLVE DISPUTES. If you acquired the software in the United States or Canada, the laws of the state or province where you live (or, if a business, where your principal place of business is located) govern the interpretation of this agreement, claims for its breach, and all other claims (including consumer protection, unfair competition, and tort claims), regardless of conflict of laws principles. If you acquired the software in any other country, its laws apply. If U.S. federal jurisdiction exists, you and Microsoft consent to exclusive jurisdiction and venue in the federal court in King County, Washington for all disputes heard in court. If not, you and Microsoft consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington for all disputes heard in court. + +10. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you: + + a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights. + + b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software. + + c) Germany and Austria. + + i. Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software. + + ii. Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law. + + Subject to the foregoing clause ii., Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence. + +11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + +12. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT, OR INCIDENTAL DAMAGES. + + This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, warranty, guarantee, or condition; strict liability, negligence, or other tort; or any other claim; in each case to the extent permitted by applicable law. + + It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your state, province, or country may not allow the exclusion or limitation of incidental, consequential, or other damages. + +Please note: As this software is distributed in Canada, some of the clauses in this agreement are provided below in French. + +Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français. + +EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues. + +LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices. + +Cette limitation concerne: + + • tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers; et + + • les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur. + +Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard. + +EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas. \ No newline at end of file diff --git a/mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt b/mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt new file mode 100644 index 000000000..79c580d8f --- /dev/null +++ b/mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt @@ -0,0 +1,54 @@ +MICROSOFT SOFTWARE LICENSE TERMS +MICROSOFT VISUAL STUDIO 2017 TOOLS, ADD-ONs and EXTENSIONS + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. +They apply to the software named above. The terms also apply to any Microsoft services or updates for the +software, except to the extent those have different terms. + +IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. + +1. INSTALLATION AND USE RIGHTS. + You may install and use any number of copies of the software. + +2. TERMS FOR SPECIFIC COMPONENTS. + a. Utilities. The software may contain some items on the Utilities List at https://go.microsoft.com/fwlink/?linkid=823097. You may copy and install these Utilities, if included with the software, onto devices to debug and deploy your applications and databases you developed with the software. Please note that Utilities are designed for temporary use, that Microsoft may not be able to patch or update Utilities separately from the rest of the software, and that some Utilities by their nature may make it possible for others to access devices on which the Utilities are installed. As a result, you should delete all Utilities you have installed after you finish debugging or deploying your applications and databases. Microsoft is not responsible for any third party use or access of Utilities you install on any device. + b. Build Tools. The software may include build tools which have specific use terms. For build tools, you may copy and install files from the software onto your build devices, including physical devices and virtual machines or containers on those machines, whether on-premises or remote machines that are owned by you, hosted on Azure for you, or dedicated solely to your use (collectively, “Build Devices”). You and others in your organization may use these files on your Build Devices solely to compile, build, and verify applications or run quality or performance tests of those applications as part of the build process. For clarity, “applications” means applications developed by you and others in your organization who are each licensed to use the software. + c. Microsoft Platforms. The software may include components from Microsoft Windows; Microsoft Windows Server; Microsoft SQL Server; Microsoft Exchange; Microsoft Office; and Microsoft SharePoint. These components are governed by separate agreements and their own product support policies, as described in the Microsoft “Licenses” folder accompanying the software, except that, if license terms for those components are also included in the associated installation directory, those license terms control. + d. Third Party Components. The software may include third party components with separate legal notices or governed by other agreements, as may be described in the ThirdPartyNotices file(s) accompanying the software. + +3. DATA. + a. Data Collection. The software may collect information about you and your use of the software, and send that to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may opt-out of many of these scenarios, but not all, as described in the product documentation. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications and you should provide a copy of Microsoft’s privacy statement to your users. The Microsoft privacy statement is located here https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. + b. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of personal data in connection with the software, Microsoft makes the commitments in the European Union General Data Protection Regulation Terms of the Online Services Terms to all customers effective May 25, 2018, at http://go.microsoft.com/?linkid=9840733. + +4. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not + · work around any technical limitations in the software; + · reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software except, and only to the extent required by third party licensing terms governing the use of certain open source components that may be included in the software; + · remove, minimize, block or modify any notices of Microsoft or its suppliers in the software; + · use the software in any way that is against the law; or + · share, publish, rent or lease the software, or provide the software as a stand-alone hosted as solution for others to use, or transfer the software or this agreement to any third party. + +5. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit www.microsoft.com/exporting. + +6. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. + +7. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services. + +8. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to interpretation of and claims for breach of this agreement, and the laws of the state where you live apply to all other claims. If you acquired the software in any other country, its laws apply. + +9. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you: + a. Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights. + b. Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software. + c. Germany and Austria. + (i) Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software. + (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law. + + Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence. + +10. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + +11. LIMITATION ON AND EXCLUSION OF DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES. +This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law. + +It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages. + +EULA ID: VS 2017_TOOLS_ADDONs_C++_RTW.3_ENU diff --git a/setup_odbc.py b/setup_odbc.py index 7e87cc737..c420d0c89 100644 --- a/setup_odbc.py +++ b/setup_odbc.py @@ -211,6 +211,44 @@ def run(self): _require_min_setuptools() +# PyPI long description (Markdown). Kept at module scope and UNINDENTED so the +# Markdown is not accidentally turned into indented code blocks by PyPI's +# renderer. The "License information" links point at the two redistributed +# Microsoft license texts that ship inside every wheel. +_LONG_DESCRIPTION = """\ +# mssql-python-odbc + +Internal implementation package for [**mssql-python**](https://pypi.org/project/mssql-python/) — +Microsoft's official Python driver for SQL Server, Azure SQL, and SQL databases in Fabric. + +This package ships the platform-specific **Microsoft ODBC Driver 18 for SQL Server** binaries +(and the supporting runtime libraries they depend on) as a standalone, pure-data wheel, so that +`mssql-python` does not have to bundle them inside its own wheel. + +## Not intended for direct use + +Do **not** install this package directly. Install +[**mssql-python**](https://pypi.org/project/mssql-python/) instead — it declares the correct +pinned dependency on `mssql-python-odbc` and loads these binaries automatically: + +``` +pip install mssql-python +``` + +## Documentation + +For usage, API documentation, and source code, see the +[mssql-python project on GitHub](https://github.com/microsoft/mssql-python). + +## License information + +This package redistributes proprietary Microsoft binaries under their respective license terms. +The full license text also ships inside every wheel, next to the binaries it covers. + +- [Microsoft ODBC Driver for SQL Server License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt) +- [Microsoft Visual C++ Redistributable (Visual Studio) License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt) +""" + setup( name="mssql-python-odbc", version=_read_odbc_version(), @@ -218,15 +256,23 @@ def run(self): "Internal implementation package for mssql-python: Microsoft ODBC " "Driver 18 for SQL Server binaries. Not intended for direct use." ), - long_description=( - "Internal implementation package not meant for direct consumption. " - "Install `mssql-python`, which depends on this package." - ), - long_description_content_type="text/plain", + long_description=_LONG_DESCRIPTION, + long_description_content_type="text/markdown", author="Microsoft Corporation", author_email="mssql-python@microsoft.com", url="https://github.com/microsoft/mssql-python", - license="MIT", + license="Other/Proprietary License", + # This wheel redistributes Microsoft's proprietary ODBC driver (and the VC++ + # runtime it links against), so the DISTRIBUTION is proprietary even though + # this build script's own source stays MIT (see the header). Embed both + # license texts in the wheel metadata (.dist-info/licenses/). These point at + # the committed, canonical ``mssql_python_odbc/licenses/`` copies so the + # references always resolve -- independent of whether the build-time libs/ + # tree has been populated yet (on ``main`` it is empty until sync_libs runs). + license_files=[ + "mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt", + "mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt", + ], packages=[PACKAGE_NAME], # vcredist / VC++ runtime (deliberate divergence from the main wheel's SHAPE, # not a behavior change): unlike setup.py we do NOT exclude @@ -258,7 +304,7 @@ def run(self): include_package_data=True, python_requires=">=3.10", classifiers=[ - "License :: OSI Approved :: MIT License", + "License :: Other/Proprietary License", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS", "Operating System :: POSIX :: Linux", From 5241aa95e95dfddf4ee4883c52c58da2e94ccd35 Mon Sep 17 00:00:00 2001 From: Jahnvi Thakkar Date: Wed, 5 Aug 2026 10:21:17 +0530 Subject: [PATCH 2/3] DOC: correct mssql-python-odbc PyPI license location wording The long_description claimed the license texts ship 'next to the binaries it covers', but they are embedded via license_files into the wheel metadata under .dist-info/licenses/ (package_data only globs libs/**). Reworded to point users at the actual, guaranteed location. --- setup_odbc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_odbc.py b/setup_odbc.py index c420d0c89..6caa8e5b5 100644 --- a/setup_odbc.py +++ b/setup_odbc.py @@ -243,7 +243,7 @@ def run(self): ## License information This package redistributes proprietary Microsoft binaries under their respective license terms. -The full license text also ships inside every wheel, next to the binaries it covers. +The full license text also ships inside every wheel (in the wheel metadata under `.dist-info/licenses/`). - [Microsoft ODBC Driver for SQL Server License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt) - [Microsoft Visual C++ Redistributable (Visual Studio) License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt) From f22102a52713d14b904891fda8a80efa290ebe2f Mon Sep 17 00:00:00 2001 From: Jahnvi Thakkar Date: Wed, 5 Aug 2026 11:41:43 +0530 Subject: [PATCH 3/3] CHORE: move mssql-python-odbc PyPI description to PyPI_Description_ODBC.md Per review feedback, maintain the long_description as a standalone Markdown file (mirrors the main mssql-python package's PyPI_Description.md) instead of an inline string in setup_odbc.py. setup_odbc.py now reads it via PROJECT_ROOT / 'PyPI_Description_ODBC.md'. Content unchanged; root-level file (distinct name to avoid clashing with the main package's PyPI_Description.md), not bundled into the wheel. --- PyPI_Description_ODBC.md | 31 ++++++++++++++++++++++++++++++ setup_odbc.py | 41 ++++------------------------------------ 2 files changed, 35 insertions(+), 37 deletions(-) create mode 100644 PyPI_Description_ODBC.md diff --git a/PyPI_Description_ODBC.md b/PyPI_Description_ODBC.md new file mode 100644 index 000000000..2668a3dc1 --- /dev/null +++ b/PyPI_Description_ODBC.md @@ -0,0 +1,31 @@ +# mssql-python-odbc + +Internal implementation package for [**mssql-python**](https://pypi.org/project/mssql-python/) — +Microsoft's official Python driver for SQL Server, Azure SQL, and SQL databases in Fabric. + +This package ships the platform-specific **Microsoft ODBC Driver 18 for SQL Server** binaries +(and the supporting runtime libraries they depend on) as a standalone, pure-data wheel, so that +`mssql-python` does not have to bundle them inside its own wheel. + +## Not intended for direct use + +Do **not** install this package directly. Install +[**mssql-python**](https://pypi.org/project/mssql-python/) instead — it declares the correct +pinned dependency on `mssql-python-odbc` and loads these binaries automatically: + +``` +pip install mssql-python +``` + +## Documentation + +For usage, API documentation, and source code, see the +[mssql-python project on GitHub](https://github.com/microsoft/mssql-python). + +## License information + +This package redistributes proprietary Microsoft binaries under their respective license terms. +The full license text also ships inside every wheel (in the wheel metadata under `.dist-info/licenses/`). + +- [Microsoft ODBC Driver for SQL Server License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt) +- [Microsoft Visual C++ Redistributable (Visual Studio) License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt) diff --git a/setup_odbc.py b/setup_odbc.py index 6caa8e5b5..339acf3ca 100644 --- a/setup_odbc.py +++ b/setup_odbc.py @@ -211,43 +211,10 @@ def run(self): _require_min_setuptools() -# PyPI long description (Markdown). Kept at module scope and UNINDENTED so the -# Markdown is not accidentally turned into indented code blocks by PyPI's -# renderer. The "License information" links point at the two redistributed -# Microsoft license texts that ship inside every wheel. -_LONG_DESCRIPTION = """\ -# mssql-python-odbc - -Internal implementation package for [**mssql-python**](https://pypi.org/project/mssql-python/) — -Microsoft's official Python driver for SQL Server, Azure SQL, and SQL databases in Fabric. - -This package ships the platform-specific **Microsoft ODBC Driver 18 for SQL Server** binaries -(and the supporting runtime libraries they depend on) as a standalone, pure-data wheel, so that -`mssql-python` does not have to bundle them inside its own wheel. - -## Not intended for direct use - -Do **not** install this package directly. Install -[**mssql-python**](https://pypi.org/project/mssql-python/) instead — it declares the correct -pinned dependency on `mssql-python-odbc` and loads these binaries automatically: - -``` -pip install mssql-python -``` - -## Documentation - -For usage, API documentation, and source code, see the -[mssql-python project on GitHub](https://github.com/microsoft/mssql-python). - -## License information - -This package redistributes proprietary Microsoft binaries under their respective license terms. -The full license text also ships inside every wheel (in the wheel metadata under `.dist-info/licenses/`). - -- [Microsoft ODBC Driver for SQL Server License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt) -- [Microsoft Visual C++ Redistributable (Visual Studio) License](https://github.com/microsoft/mssql-python/blob/main/mssql_python_odbc/licenses/MICROSOFT_VISUAL_STUDIO_LICENSE.txt) -""" +# PyPI long description is maintained as a standalone Markdown file (mirrors the +# main mssql-python package, which reads PyPI_Description.md) so it can be edited +# and reviewed as Markdown rather than embedded in this build script. +_LONG_DESCRIPTION = (PROJECT_ROOT / "PyPI_Description_ODBC.md").read_text(encoding="utf-8") setup( name="mssql-python-odbc",