-
Notifications
You must be signed in to change notification settings - Fork 8
Add notes regarding Python EOL #34
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f53caa3
add notes regarding python EOL
akaszynski 8beecde
Apply suggestions from code review
akaszynski 5cad2c3
add notes regarding dropping python support; fix link
akaszynski c14f9c7
improve readability
akaszynski 287c237
Apply suggestions from code review
akaszynski b919277
Update doc/source/guidelines/version_support.rst
akaszynski 8cbd730
Merge branch 'main' into docs/add_python_eol
akaszynski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Python Version Support | ||
====================== | ||
|
||
When creating Python libraries, plan on supporting the oldest actively supported | ||
version of Python. For a quick reference, visit `Status of Python Branches | ||
<https://devguide.python.org/#status-of-python-branches>`_. Here is a summary as | ||
of 2022: | ||
|
||
+---------+-------------+-----------------------+ | ||
| Version | Released | Security Support Ends | | ||
+---------+-------------+-----------------------+ | ||
| 3.10 | 04 Oct 2021 | 04 Oct 2026 | | ||
+---------+-------------+-----------------------+ | ||
| 3.9 | 05 Oct 2020 | 05 Oct 2025 | | ||
+---------+-------------+-----------------------+ | ||
| 3.8 | 14 Oct 2019 | 14 Oct 2024 | | ||
+---------+-------------+-----------------------+ | ||
| 3.7 | 27 Jun 2018 | 27 Jun 2023 | | ||
+---------+-------------+-----------------------+ | ||
|
||
Expect these to be the most commonly used Python versions. Note that some | ||
libraries like `NumPy <https://numpy.org/>`_ drop support for older versions of | ||
Python earlier than their end of life (EOL) as outlined in `NEP 29 | ||
<https://numpy.org/neps/nep-0029-deprecation_policy.html#support-table>`_. | ||
|
||
Realize that users can still install the older version from PyPI via ``pip`` as | ||
the package manager (``pip``). When ``pip`` is used, it downloads and installs the most recent version | ||
of THE library that supports your version of Python. You can enforce a minimum- | ||
required Python version within ``setup.py`` with: | ||
|
||
.. code:: python | ||
|
||
from setuptools import setup | ||
|
||
[...] | ||
|
||
setup(name="my_package_name", | ||
python_requires='>3.6', | ||
[...] | ||
) | ||
|
||
This helps ``pip`` to know which versions of your library | ||
support which versions of Python. You can also impose an upper limit if you're | ||
sure you don't support certain versions of Python. For example, if you only | ||
support Python 3.6 through 3.9: ``python_requires='>=3.6, <3.10'``. | ||
|
||
|
||
Verifying Support | ||
----------------- | ||
The best way to validate whether a Python library supports a version of | ||
Python is to validate it via unit testing within CI/CD. An example | ||
GitHub workflow testing Python 3.6 through Python 3.10 on Windows and Linux | ||
would would start with:: | ||
|
||
jobs: | ||
unittest: | ||
name: Unit Testing | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest] | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Unit testing | ||
run: | | ||
... | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.