Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 716
fix: venv site packages with pkgutil packages#3268
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
df77fa5ee5e02b4b03c2a48f251501bea90e9971c7342bfe57d5de8758aae6335629732c42704dbfc90a259f0a9fa95803c2ec385b63d9ecf2544017717a7bffdd2deb7f3313File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -495,6 +495,9 @@ _BOOL_TYPE = type(True) | ||
| def is_bool(v): | ||
| return type(v) == _BOOL_TYPE | ||
| def is_file(v): | ||
| return type(v) == "File" | ||
| def target_platform_has_any_constraint(ctx, constraints): | ||
| """Check if target platform has any of a list of constraints. | ||
| @@ -511,6 +514,37 @@ def target_platform_has_any_constraint(ctx, constraints): | ||
| return True | ||
| return False | ||
| def relative_path(from_, to): | ||
| """Compute a relative path from one path to another. | ||
| Args: | ||
| from_: {type}`str` the starting directory. Note that it should be | ||
| a directory because relative-symlinks are relative to the | ||
| directory the symlink resides in. | ||
| to: {type}`str` the path that `from_` wants to point to | ||
| Returns: | ||
| {type}`str` a relative path | ||
| """ | ||
| from_parts = from_.split("/") | ||
| to_parts = to.split("/") | ||
| # Strip common leading parts from both paths | ||
| n = min(len(from_parts), len(to_parts)) | ||
| for _ in range(n): | ||
| if from_parts[0] == to_parts[0]: | ||
| from_parts.pop(0) | ||
| to_parts.pop(0) | ||
| else: | ||
| break | ||
| # Impossible to compute a relative path without knowing what ".." is | ||
| if from_parts and from_parts[0] == "..": | ||
| fail("cannot compute relative path from '%s' to '%s'", from_, to) | ||
rickeylev marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| parts = ([".."] * len(from_parts)) + to_parts | ||
| return paths.join(*parts) | ||
rickeylev marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| def runfiles_root_path(ctx, short_path): | ||
| """Compute a runfiles-root relative path from `File.short_path` | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.