Skip to content

Tracker for Supported Python versions #1295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sethmlarson opened this issue Jun 26, 2020 · 4 comments · Fixed by #1697
Closed

Tracker for Supported Python versions #1295

sethmlarson opened this issue Jun 26, 2020 · 4 comments · Fixed by #1697
Labels

Comments

@sethmlarson
Copy link
Contributor

sethmlarson commented Jun 26, 2020

Support Matrix for Python / Elastic Stack version

Version Download Percentage Currently Supported (7.x) Supported in Next Major (8.x)
2.7 10.72% X X?
3.4 0.07% X
3.5 1.22% X
3.6 28.95% X X
3.7+ 59.04% X X
3.x+ 89.28% X X

The column for "Supported in Next Major" is subject to change until feature freeze of the next major depending on usage.
Data was last updated from downloads for 2021-03-10

Process

Currently we support Python 2.7, and 3.4 onwards as of Elasticsearch v7.x.
Python versions will come out every year however the amount of changes between 3.x to 3.[x + 1] are much smaller than 2 to 3.

Here's the query being used to determine what Python versions should be supported in 8.x by looking at the split of downloads for 7.x:

SELECT
  SUBSTR(details.implementation.version, 1, 3) AS ver,
  COUNT(*) as dwn
FROM `the-psf.pypi.file_downloads`
WHERE
  DATE(timestamp) = "2021-04-22" AND
  file.project = 'elasticsearch' AND
  file.version = '7.12.0' AND 
  # Filter out PyPy versions
  SUBSTR(details.implementation.version, 1, 1) <= '3' AND (
  # Filter out Python 2.6 or earlier
    SUBSTR(details.implementation.version, 1, 1) != '2' OR
    SUBSTR(details.implementation.version, 1, 3) = '2.7'
  ) AND (
  # Filter out Python 3.3 or earlier
    SUBSTR(details.implementation.version, 1, 1) != '3' OR
    SUBSTR(details.implementation.version, 3, 3) >= '4'
  )
GROUP BY ver
ORDER BY dwn DESC

JSON results from Google BigQuery fed into this little script to quickly recalculate:

x = {tuple([int(p) for p in d["ver"].split(".")]): int(d["dwn"]) for d in x}
total = sum(x.values())
x['3.7+'] = sum([v for k, v in x.items() if k >= (3, 7)])
x['3.x+'] = sum([v for k, v in x.items() if isinstance(k, tuple) and k >= (3,)])
for k in list(x.keys()):
    if isinstance(k, tuple) and k >= (3, 7):
        x.pop(k)

for k, v in x.items():
    print(k, f"{v * 100.0 / total:.2f}%")
@sethmlarson
Copy link
Contributor Author

What we will gain from dropping each version:

  • Python 2.7: Python 2 is EOL as of Jan 1, 2020 and many libraries are starting to drop support. Our test suite currently doesn't need any bleeding edge new features but in the future it may.
  • Python 3.5: Python 3.6 added inline type hints, f-strings, and async/await. If we are able to make the library 3.6+ I don't see the need to drop Python versions for some time as most Python 3.x versions are very similar post-3.6.

@sethmlarson sethmlarson pinned this issue Jun 26, 2020
@sethmlarson
Copy link
Contributor Author

New data from v7.10.0 from December 1st, 2020:

Version Downloads Percent
2.7 5583 13.98%
3.4 37 0.09%
3.5 826 2.07%
3.6 13828 34.62%
3.7 12487 31.26%
3.8 6416 16.06%
3.9 758 1.89%
all 39935 100%

@sethmlarson sethmlarson added the 8.x label Mar 1, 2021
@sethmlarson
Copy link
Contributor Author

New data for v7.11.0 from March 9, 2021:

Version Percent
2.7 10.72%
3.x+ 89.28%
3.4 0.07%
3.5 1.22%
3.6 28.95%
3.7+ 59.04%

@sethmlarson
Copy link
Contributor Author

New data for v7.13.1 from June 16th 2021:

Version Percent
2.7 8.13%
3.x+ 91.87%
3.4 0.09%
3.5 1.89%
3.6 25.47%
3.7+ 64.43%

Python 2.7 is less than 10%!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant