diff --git a/buildozer/default.spec b/buildozer/default.spec index 612f79e..b33a62d 100644 --- a/buildozer/default.spec +++ b/buildozer/default.spec @@ -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 diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 6d9be36..b8738bf 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -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): diff --git a/tests/targets/test_android.py b/tests/targets/test_android.py index 09af719..6e127bc 100644 --- a/tests/targets/test_android.py +++ b/tests/targets/test_android.py @@ -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) ) )