Skip to content

Commit 9dc78f9

Browse files
committed
📝 Update docs
1 parent 40a1983 commit 9dc78f9

File tree

7 files changed

+35
-40
lines changed

7 files changed

+35
-40
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ has been adapted for that feature. Also be aware that more recent versions of th
116116
Android's NDK may not work.
117117

118118
Those mentioned changes has been done this way to make easier the transition
119-
between python3 and python2. We will slowly phase out python2 support
120-
towards 2020...so...if you are using python2 in your projects you should
121-
consider migrating it into python3.
119+
between python3 and python2.
120+
121+
On march of 2020 we dropped python2 support since the python team dropped
122+
python2 support.
122123

123124
## Contributors
124125

doc/source/buildoptions.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,7 @@ This page contains instructions for using different build options.
88
Python versions
99
---------------
1010

11-
python2
12-
~~~~~~~
13-
14-
Select this by adding it in your requirements, e.g. ``--requirements=python2``.
15-
16-
This option builds Python 2.7.2 for your selected Android
17-
architecture. There are no special requirements, all the building is
18-
done locally.
19-
20-
21-
python3
11+
Python3
2212
~~~~~~~
2313

2414
Python3 is supported in two ways. The default method uses CPython 3.7+
@@ -31,6 +21,15 @@ e.g. ``--requirements=python3``.
3121
then add libffi to your requirements,
3222
e.g. ``--requirements=kivy,libffi,python3``.
3323

24+
Python2
25+
~~~~~~~
26+
27+
python-for-android no longer supports building for Python 2.
28+
29+
30+
.. note:: The last python-for-android version supporting Python2 was `v2019.10.06
31+
<https://github.com/kivy/python-for-android/archive/v2019.10.06.zip>`__
32+
3433

3534
CrystaX python3
3635
~~~~~~~~~~~~~~~
@@ -60,7 +59,7 @@ sdl2
6059
~~~~
6160

6261
Use this with ``--bootstrap=sdl2``, or just include the
63-
``sdl2`` recipe, e.g. ``--requirements=sdl2,python2``.
62+
``sdl2`` recipe, e.g. ``--requirements=sdl2,python3``.
6463

6564
SDL2 is a popular cross-platform depelopment library, particularly for
6665
games. It has its own Android project support, which
@@ -120,7 +119,7 @@ webview
120119
~~~~~~~
121120

122121
You can use this with ``--bootstrap=webview``, or include the
123-
``webviewjni`` recipe, e.g. ``--requirements=webviewjni,python2``.
122+
``webviewjni`` recipe, e.g. ``--requirements=webviewjni,python3``.
124123

125124
The webview bootstrap gui is, per the name, a WebView displaying a
126125
webpage, but this page is hosted on the device via a Python

doc/source/contribute.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Release checklist
7575
- `python3 setup_testapp_python3_sqlite_openssl.py apk`
7676
- [ ] `armeabi-v7a`
7777
- [ ] `arm64-v8a`
78-
- `python3 setup_testapp_python2.py apk`
78+
- `python3 setup_testapp_python3.py apk`
7979
- [ ] `armeabi-v7a`
8080
- [ ] `arm64-v8a`
8181
- [ ] Check that the version number is correct

doc/source/distutils.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ This however has these caveats:
2525
or even cause build errors. (Sorry, our internal processing is
2626
just not smart enough to honor them properly at this point)
2727

28-
- If you don't use Python 3 per default, you still need to specify
29-
``--requirements python2`` (without any additional dependencies)
30-
3128
- The dependency analysis at the start may be quite slow and delay
3229
your build
3330

@@ -117,7 +114,7 @@ store them in setup.py by passing the ``options`` parameter to
117114
from setuptools import find_packages
118115

