Skip to content
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

python2.7 will be removed from the python-versions on June 19 #672

Closed
dmitry-shibanov opened this issue May 23, 2023 · 40 comments
Closed

python2.7 will be removed from the python-versions on June 19 #672

dmitry-shibanov opened this issue May 23, 2023 · 40 comments

Comments

@dmitry-shibanov
Copy link
Contributor

Breaking changes

Hello everyone. The Python 2.7.x will be removed from python-versions and it won't be possible to set up Python 2.7.x by setup-python.

The motivation for the changes

Python2.7 is not supported since January 1, 2020.

@rtibbles
Copy link

Hi @dmitry-shibanov - do you have any recommended ways to mitigate this for those of us that cannot remove usage of Python 2.7 from our Github Actions before the June 19th deadline?

@bernhardkaindl
Copy link

bernhardkaindl commented May 30, 2023

@dmitry-shibanov

It has already been delayed.

@konradpabjan I hope this can be cancelled like the previous times. I think there will be customer backslash again which would not be justified.

There is no point in removing it.

Linux Distros like Ubuntu 20.04 which contain Python2.7 support Python 2.7 for many many years to come. Canonical will maintain it until April 2025, and it will have emergency security updates in 20.04 until April 2030. Similar for Red Hat and SUSE.

@boegel
Copy link

boegel commented Jun 1, 2023

We started hitting this today already (1 June 2023), leading to:

Error: Version 2.7 with arch x64 not found

Support for Python 2.7 is deprecated in our project already, so we'll just stop testing on top of Python 2.7 and not lose sleep over it, but it would be nice if there's a documented/recommended alternative for people that do still want to keep testing on top of Python 2.7 in the near future.

@hugovk
Copy link
Contributor

hugovk commented Jun 1, 2023

There's a community-maintained Dockerfile in the works: actions/runner-images#7401 (comment)

mathiascode added a commit to tinytag/tinytag that referenced this issue Jun 2, 2023
Python 2.7 will not be supported by GitHub Actions any longer: actions/setup-python#672

We can continue using PyPy 2.7 to test Python 2 until we drop support in tinytag 2.0.0.
@tzortzispanagiotis
Copy link

Guys, do we have a suggested workaround? This is a huge deal for us - whole project depends on python 2 so we would not be able to deploy anything. If anyone has an idea, please help :)

@tzortzispanagiotis
Copy link

To anyone concerned:
You can continue using github-hosted runners with python2.7 by running the job inside a container.
e.g. I used python:2.7-buster image and everything works out just fine.

No need to use setup-python or be dependent of runner-images anymore.

@MatteoH2O1999
Copy link

MatteoH2O1999 commented Jun 8, 2023

If you don't need 2.7 for windows, you could use my custom action MatteoH2O1999/setup-python.
This action tries to build from source all Python versions that actions/setup-python does not support.
It also allows to cache built versions so that after the first run, installation time is really low.
For an example of a run see this workflow.

Windows support is in the works but no ETA (note that for Windows it will still allow for versions that are supported by 'actions/setup-python' to successfully complete).

@dimitrisr
Copy link

To anyone concerned: You can continue using github-hosted runners with python2.7 by running the job inside a container. e.g. I used python:2.7-buster image and everything works out just fine.

Hello @tzortzispanagiotis, could you please provide an example for this? 🙏

Thanks in advance.

@tzortzispanagiotis
Copy link

Hello @dimitrisr,

In order to overcome this I modified:

runs-on: ubuntu-20.04

to

runs-on: ubuntu-20.04
    container:
      image: python:2.7.18-buster

So that the job is run using a github-hosted runner, but inside the python2.7-buster container, which has set up python2.7

Then I started running the pipeline and started fixing everything that was broken (because the container does not have things as sudo, so you have to install it with a command)

Also, If your CI pipeline has other services (e.g. mysql) that run inside a container, now that the whole job is running inside a container, the service container is accessible not through localhost (127.0.0.1), but through the service name.

I hope I was helpful!

@dimitrisr
Copy link

Thank you @tzortzispanagiotis, this was really helpful! I was able to run the actions successfully :)

@bernhardkaindl
Copy link

Yeah but it still misses the point: why should Github go out of their way to make sure that something that worked before does not work anymore, while they could have simply added a warning "Hey, Python 2 is deprecated and you should not rely on it. If it works great, if it doesn't too bad, you're on your own"?

Once again, not arguing that Python 2 isn't deprecated, it obviously is, but saying that this is a nice way to sunset anything more than a university project is not really a great flag regarding Github's likeliness of following THEIR OWN GUIDELINES on versioning in the future.

@MatteoH2O1999: To me, it looks like GitHub is under the influence of a very vocal Python Core developer who simply declared in essence that he is not going to maintain Python 2.7 for being too much work.

Told him in a comment somewhere here on GitHub that I did not see anything that would backup his claims and that simply not removing Python2 would not cost him anything, but he still pressed on and did not answer any of my stipulations that it's not an issue to still provide it as it is, is just fine.

I could not these comments quickly, but at least as far as public comments on GitHub, I could only find this single guy taking a public stance, but this guy was at least verbally nuking it.

jwilk added a commit to jwilk/python-syntax-errors that referenced this issue Jan 26, 2024
Fixes:

    ##[warning]The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    ##[error]The version '2.7' with architecture 'x64' was not found for Ubuntu 20.04.
dpp-name added a commit to dpp-name/python-mammoth that referenced this issue Feb 5, 2024
@JamesParrott
Copy link

https://github.com/LizardByte/setup-python-action

That works great, and on windows runner images too (unlike my docker suggestion). Thanks so much @ReenigneArcher & @LizardByte!

