Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 257125 Details for
Bug 348710
dev-python/paver: error when installing if setuptools is not present
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch that fixes this bug (from upstream)
paver-1.0.3-add-support-for-negative-options.patch (text/plain), 4.39 KB, created by
Nao Nakashima
on 2010-12-14 13:01:34 UTC
(
hide
)
Description:
Patch that fixes this bug (from upstream)
Filename:
MIME Type:
Creator:
Nao Nakashima
Created:
2010-12-14 13:01:34 UTC
Size:
4.39 KB
patch
obsolete
>From c849221d18205b63229568805a58290c6ed2c210 Mon Sep 17 00:00:00 2001 >From: Almad <bugs@almad.net> >Date: Sun, 12 Dec 2010 19:15:05 +0100 >Subject: [PATCH] Add support for negative options (fixes #2) > > >Signed-off-by: Nao Nakashima <nao.nakashima@gmail.com> > >diff --git a/paver/setuputils.py b/paver/setuputils.py >index 57d7284..71dda04 100644 >--- a/paver/setuputils.py >+++ b/paver/setuputils.py >@@ -135,6 +135,7 @@ class DistutilsTask(tasks.Task): > self.option_names = set() > self.needs = [] > self.user_options = command_class.user_options >+ self.negative_opt = getattr(command_class, "negative_opt", {}) > # Parse distutils config files. > distribution.parse_config_files() > >diff --git a/paver/tasks.py b/paver/tasks.py >index 0584390..53ef9a8 100644 >--- a/paver/tasks.py >+++ b/paver/tasks.py >@@ -238,6 +238,7 @@ class Task(object): > self.name = "%s.%s" % (func.__module__, func.__name__) > self.option_names = set() > self.user_options = [] >+ self.negative_opt = {} > try: > self.__doc__ = func.__doc__ > except AttributeError: >@@ -250,7 +251,7 @@ class Task(object): > > def __repr__(self): > return "Task: " + self.__name__ >- >+ > @property > def parser(self): > options = self.user_options >@@ -265,6 +266,7 @@ class Task(object): > if not task: > raise PavementError("Task %s needed by %s does not exist" > % (task_name, self)) >+ > for option in task.user_options: > try: > longname = option[0] >@@ -294,6 +296,7 @@ by another task in the dependency chain.""" % (self, option, task)) > except IndexError: > raise PavementError("Invalid option format provided for %r: %s" > % (self, option)) >+ > return parser > > def display_help(self, parser=None): >@@ -320,15 +323,21 @@ by another task in the dependency chain.""" % (self, option, task)) > sys.exit(0) > > for task_name, option_name in self.option_names: >+ dist_option_name = option_name > option_name = option_name.replace('-', '_') > try: > optholder = environment.options[task_name] > except KeyError: > optholder = paver.options.Bunch() > environment.options[task_name] = optholder >+ > value = getattr(options, option_name) > if value is not None: >- optholder[option_name] = getattr(options, option_name) >+ if dist_option_name in getattr(self, "negative_opt"): >+ optholder[self.negative_opt[dist_option_name].replace('-', '_')] = False >+ else: >+ optholder[option_name] = getattr(options, option_name) >+ > return args > > @property >diff --git a/paver/tests/test_setuputils.py b/paver/tests/test_setuputils.py >index d06ec59..c0d3778 100644 >--- a/paver/tests/test_setuputils.py >+++ b/paver/tests/test_setuputils.py >@@ -1,4 +1,3 @@ >-from pprint import pprint > from distutils.core import Command > > from paver.setuputils import install_distutils_tasks, \ >@@ -11,9 +10,9 @@ class _sdist(Command): > called = False > foo_set = False > fin = None >- user_options = [("foo", "f", "Foo")] >+ user_options = [("foo", "f", "Foo"), ("no-foo", None, "No Foo")] > boolean_options = ['foo'] >- negative_opt = {} >+ negative_opt = {'no-foo' : 'foo'} > > def initialize_options(self): > self.foo = False >@@ -33,6 +32,10 @@ class _sdist(Command): > cls.fin = None > > >+class _sdist_with_default_foo(_sdist): >+ def initialize_options(self): >+ self.foo = True >+ > #---------------------------------------------------------------------- > def test_override_distutils_command(): > @tasks.task >@@ -133,3 +136,16 @@ def test_needs_sdist_without_options(): > cmd = d.get_command_obj('sdist') > assert not cmd.foo > assert not _sdist.foo_set >+ >+def test_negative_opts_handled_for_distutils(): >+ _sdist.reset() >+ env = _set_environment() >+ env.options = options.Bunch(setup=options.Bunch()) >+ install_distutils_tasks() >+ d = _get_distribution() >+ d.cmdclass['sdist'] = _sdist_with_default_foo >+ >+ tasks._process_commands(['sdist', '--no-foo']) >+ >+ assert _sdist.called >+ assert not _sdist.foo_set >-- >1.7.2.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 348710
:
257124
| 257125 |
257130