Skip to content

Conversation

@bewithgaurav
Copy link
Collaborator

@bewithgaurav bewithgaurav commented Jan 20, 2026

Work Item / Issue Reference

AB#39046

GitHub Issue: #257


Summary

  • Add build_ddbc package for native extension compilation
    • python -m build_ddbc: standalone compilation CLI
    • Custom PEP 517 backend: auto-compiles on python -m build
  • Consolidate project config into pyproject.toml
    • Moved pytest config from pytest.ini
    • Added optional dependencies [dev], [lint], [all]
    • Added coverage, mypy, black, autopep8, pylint configs
  • Simplified setup.py to platform-specific wheel logic only
  • Delete pytest.ini (moved to pyproject.toml)

This pull request introduces a new build system for the mssql-python package, centering around a custom build_ddbc package that provides both a command-line interface and a PEP 517-compliant build backend. The changes automate the compilation of the ddbc_bindings native extension, streamline build configuration, and modernize project metadata and tooling configuration.

The most important changes are:

Build System Overhaul:

  • Added the build_ddbc package, which includes a CLI (python -m build_ddbc) for compiling native extensions and a PEP 517 build backend that automatically compiles ddbc_bindings before building wheels or during editable installs. This includes new modules: __init__.py, __main__.py, compiler.py, and build_backend.py. [1] [2] [3] [4]

  • Updated pyproject.toml to use the new build_ddbc.build_backend as the build backend, specify build requirements, and comprehensively define project metadata, dependencies, and URLs.

Tooling and Linting Configuration:

  • Expanded and organized code formatting and linting settings in pyproject.toml, including sections for Black, Autopep8, Pylint, Flake8, and MyPy, with appropriate options for each tool. [1] [2] [3]

Test Configuration Cleanup:

  • Removed the old pytest.ini file, consolidating test markers and options into pyproject.toml for a unified configuration.

These changes collectively modernize the build and development workflow for the project, making it easier to build, test, and maintain native extensions and Python code.

- Add build_ddbc package for native extension compilation
  - python -m build_ddbc: standalone compilation CLI
  - Custom PEP 517 backend: auto-compiles on python -m build
- Consolidate project config into pyproject.toml
  - Moved pytest config from pytest.ini
  - Added optional dependencies [dev], [lint], [all]
  - Added coverage, mypy, black, autopep8, pylint configs
- Simplified setup.py to platform-specific wheel logic only
- Delete pytest.ini (moved to pyproject.toml)
@github-actions github-actions bot added the pr-size: large Substantial code update label Jan 20, 2026
@github-actions
Copy link

github-actions bot commented Jan 20, 2026

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

76%


📈 Total Lines Covered: 5431 out of 7084
📁 Project: mssql-python


Diff Coverage

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

No lines with coverage information in this diff.


📋 Files Needing Attention

📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.logger_bridge.hpp: 58.8%
mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.row.py: 66.2%
mssql_python.pybind.ddbc_bindings.cpp: 69.4%
mssql_python.pybind.ddbc_bindings.h: 69.7%
mssql_python.pybind.connection.connection.cpp: 73.6%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 79.6%
mssql_python.connection.py: 84.1%
mssql_python.cursor.py: 84.7%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

@codexterous
Copy link

It seems this lacks build support for FreeBSD, which would be necessary for my organization to use this project.

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

Labels

pr-size: large Substantial code update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants