Skip to content

Commit 7133285

Browse files
committed
Minor changes
1 parent 30c462a commit 7133285

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[build-system]
22
requires = [
33
"setuptools>=42",
4-
"wheel",
5-
"pybind11>=2.6.0",
4+
"pybind11>=2.10.0",
65
]
76

87
build-backend = "setuptools.build_meta"

setup.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,24 @@
1717
import os
1818
import platform
1919

20+
# Get description from README.md
2021
with open("README.md", encoding="utf-8") as f:
2122
LONG_DESCRIPTION = f.read()
2223

24+
# Setup parallel compilation
2325
if os.environ.get("NPY_NUM_BUILD_JOBS"):
24-
ParallelCompile("NPY_NUM_BUILD_JOBS",
25-
needs_recompile=naive_recompile).install()
26+
ParallelCompile("NPY_NUM_BUILD_JOBS", needs_recompile=naive_recompile).install()
2627
else:
2728
ParallelCompile(needs_recompile=naive_recompile).install()
2829

29-
__version__ = "unknown"
30+
# Default version
31+
__version__ = "0.0.0"
3032
for l in open("include/SiPM.h").readlines():
3133
if "SIPM_VERSION" in l.split():
3234
__version__ = l.split()[-1].strip('"')
3335
break
3436

37+
# Optimize for modern CPUs
3538
extra_compile_args = [
3639
"-DNDEBUG",
3740
"-O3",
@@ -40,12 +43,13 @@
4043
"-mfma",
4144
"-mavx2",
4245
]
43-
extra_link_args = []
4446

47+
# Custom compile flags for Mac-OS
4548
if platform.system() == "Darwin":
4649
# On MacOS
4750
extra_compile_args.append("-fno-aligned-allocation")
4851

52+
# Get files
4953
sources = []
5054
sources.extend(glob("src/*.cpp"))
5155
sources.extend(glob("python/*.cpp"))
@@ -76,9 +80,7 @@ def __str__(self):
7680
get_pybind_include(),
7781
get_pybind_include(user=True),
7882
],
79-
define_macros=[("SIPM_VERSION", __version__)],
8083
extra_compile_args=extra_compile_args,
81-
extra_link_args=extra_link_args,
8284
language="c++",
8385
),
8486
]
@@ -105,5 +107,6 @@ def __str__(self):
105107
"License :: OSI Approved :: MIT License",
106108
"Topic :: Scientific/Engineering :: Physics",
107109
"Programming Language :: Python :: 3",
110+
"Programming Language :: C++",
108111
],
109112
)

0 commit comments

Comments
 (0)