Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for @loader_path. #94

Merged
merged 50 commits into from
Jul 15, 2021
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
3ad7870
Add @loader_path support.
HexDecimal Jul 2, 2021
021b8f9
Update delocating and libsana tests.
HexDecimal Jul 3, 2021
e39535b
Modify test_fix_wheel_archs.
HexDecimal Jul 3, 2021
da1f61e
Handle logging constants more strictly.
HexDecimal Jul 3, 2021
3d0f700
Apply suggestions from code review.
HexDecimal Jul 3, 2021
7edb72f
Split delocate_tree_libs into sub functions.
HexDecimal Jul 3, 2021
c97f4ba
Remove Python 3 style type hints.
HexDecimal Jul 3, 2021
5b4cf2b
Fix line length issues.
HexDecimal Jul 3, 2021
b760de8
Note _copy_required as deprecated.
HexDecimal Jul 3, 2021
0e44c38
Apply suggestions from code review
HexDecimal Jul 3, 2021
3df0b79
Fix typos.
HexDecimal Jul 3, 2021
de39550
Update resolve_path logic.
HexDecimal Jul 3, 2021
21686db
Update changelog.
HexDecimal Jul 3, 2021
c9b4ce0
Clean up edits and remove vague print calls from tests.
HexDecimal Jul 3, 2021
ffc8f5f
Replace 'or' operator with conditional expression.
HexDecimal Jul 3, 2021
f25c94a
Resolve line length issues.
HexDecimal Jul 3, 2021
5650079
Apply suggestions from code review
HexDecimal Jul 5, 2021
ed8fc46
Fix docstring.
HexDecimal Jul 5, 2021
612e979
Apply suggestions from code review
HexDecimal Jul 7, 2021
bf34d18
Fix parameter name.
HexDecimal Jul 7, 2021
04b1369
Don't call realpath on a known bad path.
HexDecimal Jul 7, 2021
9d674a8
Add executable-path command option and set a default.
HexDecimal Jul 7, 2021
6a35f3b
Make _copy_lib_dict function to simplify type handling.
HexDecimal Jul 7, 2021
6318552
Have get_dependencies return None for missing dependencies.
HexDecimal Jul 7, 2021
1be5bfb
Have get_dependencies yield None on all missing files.
HexDecimal Jul 7, 2021
d5b7d74
Copy new commands to delocate_wheel.
HexDecimal Jul 7, 2021
c99b980
Split new function into resolve_dynamic_paths.
HexDecimal Jul 7, 2021
3a01385
Change deprecated version numbers to 0.9.
HexDecimal Jul 7, 2021
b43dcff
Fix style issues.
HexDecimal Jul 7, 2021
6eaa03f
Apply suggestions from code review
HexDecimal Jul 7, 2021
b63fdc9
Suggested change.
HexDecimal Jul 7, 2021
9c0a802
Fix style.
HexDecimal Jul 7, 2021
b8ba22c
Revert changes to test_resolve_rpath.
HexDecimal Jul 7, 2021
83e6455
Revert all changes to test_resolve_rpath.
HexDecimal Jul 7, 2021
aed4c01
Replace asserts in test_tree_libs.
HexDecimal Jul 7, 2021
15a1f6b
Fix tree_libs behavior.
HexDecimal Jul 7, 2021
aa0d1e0
Clarify _copy_required_libs lib_dict variable.
HexDecimal Jul 7, 2021
145a463
Remove Optional from loader_path.
HexDecimal Jul 8, 2021
c50ad87
Merge master into loader_path.
HexDecimal Jul 10, 2021
5c149de
Use EXT_LIBS to verify liba dependencies.
HexDecimal Jul 10, 2021
28b8f66
Handle filter function at get_dependencies.
HexDecimal Jul 11, 2021
ac18223
Ignore system library paths.
HexDecimal Jul 11, 2021
ce80174
Revert test refactor.
HexDecimal Jul 11, 2021
19128ce
Modify rpath wheel to add a recursive dependency.
HexDecimal Jul 11, 2021
5472b0a
Mark copy of filter_system_libs as private.
HexDecimal Jul 11, 2021
94eda06
Add tests for walk_library and walk_directory.
HexDecimal Jul 11, 2021
2b2bf1a
Fix type issue with all_local_libs.
HexDecimal Jul 12, 2021
409a49a
Update changelog.
HexDecimal Jul 12, 2021
996290a
MRG: Allow for realpath differences in listdeps (#2)
matthew-brett Jul 12, 2021
e999490
Resolve issues using pytest's tempdir fixture.
HexDecimal Jul 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ lot of work discussing OSX things with MB, and contributes fixes too.
Releases
********

* Unreleased

* Libraries depending on ``@loader_path`` are now supported.
HexDecimal marked this conversation as resolved.
Show resolved Hide resolved
* Dependencies are now delocated recursively.
* ``delocate.delocating.copy_recurse`` has been deprecated.
* ``delocate.libsana.resolve_rpath`` has been deprecated.

* 0.8.2 (Sunday July 12th 2020)

Bugfix release.
Expand Down
20 changes: 18 additions & 2 deletions delocate/cmd/delocate_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ def main():
Option("-d", "--dylibs-only",
action="store_true",
help="Only analyze files with known dynamic library "
"extensions")])
"extensions"),
Option("--executable-path",
action="store", type='string',
default=os.path.dirname(sys.executable),
help="The path used to resolve @executable_path in dependencies"
),
Option("--ignore-missing-dependencies",
action="store_true",
help="Skip dependencies which couldn't be found and delocate "
"as much as possible"),
])
(opts, paths) = parser.parse_args()
if len(paths) < 1:
parser.print_help()
Expand All @@ -37,7 +47,13 @@ def main():
print(path)
# evaluate paths relative to the path we are working on
lib_path = os.path.join(path, opts.lib_path)
delocate_path(path, lib_path, lib_filt_func)
delocate_path(
path,
lib_path,
lib_filt_func,
executable_path=opts.executable_path,
ignore_missing=opts.ignore_missing_dependencies,
)


if __name__ == '__main__':
Expand Down
45 changes: 36 additions & 9 deletions delocate/cmd/delocate_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
import os
from os.path import join as pjoin, basename, exists, expanduser
import sys
import logging
from typing import List, Optional, Text

from optparse import OptionParser, Option

from delocate import delocate_wheel, __version__


def main():
# type: () -> None
parser = OptionParser(
usage="%s WHEEL_FILENAME\n\n" % sys.argv[0] + __doc__,
version="%prog " + __version__)
Expand All @@ -28,8 +31,10 @@ def main():
help="Directory to store delocated wheels (default is to "
"overwrite input)"),
Option("-v", "--verbose",
action="store_true",
help="Show more verbose report of progress and failure"),
action="count",
help="Show a more verbose report of progress and failure."
" Additional flags show even more info, up to -vv.",
default=0),
Option("-k", "--check-archs",
action="store_true",
help="Check architectures of depended libraries"),
Expand All @@ -39,20 +44,36 @@ def main():
"extensions"),
Option("--require-archs",
action="store", type='string',
help=("Architectures that all wheel libraries should "
"have (from 'intel', 'i386', 'x86_64', 'i386,x86_64')"
"'universal2', 'x86_64,arm64'"))])
help="Architectures that all wheel libraries should "
"have (from 'intel', 'i386', 'x86_64', 'i386,x86_64'"
"'universal2', 'x86_64,arm64')"),
Option("--executable-path",
action="store", type='string',
default=os.path.dirname(sys.executable),
help="The path used to resolve @executable_path in dependencies"
),
Option("--ignore-missing-dependencies",
action="store_true",
help="Skip dependencies which couldn't be found and delocate "
"as much as possible"),
])
(opts, wheels) = parser.parse_args()
if len(wheels) < 1:
parser.print_help()
sys.exit(1)
logging.basicConfig(
level={
0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG
}.get(opts.verbose, logging.DEBUG)
)
multi = len(wheels) > 1
if opts.wheel_dir:
wheel_dir = expanduser(opts.wheel_dir)
if not exists(wheel_dir):
os.makedirs(wheel_dir)
else:
wheel_dir = None
require_archs = None # type: Optional[List[Text]]
if opts.require_archs is None:
require_archs = [] if opts.check_archs else None
elif ',' in opts.require_archs:
Expand All @@ -67,10 +88,16 @@ def main():
out_wheel = pjoin(wheel_dir, basename(wheel))
else:
out_wheel = wheel
copied = delocate_wheel(wheel, out_wheel, lib_filt_func=lib_filt_func,
lib_sdir=opts.lib_sdir,
require_archs=require_archs,
check_verbose=opts.verbose)
copied = delocate_wheel(
wheel,
out_wheel,
lib_filt_func=lib_filt_func,
lib_sdir=opts.lib_sdir,
require_archs=require_archs,
check_verbose=opts.verbose,
executable_path=opts.executable_path,
ignore_missing=opts.ignore_missing_dependencies,
)
if opts.verbose and len(copied):
print("Copied to package {0} directory:".format(opts.lib_sdir))
copy_lines = [' ' + name for name in sorted(copied)]
Expand Down