Skip to content

Commit 5ab39eb

Browse files
committed
minor formatting changes
1 parent 306a72d commit 5ab39eb

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

setup.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,32 @@ def run(self):
2222
try:
2323
out = subprocess.check_output(['cmake', '--version'])
2424
except OSError:
25-
raise RuntimeError("CMake must be installed to build the following extensions: " +
26-
", ".join(e.name for e in self.extensions))
25+
raise RuntimeError(
26+
"CMake must be installed to build the following extensions: " +
27+
", ".join(e.name for e in self.extensions))
2728

2829
if platform.system() == "Windows":
29-
cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', out.decode()).group(1))
30+
cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)',
31+
out.decode()).group(1))
3032
if cmake_version < '3.1.0':
3133
raise RuntimeError("CMake >= 3.1.0 is required on Windows")
3234

3335
for ext in self.extensions:
3436
self.build_extension(ext)
3537

3638
def build_extension(self, ext):
37-
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
39+
extdir = os.path.abspath(
40+
os.path.dirname(self.get_ext_fullpath(ext.name)))
3841
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
3942
'-DPYTHON_EXECUTABLE=' + sys.executable]
4043

4144
cfg = 'Debug' if self.debug else 'Release'
4245
build_args = ['--config', cfg]
4346

4447
if platform.system() == "Windows":
45-
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]
48+
cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(
49+
cfg.upper(),
50+
extdir)]
4651
if sys.maxsize > 2**32:
4752
cmake_args += ['-A', 'x64']
4853
build_args += ['--', '/m']
@@ -51,13 +56,16 @@ def build_extension(self, ext):
5156
build_args += ['--', '-j2']
5257

5358
env = os.environ.copy()
54-
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''),
55-
self.distribution.get_version())
59+
env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(
60+
env.get('CXXFLAGS', ''),
61+
self.distribution.get_version())
5662
if not os.path.exists(self.build_temp):
5763
os.makedirs(self.build_temp)
58-
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
59-
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
60-
print()
64+
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args,
65+
cwd=self.build_temp, env=env)
66+
subprocess.check_call(['cmake', '--build', '.'] + build_args,
67+
cwd=self.build_temp)
68+
print() # Add an empty line for cleaner output
6169

6270
class CatchTestCommand(TestCommand):
6371
"""

tests/math_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Test simulation
21
import unittest
32
import python_cpp_example
43

0 commit comments

Comments
 (0)