yuangezhizao added a commit to yuangezhizao/yabgp that referenced this issue Mar 6, 2024
zlpqingmei pushed a commit to smartbgp/yabgp that referenced this issue Mar 6, 2024
…in BGP UPDATE Message (#167)

* 🎨 Style(__init__.py): replace "Sid" with "SID"

* ✨ Feat(bgpprefixsid.py): add support for parsing the Path Attribute: BGP Prefix-SID (Type 40)

Refer:
https://github.com/Exa-Networks/exabgp/blob/main/src/exabgp/bgp/message/update/attribute/sr/prefixsid.py

* ✅ Test(test_bgpprefixsid.py): add unittest and format result

* 💚 Fix-ci(ci.yml): remove Python 2.7.x from the CI matrix
Refer: actions/setup-python#672

* 🔥 Prune(.travis.yml): remove Travis CI
ekalinin pushed a commit to ekalinin/nodeenv that referenced this issue May 28, 2024
* workflows: add a workflow_dispatch trigger to start workflows manually

To be able to manually run a workflow from the Github web interface, add
a workflow_dispatch trigger.

Note that this does only work once this change has hit the default
branch.

* workflow: remove python 2.7 testing

Python 2.7 is long obsolete, deprecated and not supported any more.
Remove it from the tests. This test job is especially supposed to run on
ubuntu-20.04, which doesn't have Python 2.7 any more.

Without this patch, this workflow fails with:

  Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
  Version 2.7 was not found in the local cache
  Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 20.04.
  The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

* setup.py: ignore flake8 warning about module import at top of file

Flake8 is unhappy with us because we violate PEP8:

rsc@leda:~/git/nodeenv$ flake8 --extend-ignore=E127 nodeenv.py tests setup.py
setup.py:16:1: E402 module level import not at top of file

Ignore this warning in this case.

* nodeenv.py: do not compare types

According to this flake8 error:

(env) rsc@leda:~/git/nodeenv$ flake8 --extend-ignore=E127 nodeenv.py tests setup.py
nodeenv.py:421:19: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`

we should not compare types but use isinstance() instead, which can
handle subclasses as well.

See https://www.flake8rules.com/rules/E721.html for details.
benmwebb added a commit to salilab/mist that referenced this issue Jun 18, 2024
GitHub Actions no longer supports Python 2.7
as per actions/setup-python#672.
bfontaine added a commit to swaroopch/edn_format that referenced this issue Jun 24, 2024
tgragnato added a commit to immobiliare/collectd-haproxy-plugin that referenced this issue Jun 26, 2024
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version.
quark-zju added a commit to quark-zju/rust-cpython that referenced this issue Jul 1, 2024
Drop Python 2.7, as it is no longer available:

    Warning: The support for python 2.7 will be removed on June 19. Related issue: actions/setup-python#672
    Version 2.7 was not found in the local cache
    Error: The version '2.7' with architecture 'x64' was not found for Ubuntu 22.04.
    The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

Add Python 3.12 as its support was just added.

Fork macOS steps from Linux due to the ARM arch change:

- Rust 1.41 does not have a `aarch64-apple-darwin` version. The first Rust
  version that supports `aarch64-apple-darwin` is 1.49.0.
- Python 3.7 to 3.10 do not have a macOS ARM version in CI.
- Rust < 1.54 will fail on CI. See also See rust-lang/rust#107252:

    error: linking with `cc` failed: exit status: 1
    |
    = note: "cc" "-arch" "arm64" "-L" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.0.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.1.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.10.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.11.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.12.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.13.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.14.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.15.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.2.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.3.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.4.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.5.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.6.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.7.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.8.rcgu.o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.build_script_build.f402nxks-cgu.9.rcgu.o" "-o" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/build/memchr-30eba211f26bbb03/build_script_build-30eba211f26bbb03.1dr67yq0qjg3o93v.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/runner/work/rust-cpython/rust-cpython/target/debug/deps" "-L" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-dd5aba3397285ad0.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-cb187f1a5b379d1a.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-d263574460ac0b7b.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-0a9a23101265d9a7.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-e6457880b831342b.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-9590d4ced205b108.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-a1f4d95a4a2cc2a3.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-dbf1072a4ef077a4.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-7ff002204e919c46.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-a2049ddc023c32b9.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-02cf13a7707ef825.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-e628929d2a4d215f.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-1f245a76196b996b.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-49a44db0ac13b7f4.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-a04810d031c48fa4.rlib" "/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-7cd54448073dfb2c.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv"
    = note: ld: multiple errors: archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-dd5aba3397285ad0.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-cb187f1a5b379d1a.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-d263574460ac0b7b.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-0a9a23101265d9a7.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-e6457880b831342b.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-9590d4ced205b108.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-a1f4d95a4a2cc2a3.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-dbf1072a4ef077a4.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-7ff002204e919c46.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-a2049ddc023c32b9.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-02cf13a7707ef825.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-e628929d2a4d215f.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-1f245a76196b996b.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-49a44db0ac13b7f4.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-a04810d031c48fa4.rlib'; archive member 'lib.rmeta' not a mach-o file in '/Users/runner/.rustup/toolchains/1.53.0-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-7cd54448073dfb2c.rlib'
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
swaroopch pushed a commit to swaroopch/edn_format that referenced this issue Jul 5, 2024
* CI: test on 3.11 and 3.12 as well

* CI: pin Ubuntu version to fix Python 3.6

See actions/setup-python#544

* CI: remove 2.7 support to fix build

See actions/setup-python#672

* Bump actions/setup-python to v5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests