mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
deploy-ng: Add --skip-build and --dist-dir options to bdist_apps
dist-dir defaults to 'dist' like sdist and bdist_wheel, which makes bdist_apps more consistent with the rest of the Python ecosystem.
This commit is contained in:
parent
ec3c2ad25a
commit
88fc3d4ca3
10
direct/src/dist/commands.py
vendored
10
direct/src/dist/commands.py
vendored
@ -226,7 +226,7 @@ class build_apps(setuptools.Command):
|
||||
self.default_prc_dir = None
|
||||
self.log_filename = None
|
||||
self.log_append = False
|
||||
self.requirements_path = './requirements.txt'
|
||||
self.requirements_path = os.path.join(os.getcwd(), 'requirements.txt')
|
||||
self.use_optimized_wheels = True
|
||||
self.optimized_wheel_index = ''
|
||||
self.pypi_extra_indexes = []
|
||||
@ -1149,6 +1149,8 @@ class bdist_apps(setuptools.Command):
|
||||
|
||||
description = 'bundle built Panda3D applications into distributable forms'
|
||||
user_options = build_apps.user_options + [
|
||||
('dist-dir=', 'd', 'directory to put final built distributions in'),
|
||||
('skip-build', None, 'skip rebuilding everything (for testing/debugging)'),
|
||||
]
|
||||
|
||||
def _build_apps_options(self):
|
||||
@ -1156,6 +1158,8 @@ class bdist_apps(setuptools.Command):
|
||||
|
||||
def initialize_options(self):
|
||||
self.installers = {}
|
||||
self.dist_dir = os.path.join(os.getcwd(), 'dist')
|
||||
self.skip_build = False
|
||||
for opt in self._build_apps_options():
|
||||
setattr(self, opt, None)
|
||||
|
||||
@ -1310,11 +1314,13 @@ class bdist_apps(setuptools.Command):
|
||||
if optval is not None:
|
||||
setattr(build_cmd, opt, optval)
|
||||
build_cmd.finalize_options()
|
||||
if not self.skip_build:
|
||||
self.run_command('build_apps')
|
||||
|
||||
platforms = build_cmd.platforms
|
||||
build_base = build_cmd.build_base
|
||||
os.chdir(build_base)
|
||||
os.makedirs(self.dist_dir, exist_ok=True)
|
||||
os.chdir(self.dist_dir)
|
||||
|
||||
for platform in platforms:
|
||||
build_dir = os.path.join(build_base, platform)
|
||||
|
Loading…
x
Reference in New Issue
Block a user