Skip to content

FEAT: Pytests for Dependencies#139

Merged
bewithgaurav merged 3 commits intomainfrom
bewithgaurav/pytesting_dependencies
Jul 17, 2025
Merged

FEAT: Pytests for Dependencies#139
bewithgaurav merged 3 commits intomainfrom
bewithgaurav/pytesting_dependencies

Conversation

@bewithgaurav
Copy link
Copy Markdown
Collaborator

@bewithgaurav bewithgaurav commented Jul 16, 2025

ADO Work Item Reference

AB#37995


Summary

This pull request introduces significant updates to the mssql_python package, focusing on architecture-specific dependency handling, documentation improvements, and comprehensive testing. Key changes include enhancements to the README for better clarity on platform-specific builds, removal of unused imports, and the addition of a new test file to validate dependencies across platforms.

Documentation Updates:

  • mssql_python/pybind/README.md: Expanded documentation to include platform-specific architecture handling, runtime loading mechanisms, and dependency summaries for Windows, macOS, and Linux. Added detailed directory structure and naming conventions for Python extension modules. [1] [2] [3]

Code Cleanup:

  • tests/conftest.py: Removed unused ddbc_bindings import to streamline the test configuration file.

Testing Enhancements:

  • tests/test_000_dependencies.py: Added a new test file to validate platform-specific dependencies, architecture normalization, and runtime compatibility. Includes helper functions for detecting Linux distributions and verifying dependency files and Python extension modules.

Copilot AI review requested due to automatic review settings July 16, 2025 06:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 comprehensive pytest coverage for platform-specific dependencies, cleans up unused imports, and expands the pybind README with architecture and dependency details.

  • Introduce tests/test_000_dependencies.py to validate platform detection, dependency files, extension loading, and runtime compatibility.
  • Remove unused ddbc_bindings import from tests/conftest.py.
  • Enhance mssql_python/pybind/README.md with key architecture handling and a detailed dependency directory structure.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_000_dependencies.py New end-to-end tests for dependency presence, sizes, and imports
tests/conftest.py Removed unused ddbc_bindings import
mssql_python/pybind/README.md Expanded with architecture normalization, build summaries, and dependency matrix
Comments suppressed due to low confidence (3)

tests/test_000_dependencies.py:270

  • This test only asserts the presence of the Linux distribution directory. To fully validate dependencies, extend it to check for the expected .so files within the lib subdirectory for each architecture.
        distro_path = dependency_tester.module_dir / "libs" / "linux" / distro_name

mssql_python/pybind/README.md:85

  • There's currently no section covering build instructions on Linux. Consider adding a "## Building on Linux" section with distribution-aware CMake commands and path setup to guide developers through Linux builds.
## Architecture Dependencies Summary

tests/test_000_dependencies.py:336

  • The pytest_runtest_setup hook compares item.name directly to "test_platform_detection", but pytest may include the class name or different naming conventions. Use item.originalname or item.name.startswith("test_platform_detection") for a more reliable match.
    if item.name == "test_platform_detection":

Comment thread tests/test_000_dependencies.py
@github-actions github-actions Bot added pr-size: medium Moderate update size labels Jul 16, 2025
@github-actions github-actions Bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Jul 17, 2025
@github-actions github-actions Bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Jul 17, 2025
@bewithgaurav bewithgaurav merged commit 2dac682 into main Jul 17, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants