Skip to content

Drop Python 3.9 and 3.10 support - #2074

Merged
syssi merged 1 commit into
rytilahti:masterfrom
syssi:drop-python-eol
Jun 27, 2026
Merged

Drop Python 3.9 and 3.10 support#2074
syssi merged 1 commit into
rytilahti:masterfrom
syssi:drop-python-eol

Conversation

@syssi

@syssi syssi commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Bumps minimum Python version from 3.9 to 3.11 in pyproject.toml
  • Adds Python 3.11/3.12/3.13 classifiers
  • Removes Python 3.9 and 3.10 from the CI test matrix
  • Updates ReadTheDocs build to Python 3.12 and Ubuntu 22.04 (20.04 is EOL)
  • Enables the ruff linter (UP + F401 rules) in pre-commit and fixes a duplicate repos: key bug in .pre-commit-config.yaml
  • Updates pyupgrade target to --py311-plus
  • Removes sys.version_info >= (3, 11) guards in miot_device.py
  • Fixes a Python 3.13 TypeError in descriptors.py by adding from __future__ import annotations (attrs was resolving type | None in class scope where the field named type already holds None)
  • Applies ruff auto-fixes across 79 files: Optional[X] to X | None, Union[X, Y] to X | Y, deprecated typing imports, and %-style format strings to f-strings
  • Updates poetry.lock

Test plan

  • CI passes on Python 3.11, 3.12, 3.13
  • Pre-commit hooks run clean with the new ruff linter config
  • ReadTheDocs build succeeds on Ubuntu 22.04 / Python 3.12

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.60606% with 96 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.28%. Comparing base (0bd7f27) to head (04304a9).

Files with missing lines Patch % Lines
miio/integrations/roborock/vacuum/vacuum_cli.py 0.00% 46 Missing ⚠️
miio/devtools/simulators/miiosimulator.py 0.00% 10 Missing ⚠️
miio/integrations/roborock/vacuum/vacuum.py 61.53% 5 Missing ⚠️
miio/click_common.py 42.85% 4 Missing ⚠️
miio/integrations/lumi/camera/aqaracamera.py 0.00% 4 Missing ⚠️
miio/integrations/lumi/gateway/light.py 0.00% 4 Missing ⚠️
miio/updater.py 0.00% 4 Missing ⚠️
...o/integrations/roborock/vacuum/vacuumcontainers.py 87.50% 3 Missing ⚠️
miio/devtools/simulators/miotsimulator.py 0.00% 2 Missing ⚠️
miio/integrations/chunmi/cooker/cooker.py 77.77% 2 Missing ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2074      +/-   ##
==========================================
+ Coverage   83.22%   83.28%   +0.05%     
==========================================
  Files         198      198              
  Lines       19450    19417      -33     
  Branches     1058     1056       -2     
==========================================
- Hits        16188    16172      -16     
+ Misses       3079     3063      -16     
+ Partials      183      182       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@syssi
syssi force-pushed the drop-python-eol branch from 76ca2ff to 987c0e5 Compare June 27, 2026 12:07
- Bump minimum Python version to 3.11 in pyproject.toml
- Add Python 3.11/3.12/3.13 classifiers
- Remove 3.9 and 3.10 from CI test matrix
- Update ReadTheDocs to Python 3.12 and Ubuntu 22.04
- Enable ruff linter (UP + F401 rules) in pre-commit; fix duplicate repos key
- Update pyupgrade to --py311-plus
- Remove sys.version_info >= (3, 11) guards in miot_device.py
- Add from __future__ import annotations to descriptors.py to fix
  Python 3.13 TypeError caused by attrs resolving 'type | None' in
  class scope where the field named 'type' already holds None
- Auto-apply ruff UP fixes across 79 files: Optional[X] to X | None,
  Union[X, Y] to X | Y, deprecated typing imports, % format strings
  to f-strings
- Update poetry.lock
@syssi
syssi force-pushed the drop-python-eol branch from 987c0e5 to 04304a9 Compare June 27, 2026 12:08
@syssi
syssi requested a review from rytilahti June 27, 2026 12:22

@rytilahti rytilahti left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see these clean ups, thank you!

@rytilahti

Copy link
Copy Markdown
Owner

After getting this merged, maybe also bump all pre commit versions? Or if you prefer, maybe it can be done as part of this to get all the formatting changes in in a single PR?

@syssi
syssi merged commit c6a58f0 into rytilahti:master Jun 27, 2026
13 of 14 checks passed
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