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

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

Merged
merged 3 commits into from
Sep 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions buildozer/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ def __init__(self, *args, **kwargs):
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):
Expand Down
2 changes: 1 addition & 1 deletion tests/targets/test_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def test_init(self):
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)
)
)
Expand Down