FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update to latest supported python versions by mvaught02 · Pull Request #190 · python-hyper/hyperlink · GitHub

Update to latest supported python versions - #190

Open
mvaught02 wants to merge 5 commits into
python-hyper:masterfrom
mvaught02:uplift
Open

Update to latest supported python versions#190
mvaught02 wants to merge 5 commits into
python-hyper:masterfrom
mvaught02:uplift

Conversation

mvaught02 commented Feb 26, 2026
edited
Loading

Copy link
Copy Markdown

Addresses #185 and uplift discussion from #189

Summary of Changes:

  • Drop Python 2 Support: Removed all Python 2 compatibility code (six, future imports related to py2, PY2 conditionals, unicode vs str logic).
  • Modernize Type Hints: Converted comment-based type hints to inline Python 3 type hints across the codebase.
  • Updated Imports: Moved typing-only imports to if TYPE_CHECKING: blocks and used from future import annotations to avoid runtime overhead and circular imports as well as appease the latest lint rules.
  • Update Supported Versions: Updated setup.py, tox.ini, and docs/index.rst to support Python 3.10–3.14. Removed pypy (python2) from default test envs.
  • Remove Legacy Code: Deleted src/hyperlink/_socket.py (ctypes fallback for inet_pton) and src/hyperlink/test/test_socket.py.
  • Fix Hypothesis Strategy: Fixed a bug in hostname_labels strategy where generated IDNs could exceed the maximum allowed length in Punycode, causing test failures.

Open questions...

do we want to go further back to older python versions? doing so will require using containers to get old python versions (github actions only supports 3.10-3.14) but if we want to take this further back from a test perspective we could if thats critical from a code perspective i think this would work all the way back to 3.7+

Copy link
Copy Markdown
Author

@glyph sorry it took me a little bit to get back to this but went ahead and did a separate PR and just did the uplift and the py2 stuff here

glyph left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This all looks good to me. In the future, though, please submit smaller PRs, so there's less code to look at in one big pile. Luckily most of these changes are mechanical so it wasn't that bad though — hopefully I didn't miss anything sneakily hiding in between the obvious Text → str replacements 😅

glyph commented May 16, 2026

Copy link
Copy Markdown
Collaborator

sigh, looks like we need to upgrade upload-artifact for this to work

Copy link
Copy Markdown
Author

This all looks good to me. In the future, though, please submit smaller PRs, so there's less code to look at in one big pile. Luckily most of these changes are mechanical so it wasn't that bad though — hopefully I didn't miss anything sneakily hiding in between the obvious Text → str replacements 😅

Yes I'm sorry it was larger than I had wanted there was not a good way to break this up that I had seen originally. 😅

Copy link
Copy Markdown
Author

sigh, looks like we need to upgrade upload-artifact for this to work

I'll check this here shortly and get it updated.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL