cpython: b732b02bd0ba (original) (raw)

Mercurial > cpython

changeset 70874:b732b02bd0ba

packaging: Add the project directory to sys.path to support local setup hooks. Original patch by Vinay Sajip on #11637. [#11637]

Éric Araujo merwok@netwok.org
date Sun, 19 Jun 2011 21:23:43 +0200
parents 8de5fe3b1696
children 7d3fbce32e07
files Lib/packaging/config.py Lib/packaging/tests/test_config.py Misc/NEWS
diffstat 3 files changed, 39 insertions(+), 11 deletions(-)[+] [-] Lib/packaging/config.py 23 Lib/packaging/tests/test_config.py 22 Misc/NEWS 5

line wrap: on

line diff

--- a/Lib/packaging/config.py +++ b/Lib/packaging/config.py @@ -134,15 +134,20 @@ class Config: if 'setup_hooks' in content['global']: setup_hooks = split_multiline(content['global']['setup_hooks'])

-

metadata = self.dist.metadata

--- a/Lib/packaging/tests/test_config.py +++ b/Lib/packaging/tests/test_config.py @@ -126,6 +126,15 @@ language = cxx """ +HOOKS_MODULE = """ +import logging + +logger = logging.getLogger('packaging') + +def logging_hook(config):

+""" + class DCompiler: name = 'd' @@ -326,10 +335,21 @@ class ConfigTestCase(support.TempdirMana self.assertEqual(ext.extra_compile_args, cargs) self.assertEqual(ext.language, 'cxx')

+ def test_missing_setup_hook_warns(self): self.write_setup({'setup-hooks': 'this.does._not.exist'}) self.write_file('README', 'yeah')

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -193,7 +193,10 @@ Core and Builtins Library ------- -- Issue #6771: moved the curses.wrapper function from the single-function +- Issue #11637: Fix support for importing packaging setup hooks from the