Skip to content

🔥 Drop Python 2 support #2105

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 34 commits into from
Mar 30, 2020
Merged

Conversation

opacam
Copy link
Member

@opacam opacam commented Mar 28, 2020

In this PR, we drop support for Python 2...so no more python2 recipe.

Quick view of what we do:

  • remove python2 recipe
  • remove hostpython2 recipe
  • remove python2 testapps
  • remove python2's specific code
  • Adapt recipes to the new situation
  • Adapt our tests to the new situation
  • Adapt our CI test to the new situation
  • Update docs

Notes

  • we will not have a green tick mark for our rebuild_updated_recipes CI test, since we have to touch a lot of recipes and some of them will create a dependencies conflict.

@opacam opacam requested review from AndreMiras and inclement March 28, 2020 09:21
AndreMiras
AndreMiras previously approved these changes Mar 28, 2020
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been waiting for this for too long, maybe now it's time :)
Yes indeed rebuild_updated_recipes is expected to fail in this scenario

opacam added 5 commits March 28, 2020 19:57
This is strange...that recipe should be in a folder right?
Because we don't use it anymore. We used to package `python2` but
our `python3` was never zipped with that function, so there is no point
to maintain it now that we get rid of python2.
This build was only there to check Python 2 support, so it's fine to skip it now.
I think being explicit is still best practice, correct me if I'm wrong.

We don't really support calling this script directly any more anyway, but I guess may as well do it right!
Copy link
Member

@inclement inclement left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, spring cleaning :p

