Skip to content

Commit 03343d2

Browse files
committed
Merged PR 5323: Build Setup and Release Pipeline
Build Setup and Release Pipeline ---- #### AI description (iteration 1) #### PR Classification Build setup and release pipeline implementation. #### PR Summary This pull request sets up the build and release pipeline for generating WHL files. - `setup.py`: Added custom build classes for CMake integration and wheel distribution. - `build-whl-pipeline.yml`: Introduced a new pipeline configuration for building and publishing WHL files. - `requirements.txt`: Added `setuptools` to the requirements. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #33219
1 parent c340068 commit 03343d2

15 files changed

+118
-85
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ mssql_python/.vs
2525
# Ignore test-*.xml files
2626
test-*.xml
2727
**/test-**.xml
28+
29+
# Ignore the build & mssql_python.egg-info directories
30+
build/
31+
mssql_python.egg-info/

README.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,7 @@
1-
# MSSQL-Python
1+
# mssql-python
22

3-
This repository contains the source code for the MSSQL-Python project, which provides Python bindings for the Microsoft SQL Server driver using `pybind11`. The project includes a C++ extension module that wraps the DDBC API and exposes it to Python, allowing for efficient database interactions.
3+
This is a new Python driver for Microsoft SQL Server currently under development.
44

5-
## Build Status (`main`)
5+
## Development Stage
66

7-
### Python Tests
8-
[![Build Status](https://sqlclientdrivers.visualstudio.com/mssql-python/_apis/build/status%2FPython%20Tests?branchName=main)](https://sqlclientdrivers.visualstudio.com/mssql-python/_build/latest?definitionId=2024&branchName=main)
9-
10-
## Requirements
11-
12-
To build and run this project, you need the following:
13-
14-
- **Python**: Version 3.13
15-
16-
### Installing Requirements
17-
18-
To install the required Python packages, use the following command:
19-
20-
```sh
21-
pip install -r requirements.txt
22-
```
23-
24-
## Running Tests
25-
26-
To run the tests locally, use the following command:
27-
28-
```sh
29-
python -m pytest -v
30-
```
31-
32-
## Building the PYD binary
33-
34-
To build locally, follow steps in the `README.txt` inside `mssql_python\pybind` directory.
7+
Please note that this project is in the early stages of development. No code, logic, or binaries are present in this package at this time. This release is intended to reserve the package name on PyPI and provide a placeholder for future development. Stay tuned for updates as we continue to work on this project.

build-and-release-pipeline.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: build-and-release-pipeline
2+
3+
jobs:
4+
- job: BuildWheel
5+
pool:
6+
vmImage: 'windows-latest'
7+
8+
steps:
9+
- task: UsePythonVersion@0
10+
inputs:
11+
versionSpec: '3.13'
12+
addToPath: true
13+
githubToken: $(GITHUB_TOKEN)
14+
displayName: 'Use Python 3.13'
15+
16+
- script: |
17+
python -m pip install --upgrade pip
18+
pip install -r requirements.txt
19+
displayName: 'Install build dependencies'
20+
21+
- script: |
22+
python setup.py bdist_wheel
23+
displayName: 'Build .whl file'
24+
25+
- task: PublishBuildArtifacts@1
26+
inputs:
27+
PathtoPublish: 'dist'
28+
ArtifactName: 'mssql-python'
29+
publishLocation: 'Container'
30+
displayName: 'Publish Artifact'
31+
32+
- task: EsrpRelease@7
33+
inputs:
34+
ConnectedServiceName: 'mssql-python-service'
35+
keyvaultname: mssqlpythonKey
36+
authcertname: 'ESRP-Release-mssql-python-auth'
37+
signcertname: 'ESRP-Release-mssql-python-Sign2'
38+
clientid: 'a0d18a38-fde1-4ba7-92e1-15be16cb6a8e'
39+
Intent: 'PackageDistribution'
40+
ContentType: 'PyPi'
41+
ContentSource: 'Folder'
42+
FolderLocation: '$(System.DefaultWorkingDirectory)/dist'
43+
WaitForReleaseCompletion: true
44+
Owners: 'enumittal@microsoft.com'
45+
Approvers: 'enumittal@microsoft.com'
46+
ServiceEndpointUrl: 'https://api.esrp.microsoft.com'
47+
MainPublisher: 'ESRPRELPACMAN'
48+
DomainTenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47'
49+
displayName: 'ESRP Release'

build-pyd-pipeline.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

mssql_python/cursor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,10 @@ def _get_numeric_data(self, param):
243243
# strip decimal point from param & convert the significant digits to integer
244244
# Ex: 12.34 ---> 1234
245245
val = str(param)
246-
if '.' in val:
246+
if '.' in val or '-' in val:
247247
val = val.replace('.', '')
248248
val = val.replace('-', '')
249-
val = int(val)
249+
val = int(val)
250250
numeric_data.val = val
251251
return numeric_data
252252

mssql_python/libs/win/msvcp140.dll

-551 KB
Binary file not shown.
-906 KB
Binary file not shown.

mssql_python/libs/win/ucrtbase.dll

-1.31 MB
Binary file not shown.
-2.14 MB
Binary file not shown.
-118 KB
Binary file not shown.

0 commit comments

Comments
 (0)