Remove "from __future__ import annotations"#51
Conversation
This feature doesn't seem to be useful with Python 3.12+. It seems the feature itself already became obsolote with Python 3.14: https://www.reddit.com/r/learnpython/comments/1psteqc/comment/nvc6aku/ I'm not going to say I fully understand the effects of the removal, but so far it doesn't break anything and I don't see any reason to keep it in place, and enforce as default. Can be revisited in case of a problem. Another +1 for the removal: Having it enforced results with it being inserted in code snippets in the docs too. This can be handled with an exemption config, but I'll prefer removing it for the reasons I just explained.
There was a problem hiding this comment.
Pull request overview
Removes the enforced from __future__ import annotations across the package and updates lint configuration accordingly, aligning the codebase with the project’s Python 3.12+ baseline and avoiding the import being auto-inserted into documentation snippets.
Changes:
- Removed
from __future__ import annotationsfrom library modules and a related test file. - Dropped Ruff/isort
required-importsconfiguration that enforced the future import.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ruffen_docs.py | Removes the future import from the test module. |
| src/ruffen_docs/regex_patterns.py | Removes the future import from regex pattern definitions module. |
| src/ruffen_docs/processors.py | Removes the future import from core processing logic module. |
| src/ruffen_docs/errors.py | Removes the future import from error type module. |
| src/ruffen_docs/constants.py | Removes the future import from constants module. |
| src/ruffen_docs/main.py | Removes the future import from CLI entrypoint module. |
| src/ruffen_docs/init.py | Removes the future import from public API module. |
| ruff.toml | Removes isort.required-imports that enforced the future import. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 583 576 -7
Branches 31 31
=========================================
- Hits 583 576 -7 ☔ View full report in Codecov by Sentry. |
This feature doesn't seem to be useful with Python 3.12+. It seems the feature itself already became obsolote with Python 3.14: https://www.reddit.com/r/learnpython/comments/1psteqc/comment/nvc6aku/
I'm not going to say I fully understand the effects of the removal, but so far it doesn't break anything and I don't see any reason to keep it in place, and enforce as default. Can be revisited in case of a problem.
Another +1 for the removal: Having it enforced results with it being inserted in code snippets in the docs too. This can be handled with an exemption config, but I'll prefer removing it for the reasons I just explained.