Add option for controlling p4a distutils support, fixes #1224 (#1225)

* Add option for controlling p4a distutils support, refs #1224

* note that .toml needs to be in included extensions if using pyprojet.toml

* Add the default --ignore-setup-py flag to test
This commit is contained in:
Eero af Heurlin 2020-09-13 18:25:14 +03:00 committed by GitHub
parent 7bf9f39709
commit 7b35b3d030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View file

@ -256,6 +256,13 @@ android.allow_backup = True
# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =
# Control passing the --use-setup-py vs --ignore-setup-py to p4a
# "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not
# Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py
# NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate
# setup.py if you're using Poetry, but you need to add "toml" to source.include_exts.
#p4a.setup_py = false
#
# iOS specific

View file

@ -92,6 +92,12 @@ class TargetAndroid(Target):
if port is not None:
self.extra_p4a_args += ' --port={}'.format(port)
setup_py = self.buildozer.config.getdefault('app', 'p4a.setup_py', False)
if setup_py:
self.extra_p4a_args += ' --use-setup-py'
else:
self.extra_p4a_args += ' --ignore-setup-py'
self.warn_on_deprecated_tokens()
def warn_on_deprecated_tokens(self):

View file

@ -115,7 +115,7 @@ class TestTargetAndroid:
assert (
target_android.extra_p4a_args == (
' --color=always'
' --storage-dir="{buildozer_dir}/android/platform/build-armeabi-v7a" --ndk-api=21'.format(
' --storage-dir="{buildozer_dir}/android/platform/build-armeabi-v7a" --ndk-api=21 --ignore-setup-py'.format(
buildozer_dir=buildozer.buildozer_dir)
)
)