Skip to content

Commit 4ce4a09

Browse files
committed
Add --no-tree-build flag
resolves #40
1 parent 8b1ee56 commit 4ce4a09

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎python_appimage/__main__.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ def main():
7070
help='python compatibility tag (e.g. cp37-cp37m)')
7171
build_app_parser.add_argument('-p', '--python-version',
7272
help='python version (e.g. 3.8)')
73+
build_app_parser.add_argument('--no-tree-build',
74+
help='omits pip in-tree-build flag',
75+
action='store_true',
76+
default=False)
7377

7478
which_parser = subparsers.add_parser('which',
7579
description='Locate a binary dependency')

‎python_appimage/commands/build/app.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ def _unpack_args(args):
2525
'''Unpack command line arguments
2626
'''
2727
return args.appdir, args.name, args.python_version, args.linux_tag, \
28-
args.python_tag, args.base_image
28+
args.python_tag, args.base_image, args.no_tree_build
2929

3030

3131
_tag_pattern = re.compile('python([^-]+)[-]([^.]+)[.]AppImage')
3232

3333
def execute(appdir, name=None, python_version=None, linux_tag=None,
34-
python_tag=None, base_image=None):
34+
python_tag=None, base_image=None, no_tree_build=False):
3535
'''Build a Python application using a base AppImage
3636
'''
3737

@@ -229,7 +229,11 @@ def execute(appdir, name=None, python_version=None, linux_tag=None,
229229
# Bundle the requirements
230230
if requirements_list:
231231
pip_version = system(('./AppDir/AppRun','-m', 'pip','--version')).split(' ')[1]
232-
in_tree_build = '' if pip_version < '21' else '--use-feature=in-tree-build'
232+
233+
if pip_version < '21' or no_tree_build:
234+
in_tree_build = ''
235+
else:
236+
in_tree_build = '--use-feature=in-tree-build'
233237

234238
deprecation = (
235239
'DEPRECATION: Python 2.7 reached the end of its life',

0 commit comments

Comments
 (0)