Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 434c32f

Browse files
committed
Bail out from building regexes entirely if there is no .git
This broke, I think, only tox environment for tests
1 parent 80edcc2 commit 434c32f

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

setup.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ def finalize_options(self):
3333

3434
def run(self):
3535
work_path = self.work_path
36-
if os.path.exists(os.path.join(work_path, '.git')):
37-
log.info('initializing git submodules')
38-
check_output(['git', 'submodule', 'init'], cwd=work_path)
39-
check_output(['git', 'submodule', 'update'], cwd=work_path)
36+
if not os.path.exists(os.path.join(work_path, '.git')):
37+
return
38+
39+
log.info('initializing git submodules')
40+
check_output(['git', 'submodule', 'init'], cwd=work_path)
41+
check_output(['git', 'submodule', 'update'], cwd=work_path)
4042

4143
yaml_src = os.path.join(work_path, 'uap-core', 'regexes.yaml')
4244
if not os.path.exists(yaml_src):
@@ -111,12 +113,6 @@ def run(self):
111113
_develop.run(self)
112114

113115

114-
class build(_build):
115-
def run(self):
116-
self.run_command('build_regexes')
117-
_build.run(self)
118-
119-
120116
class install(_install):
121117
def run(self):
122118
self.run_command('build_regexes')
@@ -129,7 +125,6 @@ class sdist(_sdist):
129125

130126
cmdclass = {
131127
'develop': develop,
132-
'build': build,
133128
'sdist': sdist,
134129
'install': install,
135130
'build_regexes': build_regexes,

0 commit comments

Comments
 (0)