[Python-checkins] r45536 - in sandbox/trunk/setuptools: pkg_resources.py pkg_resources.txt setuptools/command/bdist_egg.py (original) (raw)

phillip.eby python-checkins at python.org
Tue Apr 18 17:27:07 CEST 2006


Author: phillip.eby Date: Tue Apr 18 17:27:06 2006 New Revision: 45536

Modified: sandbox/trunk/setuptools/pkg_resources.py sandbox/trunk/setuptools/pkg_resources.txt sandbox/trunk/setuptools/setuptools/command/bdist_egg.py Log: Split get_platform() into get_supported_platform() and get_build_platform() to work around a Mac versioning problem that caused the behavior of compatible_platforms() to be platform specific.

Modified: sandbox/trunk/setuptools/pkg_resources.py

+get_platform = get_build_platform # XXX backward compat

def compatible_platforms(provided,required): """Can code for the provided platform run on the required platform? @@ -171,8 +171,6 @@ """ if provided is None or required is None or provided==required: return True # easy case

@@ -203,6 +201,8 @@ provMac.group(3) != reqMac.group(3): return False

@@ -616,7 +616,7 @@ class Environment(object): """Searchable snapshot of distributions on a search path"""

Modified: sandbox/trunk/setuptools/pkg_resources.txt

--- sandbox/trunk/setuptools/pkg_resources.txt (original) +++ sandbox/trunk/setuptools/pkg_resources.txt Tue Apr 18 17:27:06 2006 @@ -447,7 +447,7 @@ Environment objects are used by pkg_resources to index available distributions during dependency resolution. -Environment(search_path=None, platform=get_platform(), python=PY_MAJOR) +Environment(search_path=None, platform=get_supported_platform(), python=PY_MAJOR) Create an environment snapshot by scanning search_path for distributions compatible with platform and python. search_path should be a sequence of strings such as might be used on sys.path. If a @@ -1596,11 +1596,21 @@ Platform Utilities

-get_platform() +get_build_platform() Return this platform's identifier string. For Windows, the return value is "win32", and for Mac OS X it is a string of the form "macosx-10.4-ppc". All other platforms return the same uname-based string that the distutils.util.get_platform() function returns.

compatible_platforms(provided, required) Return true if a distribution built on the provided platform may be used @@ -1665,3 +1675,7 @@ of a namespace package's __init__.py files must include a declare_namespace() call.

Modified: sandbox/trunk/setuptools/setuptools/command/bdist_egg.py

--- sandbox/trunk/setuptools/setuptools/command/bdist_egg.py (original) +++ sandbox/trunk/setuptools/setuptools/command/bdist_egg.py Tue Apr 18 17:27:06 2006 @@ -8,7 +8,7 @@ from distutils.dir_util import remove_tree, mkpath from distutils.sysconfig import get_python_version, get_python_lib from distutils import log -from pkg_resources import get_platform, Distribution +from pkg_resources import get_build_platform, Distribution from types import CodeType from setuptools.extension import Library @@ -48,7 +48,7 @@ "temporary directory for creating the distribution"), ('plat-name=', 'p', "platform name to embed in generated filenames " - "(default: %s)" % get_platform()), + "(default: %s)" % get_build_platform()), ('exclude-source-files', None, "remove all .py files from the generated egg"), ('keep-temp', 'k', @@ -99,7 +99,7 @@ self.bdist_dir = os.path.join(bdist_base, 'egg') if self.plat_name is None: - self.plat_name = get_platform() + self.plat_name = get_build_platform() self.set_undefined_options('bdist',('dist_dir', 'dist_dir'))


More information about the Python-checkins mailing list