Skip to content

Commit

Permalink
Fix flake8 issues in setup.py
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Avery <[email protected]>
  • Loading branch information
psavery committed Nov 21, 2023
1 parent daafa05 commit a7d696e
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'h5py',
'lmfit',
'numba',
'numpy<1.27', # NOTE: bump this to support the latest version numba supports
'numpy<1.27', # noqa NOTE: bump this to support the latest version numba supports
'psutil',
'pycifrw',
'pyyaml',
Expand Down Expand Up @@ -49,9 +49,10 @@ def get_convolution_extensions():
if not sys.platform.startswith('win'):
extra_compile_args.append('-fPIC')
extra_compile_args += compiler_optimize_flags
# Add '-Rpass-missed=.*' to ``extra_compile_args`` when compiling with clang
# to report missed optimizations
_convolve_ext = Extension(name='hexrd.convolution._convolve', sources=src_files,
# Add '-Rpass-missed=.*' to ``extra_compile_args`` when compiling with
# clang to report missed optimizations
_convolve_ext = Extension(name='hexrd.convolution._convolve',
sources=src_files,
extra_compile_args=extra_compile_args,
include_dirs=[numpy.get_include()],
language='c')
Expand Down Expand Up @@ -86,7 +87,7 @@ def get_include_path(library_name):
build_include_dir,
]

result = subprocess.run(args, check=True)
subprocess.run(args, check=True)

# It should exist now
return full_path
Expand All @@ -96,7 +97,8 @@ def get_cpp_extensions():
cpp_transform_pkgdir = Path('hexrd') / 'transforms/cpp_sublibrary'
src_files = [str(cpp_transform_pkgdir / 'src/inverse_distortion.cpp')]

extra_compile_args = ['-O3', '-Wall', '-shared', '-std=c++11', '-funroll-loops']
extra_compile_args = ['-O3', '-Wall', '-shared', '-std=c++11',
'-funroll-loops']
if not sys.platform.startswith('win'):
extra_compile_args.append('-fPIC')

Expand All @@ -108,11 +110,13 @@ def get_cpp_extensions():
numpy.get_include(),
]

inverse_distortion_ext = Extension(name='hexrd.extensions.inverse_distortion',
sources=src_files,
extra_compile_args=extra_compile_args,
include_dirs=include_dirs,
language='c++')
inverse_distortion_ext = Extension(
name='hexrd.extensions.inverse_distortion',
sources=src_files,
extra_compile_args=extra_compile_args,
include_dirs=include_dirs,
language='c++',
)

return [inverse_distortion_ext]

Expand Down Expand Up @@ -163,8 +167,8 @@ def get_extension_modules():
name='hexrd',
use_scm_version=True,
setup_requires=['setuptools-scm'],
description = 'hexrd X-ray diffraction data analysis tool',
long_description = open('README.md').read(),
description='hexrd X-ray diffraction data analysis tool',
long_description=open('README.md').read(),
author='The hexrd Development Team',
author_email='[email protected]',
url='https://github.com/HEXRD/hexrd',
Expand All @@ -180,7 +184,7 @@ def get_extension_modules():
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
entry_points = entry_points,
entry_points=entry_points,
ext_modules=ext_modules,
packages=find_packages(),
include_package_data=True,
Expand Down

0 comments on commit a7d696e

Please sign in to comment.