Skip to content

Update Python support to 3.10+ - #198

Closed
tim-schilling wants to merge 6 commits into
linsomniac:masterfrom
tim-schilling:python-updates
Closed

Update Python support to 3.10+#198
tim-schilling wants to merge 6 commits into
linsomniac:masterfrom
tim-schilling:python-updates

Conversation

@tim-schilling

Copy link
Copy Markdown
Contributor
  • Drops support for Python 3.9 and below
  • Adds support for 3.14
  • Removes the backports and shims
  • Replaces nose for pytest for test runner

Sorry for the duplicate PR. I dropped the other change around setting a specific encoding as it seemed silly on re-review.

@timgraham

Copy link
Copy Markdown
Collaborator

Could you please send some of the clean up work as separate PRs? For example, I see Python 2 removals in the "Update Python support to 3.10+" commit. Also, PR checks have not run on this PR. I'm not sure if a change here broken them or if there's an existing issue.

str.format() calls replaced with f-strings.
socket.timeout is an alias of TimeoutError since Python 3.10.
In Python 2, IOError/OSError could be raised as a tuple (errno, message).
@tim-schilling

Copy link
Copy Markdown
Contributor Author

Hi @timgraham 👋 I think I've extracted out the modernizations from that commit. Though I disagree with you about splitting it up into multiple PRs. When the maintainer comes around, they can decide if they want to split things up or merge them all in one go. Hard to know what they'll want right now. I'm also happy to have someone else cherry-pick the commits or redo things. I was just trying to help things along.

As for why the tests aren't running, it's because the action is triggered on push and my PR would require pull_request, but mine wouldn't run without maintainer approval anyway.

@timgraham

Copy link
Copy Markdown
Collaborator

I have merge permissions on this repo. I don't see why tests shouldn't run on PRs, so I have proposed it in #199.

@timgraham

Copy link
Copy Markdown
Collaborator

I merged a couple of the commits. Some commits still mix concerns (e.g. "Update Python support to 3.10+" changes the test runner, addings Python 3.14, removes usage of get_module_constant (reason unclear), makes unrelated changes to tox.ini).

@tim-schilling

Copy link
Copy Markdown
Contributor Author

@timgraham Understood. I'm not going to have time to implement those changes. Happy to have you or someone else make those changes here or in a new PR.

Comment thread setup.py
Comment on lines +8 to +12
version = re.search(
r'^__version__ = ["\']([^"\']+)["\']',
open("memcache.py", encoding="utf-8").read(),
re.M,
).group(1)

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.

What's the reasoning for the change? Because get_module_constant() is an internal API?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The reasoning is that the LLM was probably overzealous in revising the code. Let me revert this one too. Thanks for catching it.

I don't believe we need to be worried about get_module_constant not being defined for Java backed pythons.

Comment thread tox.ini
[tox]
minversion = 1.6
envlist = py{36,37,38,39,310,311,312},pypy,pep8
envlist = py{310,311,312,313,314},pep8

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.

Why is pypy removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That looks like an oversight.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@timgraham I tracked it down. It wasn't running in CI so it didn't make sense to run locally.

@timgraham

Copy link
Copy Markdown
Collaborator

Thanks, I've merged most everything.

@timgraham timgraham closed this Aug 28, 2026
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