Looks nice and clean to me. I made a few doc commits while I was going through, but I think nothing controversial, just trying to maintain a preferred style (like preferring "Python 3" to "Python3" in doc that doesn't refer to the recipe name). Let me know if you disagree with anything.

Other than that, as long as the tests still pass then looks good to me!

@inclement inclement merged commit 2b33eae into kivy:develop Mar 30, 2020
@opacam
Copy link
Member Author

opacam commented Mar 30, 2020

Thanks @inclement, all looks perfect to me, and thanks to directly make the corrections and the merging 😄

@opacam opacam deleted the feature-drop-python2 branch March 30, 2020 22:20
zworkb pushed a commit to zworkb/python-for-android that referenced this pull request Apr 15, 2020
* 🔥 Remove `hostpython2` recipe

* 🔥 Remove `python2` recipe

* 🔥 Remove python2 related from `ci/constants`

* 🔥 Remove python2 environ/tests from `tox`

* 🔥 Remove python2 code from `PythonUtil.java`

* 🔥 Remove python2 patch from `recipes/numpy`

* 🔥 Remove python2 code from `ci/rebuild_updated_recipes`

* 🔥 Remove `test_entrypoints_python2.py`

* 🔥 Remove python2 code from `start.c`

* 🔥 Remove python2 testapps

* 🔥 Remove python2 code from `bs/common/build/build.py`

* 🍱 Update shebang: from `python2` to `python`

* 🍱 Update requirements for `testlauncher_setup`

* 🔥 Remove python2 from class `Bootstrap.recipe_depends`

* 🔥 Remove python2 code from `recipe.py`

* 🔥 Remove `Dockerfile.py2`

* 🍱 Update docstring example for `ToolchainCL.recipes`

`python2` it will not be a conflict anymore, since it doesn't exist.

* 🔥 Remove `note` about `python2` target

* 🍱 Update `android` recipe to avoid `python2`

* 🔥 Remove `python2`  from recipes's `depends`

* 🔥 Remove `hostpython2`  from recipes's `depends`

* 🔥 Remove `python2`  from recipes's `conflicts`

* 🍱 Change `hostpython2` to `hostpython3` for `mysqldb` recipe

* 🔥 Remove python2 code from `python` module

* ✅ Update tests to work without `python2`

* 🍱 Update `ndghttpsclient` recipe?

This is strange...that recipe should be in a folder right?

* 🔥 Remove python2 tests from `Makefile`, `travis.yml` and `push.yml`

* 🔥 Remove `make_python_zip`

Because we don't use it anymore. We used to package `python2` but
our `python3` was never zipped with that function, so there is no point
to maintain it now that we get rid of python2.

* 📝 Update docs

* Clean up README for Python 2 changes

* Update Python version support documentation

* Removed Python 2 app build from release process

This build was only there to check Python 2 support, so it's fine to skip it now.

* Made note about python2 support more explicit

* Changed a /usr/bin/env call to explicitly python3

I think being explicit is still best practice, correct me if I'm wrong.

We don't really support calling this script directly any more anyway, but I guess may as well do it right!

Co-authored-by: Alexander Taylor <[email protected]>
AndreMiras added a commit to AndreMiras/python-for-android that referenced this pull request Apr 18, 2020
Simplifies the Dockerfile as Python 2 was dropped.
Renames to default "Dockerfile" so it's picked up by docker hub automatically.
This is a follow-up for:
kivy#2105
Adds the GitHub action build badge.

Free up space before building the APKs to avoid the GitHub Action runner being full.
The error was:
```
mkdir -p /home/user/.android/android-ndk-r19b \
&& unzip -q android-ndk-r19b-linux-x86_64.zip -d /home/user/.android \
&& ln -sfn /home/user/.android/android-ndk-r19b /home/user/.android/android-ndk \
&& rm -f android-ndk-r19b-linux-x86_64.zip
Error processing tar file(exit status 1): write /home/user/.android/android-ndk-r19b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/bfd-plugins/LLVMgold.so: no space left on device
Makefile:61: recipe for target 'docker/build' failed
make: *** [docker/build] Error 1
````
https://github.com/kivy/python-for-android/actions/runs/81658805
AndreMiras added a commit to AndreMiras/python-for-android that referenced this pull request Apr 18, 2020
Simplifies the Dockerfile as Python 2 was dropped.
Renames to default "Dockerfile" so it's picked up by docker hub automatically.
This is a follow-up for:
kivy#2105
Adds the GitHub action build badge.

Free up space before building the APKs to avoid the GitHub Action runner being full.
The error was:
```
mkdir -p /home/user/.android/android-ndk-r19b \
&& unzip -q android-ndk-r19b-linux-x86_64.zip -d /home/user/.android \
&& ln -sfn /home/user/.android/android-ndk-r19b /home/user/.android/android-ndk \
&& rm -f android-ndk-r19b-linux-x86_64.zip
Error processing tar file(exit status 1): write /home/user/.android/android-ndk-r19b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/bfd-plugins/LLVMgold.so: no space left on device
Makefile:61: recipe for target 'docker/build' failed
make: *** [docker/build] Error 1
````
https://github.com/kivy/python-for-android/actions/runs/81658805
The "Free disk space" step could clear about ~10G and helped making the build pass.
See output logs for details.
AndreMiras added a commit to AndreMiras/python-for-android that referenced this pull request Apr 18, 2020
Simplifies the Dockerfile as Python 2 was dropped.
Renames to default "Dockerfile" so it's picked up by docker hub automatically.
This is a follow-up for: kivy#2105
Adds the GitHub action build badge.

Free up space before building the APKs to avoid the GitHub Action runner being full.
The error was:
```
mkdir -p /home/user/.android/android-ndk-r19b \
&& unzip -q android-ndk-r19b-linux-x86_64.zip -d /home/user/.android \
&& ln -sfn /home/user/.android/android-ndk-r19b /home/user/.android/android-ndk \
&& rm -f android-ndk-r19b-linux-x86_64.zip
Error processing tar file(exit status 1): write /home/user/.android/android-ndk-r19b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/bfd-plugins/LLVMgold.so: no space left on device
Makefile:61: recipe for target 'docker/build' failed
make: *** [docker/build] Error 1
````
https://github.com/kivy/python-for-android/actions/runs/81658805
The "Free disk space" step could clear about ~10G and helped making the build pass.
See output logs for details.
AndreMiras added a commit to AndreMiras/python-for-android that referenced this pull request Apr 18, 2020
Simplifies the Dockerfile as Python 2 was dropped.
Renames to default "Dockerfile" so it's picked up by docker hub automatically.
This is a follow-up for: kivy#2105
Adds the GitHub action build badge.

Free up space before building the APKs to avoid the GitHub Action runner being full.
The error was:
```
mkdir -p /home/user/.android/android-ndk-r19b \
&& unzip -q android-ndk-r19b-linux-x86_64.zip -d /home/user/.android \
&& ln -sfn /home/user/.android/android-ndk-r19b /home/user/.android/android-ndk \
&& rm -f android-ndk-r19b-linux-x86_64.zip
Error processing tar file(exit status 1): write /home/user/.android/android-ndk-r19b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/lib/bfd-plugins/LLVMgold.so: no space left on device
Makefile:61: recipe for target 'docker/build' failed
make: *** [docker/build] Error 1
````
https://github.com/kivy/python-for-android/actions/runs/81658805
The "Free disk space" step could clear about ~10G and helped making the build pass.
See output logs for details.
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

Successfully merging this pull request may close these issues.

3 participants