Skip to content

Commit

Permalink
Fix site-packages relative path (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou authored Jul 31, 2023
1 parent 1360dde commit 4cfcb19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions empack/filter_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
def iterate_pip_pkg_record(env_prefix):
# Find all RECORD files for .dist-info folders for which INSTALLER is "pip"
# Resolve site-packages directory, ignoring the python3.1/ symlink
prefix = Path(env_prefix).resolve()

site_packages = [
site_package
for site_package in Path(env_prefix).resolve().glob("lib/python*/site-packages")
for site_package in prefix.glob("lib/python*/site-packages")
if "python3.1" not in site_package.parts
]
if not site_packages:
return []
site_packages = site_packages[0]
relative_site_packages = site_packages.relative_to(env_prefix)
relative_site_packages = site_packages.relative_to(prefix)

packages_dist_info = Path(site_packages).resolve().glob("*.dist-info")

Expand Down

0 comments on commit 4cfcb19

Please sign in to comment.