119116
options = {'apk': {'debug': None, # use None for arguments that don't pass a value
120-
'requirements': 'sdl2,pyjnius,kivy,python2',
117+
'requirements': 'sdl2,pyjnius,kivy,python3',
121118
'android-api': 19,
122119
'ndk-dir': '/path/to/ndk',
123120
'dist-name': 'bdisttest',

doc/source/quickstart.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,7 @@ an `.apk` file.
185185

186186
*Compatibility notes:*
187187

188-
- While python2 is still supported by python-for-android,
189-
it will possibly no longer receive patches by the python creators
190-
themselves in 2020. Migration to Python 3 is recommended!
188+
- Python2 is not supported by python-for-android.
191189

192190

193191
Build a WebView application

doc/source/recipes.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The basic declaration of a recipe is as follows::
4141
patches = ['some_fix.patch'] # Paths relative to the recipe dir
4242

4343
depends = ['kivy', 'sdl2'] # These are just examples
44-
conflicts = ['python2']
44+
conflicts = ['generickndkbuild']
4545
4646
recipe = YourRecipe()
4747

@@ -61,15 +61,15 @@ when the recipe is imported.
6161
The actual build process takes place via three core methods::
6262

6363
def prebuild_arch(self, arch):
64-
super(YourRecipe, self).prebuild_arch(arch)
64+
super().prebuild_arch(arch)
6565
# Do any pre-initialisation
6666

6767
def build_arch(self, arch):
68-
super(YourRecipe, self).build_arch(arch)
68+
super().build_arch(arch)
6969
# Do the main recipe build
7070
7171
def postbuild_arch(self, arch):
72-
super(YourRecipe, self).build_arch(arch)
72+
super().build_arch(arch)
7373
# Do any clearing up
7474

7575
These methods are always run in the listed order; prebuild, then
@@ -86,7 +86,7 @@ context manager defined in toolchain.py::
8686

8787
from pythonforandroid.toolchain import current_directory
8888
def build_arch(self, arch):
89-
super(YourRecipe, self).build_arch(arch)
89+
super().build_arch(arch)
9090
with current_directory(self.get_build_dir(arch.arch)):
9191
with open('example_file.txt', 'w') as fileh:
9292
fileh.write('This is written to a file within the build dir')
@@ -178,7 +178,7 @@ environment for any processes that you call. It is convenient to do
178178
this using the ``sh`` module as follows::
179179

180180
def build_arch(self, arch):
181-
super(YourRecipe, self).build_arch(arch)
181+
super().build_arch(arch)
182182
env = self.get_recipe_env(arch)
183183
sh.echo('$PATH', _env=env) # Will print the PATH entry from the
184184
# env dict
@@ -196,7 +196,7 @@ the following when compiling for SDL2, in order to tell Kivy what
196196
backend to use::
197197

198198
def get_recipe_env(self, arch):
199-
env = super(KivySDL2Recipe, self).get_recipe_env(arch)
199+
env = super().get_recipe_env(arch)
200200
env['USE_SDL2'] = '1'
201201

202202
env['KIVY_SDL2_PATH'] = ':'.join([
@@ -256,7 +256,7 @@ for the Vispy module::
256256
version = 'master'
257257
url = 'https://github.com/vispy/vispy/archive/{version}.zip'
258258

259-
depends = ['python2', 'numpy']
259+
depends = ['python3', 'numpy']
260260
261261
site_packages_name = 'vispy'
262262

@@ -272,7 +272,7 @@ Python installation.
272272
For reference, the code that accomplishes this is the following::
273273

274274
def build_arch(self, arch):
275-
super(PythonRecipe, self).build_arch(arch)
275+
super().build_arch(arch)
276276
self.install_python_package()
277277

278278
def install_python_package(self):
@@ -426,15 +426,15 @@ overrides if you do not use them::
426426
url = 'http://example.com/example-{version}.tar.gz'
427427
# {version} will be replaced with self.version when downloading
428428

429-
depends = ['python2', 'numpy'] # A list of any other recipe names
429+
depends = ['python3', 'numpy'] # A list of any other recipe names
430430
# that must be built before this
431431
# one
432432

433433
conflicts = [] # A list of any recipe names that cannot be built
434434
# alongside this one
435435

436436
def get_recipe_env(self, arch):
437-
env = super(YourRecipe, self).get_recipe_env(arch)
437+
env = super().get_recipe_env(arch)
438438
# Manipulate the env here if you want
439439
return env
440440

@@ -444,19 +444,19 @@ overrides if you do not use them::
444444
return True
445445

446446
def prebuild_arch(self, arch):
447-
super(YourRecipe, self).prebuild_arch(self)
447+
super().prebuild_arch(self)
448448
# Do any extra prebuilding you want, e.g.:
449449
self.apply_patch('path/to/patch.patch')
450450

451451
def build_arch(self, arch):
452-
super(YourRecipe, self).build_arch(self)
452+
super().build_arch(self)
453453
# Build the code. Make sure to use the right build dir, e.g.
454454
with current_directory(self.get_build_dir(arch.arch)):
455455
sh.ls('-lathr') # Or run some commands that actually do
456456
# something
457457

458458
def postbuild_arch(self, arch):
459-
super(YourRecipe, self).prebuild_arch(self)
459+
super().prebuild_arch(self)
460460
# Do anything you want after the build, e.g. deleting
461461
# unnecessary files such as documentation
462462

doc/source/troubleshooting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ AttributeError: 'Context' object has no attribute 'hostpython'
132132

133133
This is a known bug in some releases. To work around it, add your
134134
python requirement explicitly,
135-
e.g. :code:`--requirements=python2,kivy`. This also applies when using
136-
buildozer, in which case add python2 to your buildozer.spec requirements.
135+
e.g. :code:`--requirements=python3,kivy`. This also applies when using
136+
buildozer, in which case add python3 to your buildozer.spec requirements.
137137

138138
linkname too long
139139
~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)