Skip to content

Commit

Permalink
Dont chdir as part of sip-build command
Browse files Browse the repository at this point in the history
Instead chdir overall, makes the command simpler.
  • Loading branch information
kovidgoyal committed May 13, 2021
1 parent 4b5f899 commit d368c4f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions setup/build.py
Expand Up @@ -333,10 +333,10 @@ def run(self, opts):
jobs = []
sbf_map = {}
for (ext, dest) in pyqt_extensions:
cmd, sbf = self.get_sip_commands(ext)
cmd, sbf, cwd = self.get_sip_commands(ext)
sbf_map[id(ext)] = sbf
if cmd is not None:
jobs.append(create_job(cmd))
jobs.append(create_job(cmd, cwd=cwd))
if jobs:
self.info(f'SIPing {len(jobs)} files...')
if not parallel_build(jobs, self.info):
Expand Down Expand Up @@ -523,16 +523,18 @@ def get_sip_commands(self, ext):
sipf = ext.sip_files[0]
sbf = self.j(src_dir, self.b(sipf)+'.sbf')
cmd = None
cwd = None
if self.newer(sbf, [sipf] + ext.headers + ext.sources):
shutil.rmtree(src_dir, ignore_errors=True)
os.makedirs(src_dir)
self.create_sip_build_skeleton(src_dir, ext)
cwd = src_dir
cmd = [
sys.executable, '-c',
f'''import os; os.chdir({src_dir!r}); from sipbuild.tools.build import main; main();''',
'''from sipbuild.tools.build import main; main();''',
'--verbose', '--no-make', '--qmake', QMAKE
]
return cmd, sbf
return cmd, sbf, cwd

def build_pyqt_extension(self, ext, dest, sbf):
self.info(f'\n####### Building {ext.name} extension', '#'*7)
Expand Down

0 comments on commit d368c4f

Please sign in to comment.