Skip to content

feat: Add Python 3.7 Support and Restore Compatibility with Older Syntax #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 17, 2025

Conversation

filipchristiansen
Copy link
Contributor

Summary

  • Commit 1: Added Python 3.9 support by:

    • Falling back to ParamSpec from typing_extensions instead of the standard typing module.
    • Refactoring match statements introduced in Python 3.10, reverting them to if/elif blocks for compatibility.
  • Commit 2: Extended support further down to Python 3.7 by:

    • Eliminating usage of the walrus operator (:=).
    • Replacing inline generics (e.g., list[str], dict[str, Any]) with the older List[str], Dict[str, Any] style.
    • Updating the required Python version in pyproject.toml and setup.py to >=3.7.
    • Relaxing certain pre-commit checks so that PyUpgrade and others won’t break 3.7 compatibility again.

Details

  1. CI Updates: The GitHub Actions matrix now runs tests on Python 3.7, 3.8, 3.9, and all the way up through 3.13, ensuring broad coverage.
  2. Documentation: Updated README.md and package classifiers to reflect Python 3.7+ support.
  3. No API or Behavior Changes: All modifications are syntax-only to ensure older Python versions can parse and execute the code.

@filipchristiansen filipchristiansen force-pushed the feature/py37-support branch 11 times, most recently from fb19545 to 3a9036e Compare February 17, 2025 10:11
@cyclotruc cyclotruc merged commit 4397a45 into main Feb 17, 2025
18 checks passed
@filipchristiansen filipchristiansen deleted the feature/py37-support branch February 17, 2025 18:15
filipchristiansen added a commit that referenced this pull request Mar 13, 2025
…tax (#181)

* Add Python 3.9 support by using ParamSpec from typing_extensions and removing match statements

* Add Python 3.7 support by reverting inline generics and removing walrus usage

* Update pyproject.toml
filipchristiansen added a commit that referenced this pull request Mar 13, 2025
…tax (#181)

* Add Python 3.9 support by using ParamSpec from typing_extensions and removing match statements

* Add Python 3.7 support by reverting inline generics and removing walrus usage

* Update pyproject.toml

Signed-off-by: Filip Christiansen <22807962+filipchristiansen@users.noreply.github.com>
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.

2 participants