Skip to content

Commit a7b8143

Browse files
committed
Drop support for CPython < 3.7 and change guarantees
1 parent 429b7de commit a7b8143

2 files changed

Lines changed: 13 additions & 33 deletions

File tree

.github/scripts/create_python_matrix.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
short_tag = tag.name.replace('v', '')
1919
while short_tag.count('.') > 1:
2020
short_tag = short_tag[:-1]
21-
if float(short_tag) >= 2.7 and short_tag not in json_dict['python-version']:
21+
splits = short_tag.split('.')
22+
major = int(splits[0])
23+
minor = int(splits[1])
24+
if major == 3 and minor >= 7 and short_tag not in json_dict['python-version']:
2225
json_dict['python-version'].append(short_tag)
2326

2427
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:

README.md

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ This action wraps around [actions/setup-python](https://github.com/actions/setup
1313
- [Table of contents](#table-of-contents)
1414
- [Basic usage](#basic-usage)
1515
- [Motivation](#motivation)
16-
- [But why? It's deprecated: just use a more recent version](#but-why-its-deprecated-just-use-a-more-recent-version)
17-
- [But why a dedicated action? Just use `ubuntu-20.04` for that 1 job](#but-why-a-dedicated-action-just-use-ubuntu-2004-for-that-1-job)
1816
- [Guarantees](#guarantees)
1917
- [Known limits](#known-limits)
2018
- [Performance](#performance)
@@ -23,6 +21,7 @@ This action wraps around [actions/setup-python](https://github.com/actions/setup
2321
- [allow-build input](#allow-build-input)
2422
- [Outputs](#outputs)
2523
- [FAQ](#faq)
24+
- [No file in (...) matched to \[\*\*/requirements.txt or \*\*/pyproject.toml\], make sure you have checked out the target repository](#no-file-in--matched-to-requirementstxt-or-pyprojecttoml-make-sure-you-have-checked-out-the-target-repository)
2625
- [Contributing](#contributing)
2726

2827
## Basic usage
@@ -33,54 +32,32 @@ In general you could replace the original action with this one and it should alr
3332
```yaml
3433
- uses: MatteoH2O1999/setup-python@v3
3534
with:
36-
python-version: '3.6'
35+
python-version: '3.8'
3736
```
3837
3938
But if you wish for a more optimized experience you could use inputs exclusive to this action:
4039
4140
```yaml
4241
- uses: MatteoH2O1999/setup-python@v3
4342
with:
44-
python-version: '3.6'
43+
python-version: '3.8'
4544
allow-build: info
4645
cache-build: true
4746
cache: pip
4847
```
4948
5049
## Motivation
5150
52-
Since the replacement of `ubuntu-20.04` with `ubuntu-22.04` runner images [actions/setup-python](https://github.com/actions/setup-python) no longer supports `Python 3.6` for the `ubuntu-latest` label.
53-
This broke a large number of pipelines as Python 3.6 is still widely used.
51+
While initially this action was meant to guarantee a successful build of all CPython versions `2.7`, it has now become too complex to maintain it.
5452

55-
This made apparent that a way to support deprecated versions was needed.
56-
57-
### But why? It's deprecated: just use a more recent version
58-
59-
Yes, in a perfect world that would be the go to solution.
60-
Unfortunately, we do not live in that world, so we can't always choose our dependencies.
61-
In fact, I would be willing to bet that most deprecated dependencies are there despite the developers, not because of them.
62-
That is why this action came about: to offer an easier way to continue supporting deprecated builds even if github does not anymore.
63-
64-
### But why a dedicated action? Just use `ubuntu-20.04` for that 1 job
65-
66-
Once again, that is possible, but that is
67-
68-
1. not good practice as editing the main job matrix will not edit the "special" one;
69-
2. a pain to maintain as each new deprecated version needs another job to be created.
53+
The new objective of this action is to provide a buffer when something gets yanked out by Github, as this will guarantee that if the pair `(label, version)` works, it will keep working.
54+
Older versions may still work, but no effort will be spent in ensuring so.
7055

7156
## Guarantees
7257

73-
The objective of this action is to guarantee that for every major Python version starting from `2.7` at least one specific version can be successfully installed on the `...-latest` images using the default architecture.
74-
75-
TLDR: If you use the major version specification (`3.6` instead of `3.6.5`) without specifying the architecture as shown in [Basic usage](#basic-usage) this action is guaranteed to work (hopefully...😉) on all the `...-latest` labels.
76-
77-
### Exceptions
58+
The objective of this action is to guarantee that for every major Python version starting from `3.7` at least one specific version can be successfully installed on the `...-latest` images using the default architecture.
7859

79-
Python versions < 3.5 are too difficult to build from source on Windows.
80-
For these versions the action tries to use the official installer from [python.org](https://www.python.org/ftp/python).
81-
If this fails, the action fails with an appropriate error message.
82-
In this case you should request a version for which [python.org](https://www.python.org/ftp/python) offers a binary installer, and not just the source code.
83-
On the positive side, every version of Python 2.7 has a binary installer so it shouldn't be a problem.
60+
TLDR: If you use the major version specification (`3.7` instead of `3.7.5`) without specifying the architecture as shown in [Basic usage](#basic-usage) this action is guaranteed to work (hopefully...😉) on all the `...-latest` labels.
8461

8562
## Known limits
8663

@@ -159,7 +136,7 @@ This action will emit the following outputs:
159136

160137
## FAQ
161138

162-
#### No file in (...) matched to [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository
139+
### No file in (...) matched to [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository
163140

164141
This is a byproduct of [actions/setup-python](https://github.com/actions/setup-python).
165142
If you wish to cache your pip dependencies, you need to have anywhere in your repository a `requirements.txt` or a `pyproject.toml` file.

0 commit comments

Comments
 (0)