From 8316ef1fd0fa4c482e82007880d6f8abc153876d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Wed, 20 Oct 2010 01:20:28 +0000 Subject: determine python(abi) version based on path --- pythoneggs.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pythoneggs.py b/pythoneggs.py index 4cf2245..a626873 100755 --- a/pythoneggs.py +++ b/pythoneggs.py @@ -1,6 +1,6 @@ #!/usr/bin/env python from getopt import getopt -from os.path import basename, dirname, isdir, splitext +from os.path import basename, dirname, isdir, sep, splitext from sys import argv, stdin, version from pkg_resources import Distribution, FileMetadata, PathMetadata from distutils.sysconfig import get_python_lib @@ -50,14 +50,16 @@ else: files = stdin.readlines() for f in files: f = f.strip() - #if Requires: - # if get_python_lib(plat_specific=1) in f or get_python_lib() in f: - # print 'python(abi) >= %s' % Version lower = f.lower() name = 'python(abi)' - if py_abi and lower.endswith('.py'): + if py_abi and (lower.endswith('.py') or lower.endswith('.pyc') or lower.endswith('.pyo')): if not name in py_deps: py_deps[name] = [] + purelib = get_python_lib(standard_lib=1, plat_specific=0).split(version[:3])[0] + platlib = get_python_lib(standard_lib=1, plat_specific=1).split(version[:3])[0] + for lib in (purelib, platlib): + if lib in f: + py_deps[name].append(('==',f.split(lib)[1].split(sep)[0])) if lower.endswith('.egg') or \ lower.endswith('.egg-info') or \ lower.endswith('.egg-link'): -- cgit v1.2.1