From 8a1cd92c00d5e9eddb5e4e61aa6b894786541b8d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 26 Sep 2014 08:32:51 +0200 Subject: fix emitting pythoneggs deps with internal generator with internal generator we only get list of matching files but we'll never get any matching directory => check parent directory --- pythoneggs.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pythoneggs.py b/pythoneggs.py index b03304e..23a595f 100755 --- a/pythoneggs.py +++ b/pythoneggs.py @@ -11,7 +11,7 @@ from getopt import getopt from os.path import basename, dirname, isdir, sep, splitext -from sys import argv, stdin, version +from sys import argv, stderr, stdin, version from pkg_resources import Distribution, FileMetadata, PathMetadata from distutils.sysconfig import get_python_lib @@ -73,14 +73,19 @@ for f in files: spec = ('==',f.split(lib)[1].split(sep)[0]) if not spec in py_deps[name]: py_deps[name].append(spec) + parent_name = dirname(f) # Determine provide, requires, conflicts & suggests based on egg metadata - if lower.endswith('.egg') or \ + file_match = lower.endswith('.egg') or \ lower.endswith('.egg-info') or \ - lower.endswith('.egg-link'): + lower.endswith('.egg-link') + dir_match = parent_name.endswith('.egg') or \ + parent_name.endswith('.egg-info') or \ + parent_name.endswith('.egg-link') + if file_match or dir_match: dist_name = basename(f) - if isdir(f): - path_item = dirname(f) - metadata = PathMetadata(path_item, f) + if dir_match: + path_item = dirname(parent_name) + metadata = PathMetadata(path_item, parent_name) else: path_item = f metadata = FileMetadata(f) -- cgit v1.2.1