10000 Made setup.cfg file work for distutils bdist_apk · suriyan/python-for-android@1ee96e7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ee96e7

Browse files
committed
Made setup.cfg file work for distutils bdist_apk
1 parent a4dc8d4 commit 1ee96e7

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

doc/source/distutils.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,15 @@ store them in setup.py by passing the ``options`` parameter to
7777
These options will be automatically included when you run ``python
7878
setup.py apk``. Any options passed on the command line will override
7979
these values.
80+
81+
Adding p4a arguments in setup.cfg
82+
---------------------------------
83+
84+
You can also provide p4a arguments in the setup.cfg file, as normal
85+
for distutils. The syntax is::
86+
87+
[apk]
88+
89+
argument=value
90+
91+
requirements=sdl2,kivy

pythonforandroid/bdist_apk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def finalize_options(self):
4040

4141
setup_options = self.distribution.get_option_dict('apk')
4242
for (option, (source, value)) in setup_options.items():
43-
if source != 'setup script':
43+
if source == 'command line':
4444
continue
4545
if not argv_contains('--' + option):
46-
if value is None:
46+
if value in (None, 'None'):
4747
sys.argv.append('--{}'.format(option))
4848
else:
4949
sys.argv.append('--{}={}'.format(option, value))
@@ -77,6 +77,7 @@ def run(self):
7777

7878
from pythonforandroid.toolchain import main
7979
sys.argv[1] = 'apk'
80+
print('argv is', sys.argv)
8081
main()
8182

8283
def prepare_build_dir(self):

0 commit comments

Comments
 (0)
0