diff options
author | Jeremy Stanley <fungi@yuggoth.org> | 2014-06-11 21:26:40 +0000 |
---|---|---|
committer | Jeremy Stanley <fungi@yuggoth.org> | 2014-06-11 21:26:40 +0000 |
commit | 764378f045d4fe03a6773d0f0c295588a36613b6 (patch) | |
tree | fdebf7eadb2e6ced9e49d69b451da6373648baaa | |
parent | 5a3d2b588c35cb218b2ddb11fc88345be4ba80d7 (diff) | |
download | wheel-764378f045d4fe03a6773d0f0c295588a36613b6.tar.gz |
Treat data-only wheels as pure
Wheels with only files.data_files get non-platform-specific names.
Distribution.is_pure() requires that has_pure_modules() returns True,
but when there are no modules present at all this results in is_pure()
returning False. Instead make the purity determination based only on its
other criteria, specifically the results of the has_ext_modules() and
has_c_libraries() methods.
-rw-r--r-- | wheel/bdist_wheel.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/wheel/bdist_wheel.py b/wheel/bdist_wheel.py index 37ebfae..5e9318a 100644 --- a/wheel/bdist_wheel.py +++ b/wheel/bdist_wheel.py @@ -90,7 +90,7 @@ class bdist_wheel(Command): self.dist_dir = None self.distinfo_dir = None self.egginfo_dir = None - self.root_is_purelib = None + self.root_is_pure = None self.skip_build = None self.relative = False self.owner = None @@ -110,7 +110,8 @@ class bdist_wheel(Command): self.set_undefined_options('bdist', *zip(need_options, need_options)) - self.root_is_purelib = self.distribution.is_pure() + self.root_is_pure = not (self.distribution.has_ext_modules() + or self.distribution.has_c_libraries()) # Support legacy [wheel] section for setting universal wheel = self.distribution.get_option_dict('wheel') @@ -129,7 +130,7 @@ class bdist_wheel(Command): def get_tag(self): supported_tags = pep425tags.get_supported() - if self.distribution.is_pure(): + if self.root_is_pure: if self.universal: impl = 'py2.py3' else: @@ -203,7 +204,7 @@ class bdist_wheel(Command): self.install_libbase = self.install_lib = basedir_observed setattr(install, - 'install_purelib' if self.root_is_purelib else 'install_platlib', + 'install_purelib' if self.root_is_pure else 'install_platlib', basedir_observed) logger.info("installing to %s", self.bdist_dir) @@ -255,7 +256,7 @@ class bdist_wheel(Command): msg = Message() msg['Wheel-Version'] = '1.0' # of the spec msg['Generator'] = generator - msg['Root-Is-Purelib'] = str(self.root_is_purelib).lower() + msg['Root-Is-Purelib'] = str(self.root_is_pure).lower() # Doesn't work for bdist_wininst impl_tag, abi_tag, plat_tag = self.get_tag() |