You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Github action to install python in all flavours of amazon linux
2
+
3
+
Github action to install python in all flavours of amazon linux. The goal of this action is to be a drop in replacement
4
+
for the github's official [setup-python action](https://github.com/actions/setup-python) to the maximum extent possible.
5
+
6
+
## Why?
7
+
8
+
- This project exist because as of Nov 2023 [Github has no plans support amazon linux](https://github.com/actions/setup-python/issues/460#issuecomment-1185723652) for its official
9
+
[setup-python](https://github.com/actions/setup-python) action for amazon linux self hosted runners.
10
+
11
+
## Implementation caveat
12
+
13
+
This action compiles the desired version of python from source for the first time because the glibc version in use in
14
+
amazon linux 2 is very old (2.26) and the pre-made existing binary distributions fail with the following error
15
+
16
+
```yaml
17
+
python: /lib64/libc.so.6: version `GLIBC_2.27' not found
18
+
python: /lib64/libc.so.6: version `GLIBC_2.28' not found
19
+
```
20
+
21
+
Hence only for the first time this action may like 3 to 4 minutes depending on the runner configuration. Post this only cache
22
+
will be used and hence will be very fast (4 to 5 seconds)
23
+
24
+
## Supported amazon linux flavours
25
+
26
+
- Amazon Linux 2
27
+
- Amazon Linux 2023
28
+
29
+
If you need support for more kindly raise an issue or a PR
30
+
31
+
## Usage
32
+
33
+
All you have to do is change "setup-python" to "setup-python-amazon-linux" in your workflows
34
+
35
+
```yaml
36
+
steps:
37
+
- uses: actions/checkout@v3
38
+
- uses: actions/setup-python-amazon-linux@v1
39
+
with:
40
+
python-version: '3.10'
41
+
- run: python my_script.py
42
+
```
43
+
44
+
For more options to the action, kindly refer [action.yml](./action.yml)
0 commit comments