Skip to content

Commit c5fddd1

Browse files
committed
More tweaks to python
1 parent 53c2851 commit c5fddd1

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

python/setup.py

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def __init__(self, name):
8383

8484

8585
class CMakeBuildExtension(build_ext):
86-
build_for_coverage = get_environment_option(int, "YUP_COVERAGE", 0)
87-
build_for_distribution = get_environment_option(int, "YUP_DISTRIBUTION", 0)
88-
build_with_lto = get_environment_option(int, "YUP_LTO", 0)
86+
build_for_coverage = get_environment_option(int, "YUP_ENABLE_COVERAGE", 0)
87+
build_for_distribution = get_environment_option(int, "YUP_ENABLE_DISTRIBUTION", 0)
88+
build_with_lto = get_environment_option(int, "YUP_ENABLE_LTO", 0)
8989
build_osx_architectures = get_environment_option(str, "YUP_OSX_ARCHITECTURES", "arm64")
9090
build_osx_deployment_target = get_environment_option(str, "YUP_OSX_DEPLOYMENT_TARGET", "11.0")
9191

@@ -103,6 +103,10 @@ def build_extension(self, ext):
103103
output_path = extdir.parent
104104
output_path.mkdir(parents=True, exist_ok=True)
105105

106+
python_root_dir = sys.exec_prefix
107+
if platform.system() == "Linux":
108+
python_root_dir = str(pathlib.Path(get_python_lib_path()).parent.parent)
109+
106110
config = "Debug" if self.debug or self.build_for_coverage else "Release"
107111
cmake_args = [
108112
f"-DYUP_BUILD_WHEEL=ON",
@@ -112,7 +116,7 @@ def build_extension(self, ext):
112116
f"-DCMAKE_BUILD_TYPE={config}",
113117
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={output_path}",
114118
f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{config.upper()}={output_path}",
115-
f"-DPython_ROOT_DIR={sys.exec_prefix}",
119+
f"-DPython_ROOT_DIR={python_root_dir}",
116120
f"-DPython_INCLUDE_DIRS={get_python_includes_path()}",
117121
f"-DPython_LIBRARY_DIRS={get_python_lib_path()}"
118122
]
@@ -224,22 +228,20 @@ def load_description(version):
224228
with open("../README.md", mode="r", encoding="utf-8") as f:
225229
long_description = f.read()
226230

227-
"""
228-
long_description = re.sub(
229-
r"`([^`>]+)\s<((?!https)[^`>]+)>`_",
230-
fr"`\1 <https://github.com/kunitoki/yup/tree/v{version}/\2>`_",
231-
long_description)
232-
233-
long_description = re.sub(
234-
r"image:: ((?!https).*)",
235-
fr"image:: https://raw.githubusercontent.com/kunitoki/yup/v{version}/\1",
236-
long_description)
237-
238-
long_description = re.sub(
239-
r":target: ((?!https).*)",
240-
fr":target: https://github.com/kunitoki/yup/tree/v{version}/\1",
241-
long_description)
242-
"""
231+
#long_description = re.sub(
232+
# r"`([^`>]+)\s<((?!https)[^`>]+)>`_",
233+
# fr"`\1 <https://github.com/kunitoki/yup/tree/v{version}/\2>`_",
234+
# long_description)
235+
236+
#long_description = re.sub(
237+
# r"image:: ((?!https).*)",
238+
# fr"image:: https://raw.githubusercontent.com/kunitoki/yup/v{version}/\1",
239+
# long_description)
240+
241+
#long_description = re.sub(
242+
# r":target: ((?!https).*)",
243+
# fr":target: https://github.com/kunitoki/yup/tree/v{version}/\1",
244+
# long_description)
243245

244246
return long_description
245247

0 commit comments

Comments
 (0)