Skip to content

Update to latest supported python versions#190

Open
mvaught02 wants to merge 4 commits intopython-hyper:masterfrom
mvaught02:uplift
Open

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

Conversation

@mvaught02
Copy link

@mvaught02 mvaught02 commented Feb 26, 2026

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+

@mvaught02
Copy link
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

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.

1 participant