Skip to content

Conversation

@adilhusain-s
Copy link
Collaborator

Add comprehensive tests and CI workflow for Python versions and manifests

Summary

  • Purpose: Strengthen test coverage and CI to ensure Python versions, manifest models, and package compatibility remain stable across upgrades.
  • Scope: Adds extensive unit tests for manifest parsing and merging, Pydantic models, Typer and Requests API compatibility, and cross-module imports; introduces a GitHub Actions workflow to run tests on PRs.

Changes

  • Tests:
    • tests/test_models_and_manifest_tools.py: Adds comprehensive tests validating:
      • FileEntry and ManifestEntry creation, validation, model_dump, JSON schema generation, copying, and error handling.
      • manifest_fetch, manifest_merge, and update_version behaviors including unique/overlapping versions and duplicate file handling.
      • Integration flow: fetch → merge → update, ensuring expected final manifest state.
      • Edge cases in parsing version lists, sorting stable vs prerelease, handling missing/empty/invalid entries.
    • tests/test_package_compatibility.py: Verifies compatibility with minimum package versions:
      • requests >= 2.32.5: urlopen response attributes and error handling via fetch_json, get_nuget_versions.
      • typer >= 0.19.2: app creation, options, echo, exit, and command registration.
      • pydantic >= 2.11.7: BaseModel instantiation, field validation, JSON schema, serialization, optional fields, strict validation, and nested models.
    • Additional tests for get_python_version.PythonManifestParser covering latest version retrieval with prerelease filters, unmatched filters, and complex sorting scenarios.
  • CI:
    • Adds a GitHub Actions workflow to run the test suite on pushes/PRs, ensuring ongoing compatibility and preventing regressions.

Context

  • Addresses gaps in automated verification for Python version handling and manifest tools that interact with multiple external dependencies and scripts.
  • Ensures internal modules under .github/scripts and PowerShell remain importable and functionally compatible with pinned or minimum versions of third-party packages.

Commit History (branch-only)

  • 25d0fd1: Add/update powershell-gen tar for v7.5.2
  • fa7ad5a: Add GitHub Actions workflow for running tests
  • 4be49c6: Add comprehensive tests for Python version handling, models, and package compatibility

Impact

  • Increases confidence in manifest operations and version parsing across a wide range of edge cases.
  • Reduces risk of breakage from dependency updates to Requests, Typer, and Pydantic.
  • Provides immediate CI feedback for future changes.

Testing

  • New tests pass locally; CI workflow will run pytest on PR creation to validate across environments.

Risks

  • None identified; changes are additive (tests + workflow) and do not modify production code paths.

…age compatibility

- Implement tests for `get_python_version.py` to validate version detection, parsing, comparison, and filtering.
- Create tests for `models.py` and `manifest_tools.py` to ensure Pydantic models function correctly and handle various scenarios.
- Introduce package compatibility tests to verify that the project works with minimum required versions of requests, typer, and pydantic.
- Ensure that all tests cover edge cases and error handling for robust validation.

(cherry picked from commit 4be49c6)
Signed-off-by: Adilhusain Shaikh <[email protected]>
(cherry picked from commit fa7ad5a)
Signed-off-by: Adilhusain Shaikh <[email protected]>
Build failures were occurring due to pydantic-core (2.33.2) dependency failing to compile with Python 3.14. The underlying issue is that PyO3 v0.24.1 (Rust-Python interop library used by pydantic-core) only supports Python versions up to 3.13.

Changes:
- tests.yml: Changed python-version from '3.14' to '3.13'
- release-latest-python-tag.yml: Changed python-version from '3.x' to '3.13'
- merge-manifest.yml: Changed python-version from '3.x' to '3.13'

Error encountered:
  error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13)

This change ensures all workflows use a compatible Python version until pydantic-core/PyO3 adds Python 3.14 support.

Signed-off-by: Adilhusain Shaikh <[email protected]>
@adilhusain-s
Copy link
Collaborator Author

fix(ci): downgrade Python version from 3.14 to 3.13 in workflows                                                                 
                                                                                                                                 
Build failures were occurring due to pydantic-core (2.33.2) dependency failing to compile with Python 3.14. The underlying issue is that PyO3 v0.24.1 (Rust-Python interop library used by pydantic-core) only supports Python versions up to 3.13.                   
                                                                                                                                 
Changes:                                                                                                                         
- tests.yml: Changed python-version from '3.14' to '3.13'                                                                        
- release-latest-python-tag.yml: Changed python-version from '3.x' to '3.13'                                                     
- merge-manifest.yml: Changed python-version from '3.x' to '3.13'                                                                
                                                                                                                                 
Error encountered:                                                                                                               
  error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13)                  
                                                                                                                                 
This change ensures all workflows use a compatible Python version until pydantic-core/PyO3 adds Python 3.14 support.             

@mtarsel mtarsel merged commit 3a7da29 into main Dec 18, 2025
3 checks passed
@adilhusain-s adilhusain-s deleted the test-signed branch December 24, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants