mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
deploy-ng: Support generating a requirements.txt file via pipenv
This commit is contained in:
parent
495ce50d84
commit
2486b12a14
@ -264,6 +264,16 @@ class build_apps(setuptools.Command):
|
||||
elif num_gui_apps == 1:
|
||||
self.macos_main_app = list(self.gui_apps.keys())[0]
|
||||
|
||||
use_pipenv = (
|
||||
'Pipfile' in os.path.basename(self.requirements_path) or
|
||||
not os.path.exists(self.requirements_path) and os.path.exists('Pipfile')
|
||||
)
|
||||
if use_pipenv:
|
||||
reqspath = os.path.join(self.build_base, 'requirements.txt')
|
||||
with open(reqspath, 'w') as reqsfile:
|
||||
subprocess.check_call(['pipenv', 'lock', '--requirements'], stdout=reqsfile)
|
||||
self.requirements_path = reqspath
|
||||
|
||||
assert os.path.exists(self.requirements_path), 'Requirements.txt path does not exist: {}'.format(self.requirements_path)
|
||||
assert num_gui_apps + num_console_apps != 0, 'Must specify at least one app in either gui_apps or console_apps'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user