Skip to content

Closes #855 Support Python 3.13 in the library#854

Merged
shirasassoon merged 47 commits intomicrosoft:mainfrom
shirasassoon:support_python_3_13
Mar 8, 2026
Merged

Closes #855 Support Python 3.13 in the library#854
shirasassoon merged 47 commits intomicrosoft:mainfrom
shirasassoon:support_python_3_13

Conversation

@shirasassoon
Copy link
Copy Markdown
Contributor

This pull request adds Python 3.13 support and updates type annotations throughout the codebase for better compatibility and clarity. The most significant changes include updating the supported Python versions in the project configuration and CI, and standardizing type hints to use Optional and Union for improved readability and future compatibility.

Python version support:

  • Updated pyproject.toml to support Python 3.13 by changing requires-python to >=3.9,<3.14 and adding the appropriate classifier. [1] [2]
  • Modified the GitHub Actions workflow (.github/workflows/test.yml) to run unit tests against Python 3.9 through 3.13 and updated the used action versions.

Type annotation improvements:

  • Refactored type hints across multiple modules to use Optional and Union instead of the Python 3.10+ syntax (|), improving compatibility and clarity. This includes changes in _common/_config_utils.py, _common/_config_validator.py, _common/_fabric_endpoint.py, and _common/_logging.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Shira Sassoon and others added 30 commits September 4, 2025 19:53
@shirasassoon shirasassoon changed the title Support python 3 13 Closes #855 Support Python 3.13 in the library Mar 8, 2026
@shirasassoon shirasassoon marked this pull request as ready for review March 8, 2026 07:23
Copilot AI review requested due to automatic review settings March 8, 2026 07:23
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 Python 3.13 support by updating the version requirement to >=3.9,<3.14 and fixing type annotations throughout the codebase that used PEP 604 union syntax (X | Y), which requires Python 3.10+. All such annotations are replaced with Optional[X] and Union[X, Y] from the typing module, ensuring backward compatibility with Python 3.9.

Changes:

  • Updated Python version range and classifier in pyproject.toml, and uv.lock with Python 3.13 dependency wheels
  • Updated CI workflow to test against Python 3.9–3.13 as a matrix and upgraded action versions to checkout@v4 / setup-python@v5
  • Replaced PEP 604 X | Y type annotation syntax with Optional[X]/Union[X, Y] in _config_utils.py, _config_validator.py, _fabric_endpoint.py, and _logging.py

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Bumps requires-python to <3.14 and adds Python 3.13 classifier
uv.lock Adds cp313 wheel entries for cffi, charset-normalizer, coverage, MarkupSafe, pywin32, PyYAML, regex, tomli, and watchdog
.github/workflows/test.yml Adds Python version matrix (3.9–3.13), upgrades actions/checkout to v4 and actions/setup-python to v5
src/fabric_cicd/_common/_config_utils.py Replaces str | list | bool | None return type with Optional[Union[str, list, bool]]
src/fabric_cicd/_common/_config_validator.py Replaces dict | list and str | dict parameter types with Union[dict, list] and Union[str, dict]
src/fabric_cicd/_common/_fabric_endpoint.py Replaces int | None and float | None parameter types with Optional[int] and Optional[float]
src/fabric_cicd/_common/_logging.py Replaces logging.FileHandler | RotatingFileHandler with Union[logging.FileHandler, RotatingFileHandler]
.changes/unreleased/optimization-20260308-092252.yaml Adds changelog entry for Python 3.13 support

Comment thread pyproject.toml Outdated
@shirasassoon shirasassoon merged commit a701d2a into microsoft:main Mar 8, 2026
13 checks passed
@shirasassoon shirasassoon deleted the support_python_3_13 branch March 8, 2026 11:14
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.

4 participants