Skip to content

Remove "from __future__ import annotations"#51

Merged
ulgens merged 1 commit intomainfrom
remove-future-annotations
Mar 14, 2026
Merged

Remove "from __future__ import annotations"#51
ulgens merged 1 commit intomainfrom
remove-future-annotations

Conversation

@ulgens
Copy link
Copy Markdown
Owner

@ulgens ulgens commented Mar 14, 2026

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.

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.
Copy link
Copy Markdown

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

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 annotations from library modules and a related test file.
  • Dropped Ruff/isort required-imports configuration 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.

@ulgens ulgens merged commit 29ad320 into main Mar 14, 2026
11 checks passed
@ulgens ulgens deleted the remove-future-annotations branch March 14, 2026 16:05
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (4207cf3) to head (4c5fb73).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

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