[issue10946] bdist doesn’t pass --skip-build on to subcommands

Éric Araujo report at bugs.python.org
Mon Apr 18 19:42:24 CEST 2011


Éric Araujo <merwok at netwok.org> added the comment:

> Could you please at least describe the test that you mentioned (link
> doesn't work).
I still have a local copy \o/.  Yannick’s patch looks like this:

    def test_skip_build(self):
        pkg_pth, dist = self.create_dist()

        # With the skip_build option, command.build is not called.
        cmd = bdist(dist)
        cmd.skip_build = True
        cmd.ensure_finalized()
        cmd.run()
        self.assertFalse(dist.have_run['build'])

        # Without skip_build option, command.build is called.
        cmd = bdist(dist)
        cmd.skip_build = False
        cmd.ensure_finalized()
        cmd.run()
        self.assertTrue(dist.have_run['build'])

> I added line that passes skip_build from bdist.py to its subcommands
> and it worked for me (at least for simple cases)
What about non-simple cases?  They need to work too.

>- base.py is not called.
(Assuming you meant “build is not called”)

> Using set_undefined_options in install_* is definitely not safe,
> because it fails if parent process has not set skip_build.
Really?  Also, what is “parent process”?  Do you mean that it fails if the command used as source in set_undefined_options does not define the skip_build option in its user_options?

I’m not sure it’d be good to make the install_* skip_build option depend on (== set_undefined_options from) bdist’s skip_build.  I’ve written a bit of code to make testing interaction between commands easier (for example, to test that “setup.py build bdist --skip-build install” runs the second install command without skip_build set to True), I should put it in the main repo so that it can be used for this bug.  Getting good test coverage before we change code is absolute requisite for those dark areas.  Removing the easy keyword :)

> Anyway test_skip_build() is still broken and needs a fix.
Okay, so maybe fix that first.

----------
keywords:  -easy
stage: needs patch -> test needed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10946>
_______________________________________


More information about the Python-bugs-list mailing list