elastic / elasticsearch-py

Official Python client for Elasticsearch
https://ela.st/es-python
Apache License 2.0
4.22k stars 1.18k forks source link

Drop Python 3.7 support #2561

Closed kloczek closed 2 months ago

kloczek commented 4 months ago

According to https://endoflife.date/python 3.7 has been EOSed almost year ag. Filter all code over pyupgrade --py38-plus.

cla-checker-service[bot] commented 4 months ago

💚 CLA has been signed

github-actions[bot] commented 4 months ago

A documentation preview will be available soon.

Request a new doc build by commenting * Rebuild this PR: `run docs-build` * Rebuild this PR and all Elastic docs: `run docs-build rebuild` `run docs-build` is much faster than `run docs-build rebuild`. A `rebuild` should only be needed in rare situations. If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status [here](https://buildkite.com/elastic/docs-build).
kloczek commented 4 months ago

CLA signed

pquentin commented 2 months ago

buildkite test this please

pquentin commented 2 months ago

@miguelgrinberg In my experience running pyupgrade and making various code changes as part of dropping a Python version is pretty common. For example, in urllib3:

Admittedly, some of the changes here are not only related to Python 3.7, so I can open a pull request to run pyupgrade --py37-plus before merging this if you prefer.

miguelgrinberg commented 2 months ago

@pquentin No need to change anything, this is fine. I think this is just that I'm used to handle Python version upgrades differently. My assumption when I saw "Drop 3.7" was that we would just stop testing 3.7, which is what I do for my personal projects (because I intentionally want to let people continue using the dropped version even after I stopped testing it or supporting it). Your meaning of "Drop 3.7" is larger in scope than mine. :)

pquentin commented 2 months ago

Ah right! When I drop a version, I update python_requires, so anyone still using Python 3.7 will be stuck on 8.14. And it's the best moment to drop all the workarounds that were need for previous versions. In the early 3.x days, many changes were related to the ssl module, and now it's mostly typing.

That said your approach could help me for 7.17.