Skip to content

Commit c66fd76

Browse files
committed
cleanuo
1 parent 65a999c commit c66fd76

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

setup.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -268,31 +268,30 @@ def unix_libraw_compile():
268268

269269
os.chdir(cwd)
270270

271-
if isLinux or isMac:
272-
# When compiling LibRaw from source (not using system libraw), we
273-
# copy the shared libraries into the package directory so they get
274-
# bundled with the installed package (via package_data globs).
275-
# The extension uses rpath ($ORIGIN on Linux, @loader_path on macOS)
276-
# to find them at runtime.
277-
#
278-
# In CI, auditwheel (Linux) and delocate (macOS) further repair the
279-
# wheel, but for editable installs and plain `pip install .` we need
280-
# the libraries in-tree.
281-
lib_dir = os.path.join(install_dir, "lib")
282-
if isLinux:
283-
libs = glob.glob(os.path.join(lib_dir, "libraw_r.so*"))
284-
else: # macOS
285-
libs = glob.glob(os.path.join(lib_dir, "libraw_r*.dylib"))
286-
for lib in libs:
287-
dest = os.path.join("rawpy", os.path.basename(lib))
288-
if os.path.islink(lib):
289-
if os.path.lexists(dest):
290-
os.remove(dest)
291-
linkto = os.readlink(lib)
292-
os.symlink(linkto, dest)
293-
else:
294-
shutil.copyfile(lib, dest)
295-
print(f"Bundling {lib} -> {dest}")
271+
# When compiling LibRaw from source (not using system libraw), we
272+
# copy the shared libraries into the package directory so they get
273+
# bundled with the installed package (via package_data globs).
274+
# The extension uses rpath ($ORIGIN on Linux, @loader_path on macOS)
275+
# to find them at runtime.
276+
#
277+
# In CI, auditwheel (Linux) and delocate (macOS) further repair the
278+
# wheel, but for editable installs and plain `pip install .` we need
279+
# the libraries in-tree.
280+
lib_dir = os.path.join(install_dir, "lib")
281+
if isLinux:
282+
libs = glob.glob(os.path.join(lib_dir, "libraw_r.so*"))
283+
else: # macOS
284+
libs = glob.glob(os.path.join(lib_dir, "libraw_r*.dylib"))
285+
for lib in libs:
286+
dest = os.path.join("rawpy", os.path.basename(lib))
287+
if os.path.islink(lib):
288+
if os.path.lexists(dest):
289+
os.remove(dest)
290+
linkto = os.readlink(lib)
291+
os.symlink(linkto, dest)
292+
else:
293+
shutil.copyfile(lib, dest)
294+
print(f"Bundling {lib} -> {dest}")
296295

297296

298297
# --- Main Logic ---

0 commit comments

Comments
 (0)