Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make setup.py less chatty by default #35935

Closed
jhylton mannequin opened this issue Jan 17, 2002 · 15 comments
Closed

make setup.py less chatty by default #35935

jhylton mannequin opened this issue Jan 17, 2002 · 15 comments
Labels
stdlib Python modules in the Lib dir

Comments

@jhylton
Copy link
Mannequin

jhylton mannequin commented Jan 17, 2002

BPO 504889
Nosy @mwhudson, @malemburg, @nascheme
Files
  • distutils.patch
  • log.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2002-06-04.20:15:44.000>
    created_at = <Date 2002-01-17.15:02:01.000>
    labels = ['library']
    title = 'make setup.py less chatty by default'
    updated_at = <Date 2002-06-04.20:15:44.000>
    user = 'https://bugs.python.org/jhylton'

    bugs.python.org fields:

    activity = <Date 2002-06-04.20:15:44.000>
    actor = 'jhylton'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Distutils']
    creation = <Date 2002-01-17.15:02:01.000>
    creator = 'jhylton'
    dependencies = []
    files = ['3913', '3914']
    hgrepos = []
    issue_num = 504889
    keywords = ['patch']
    message_count = 15.0
    messages = ['38722', '38723', '38724', '38725', '38726', '38727', '38728', '38729', '38730', '38731', '38732', '38733', '38734', '38735', '38736']
    nosy_count = 5.0
    nosy_names = ['mwh', 'lemburg', 'nobody', 'jhylton', 'nascheme']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue504889'
    versions = ['Python 2.3']

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented Jan 17, 2002

    I don't like the amount of output that setup.py
    produces by default, and I don't like the way that -q
    and -v affect the amount of output. In general, I want
    setup.py to tell me what it is doing and not what it is
    skippping. It's fine to say nothing with -q, but it
    shouldn't say more without -v.

    The attached patch is a bit of a kludge, but I'm not
    familiar enough with distutils to do any better. One
    problem is that -v/--verbose has previously handled as
    a flag, either on or off. (There is a curiously large
    amount of code that compares this boolean to see if
    it's greater than some number!) I had the options
    processor to treat self.verbose as a count of -v
    options. So -vv is more verbose than -v.

    Then I change the specific prints and announcements
    that I've seen with setup.py that I didn't want to see.
    The messages I don't want to see (unless verbose is
    high) are about skipping builds of Extensions and not
    copying files that are already up-to-date.

    With this patch in place, setup.py tells me only the
    extensions is actually builds and files it actually copies.

    @jhylton jhylton mannequin closed this as completed Jan 17, 2002
    @jhylton jhylton mannequin added the stdlib Python modules in the Lib dir label Jan 17, 2002
    @jhylton jhylton mannequin closed this as completed Jan 17, 2002
    @jhylton jhylton mannequin added the stdlib Python modules in the Lib dir label Jan 17, 2002
    @mwhudson
    Copy link

    Logged In: YES
    user_id=6656

    Um, context diff?

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented Jan 17, 2002

    Logged In: YES
    user_id=31392

    Er, context diff.

    @mwhudson
    Copy link

    Logged In: YES
    user_id=6656

    Hokay, next question: why the "assert 0" in cmd.py? Are you
    sure you've finished?

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented Jan 17, 2002

    Logged In: YES
    user_id=31392

    The distutils package is a maze of twisty little passages
    that all look the same <wink>. I added an assert 0 to make
    sure that the execution path that generated the output
    wasn't the one with the assert 0. (It wasn't.) Didn't
    intend for the patch to make it in.

    But I'd still be surprised if this patch is the right thing.
    More likely that it demonstrates good behavior that could
    be implemented more cleanly.

    @mwhudson
    Copy link

    Logged In: YES
    user_id=6656

    You're not wrong :|

    The "assert 0" is on the install path though.

    Right. I'm currently fighting emacs to let me print source
    duplex, but I want to understand distutils' innards at some
    point, might as well be now.

    @malemburg
    Copy link
    Member

    Logged In: YES
    user_id=38388

    Jeremy, the patch touches the distutils code, but what you really
    want is to change the behaviour in one single use-case (the setup.py
    which Python uses).

    The "right" way to fix this would be to subclass the various distutils
    classes to implement the change. If this becomes too complicated,
    then distutils ought to be tweaked to make this easier in way that
    doesn't break existing code (e.g. I don't want to miss the skip
    notices for my stuff).

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented Jan 17, 2002

    Logged In: YES
    user_id=31392

    If I had to guess, I'd say cleaning up and rationalizing the
    use of self.verbose and print vs self.announce() vs the
    other methods that print things would teach you a lot about
    the internals.

    Hey, and reformat the code while you're at it <wink>.

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented Jan 17, 2002

    Logged In: YES
    user_id=31392

    MAL, I really want to change distutils not Python's
    setup.py. I use distutils for all sorts of projects and the
    default chattiness is always a nuisance. When I'm doing
    development, I invariable have to wade through hundreds of
    lines of useless output to find the one or two lines that
    confirm a change was made.

    You could still get the skip notices for your stuff, you'd
    just have to run in extra verbose mode.

    @malemburg
    Copy link
    Member

    Logged In: YES
    user_id=38388

    Jeremy, if that's what you want you should at least post
    to the distutils list before going ahead and change things.

    E.g. I can't see why "skip" notices are any less important
    than "building..." notices: they tell you that distutils has
    found some components up-to-date and that may sometimes
    not be what you'd really expect.

    We should first discuss, what distutils developers want as
    default and then go ahead and fixup distutils to meet those
    demands.

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented Jan 18, 2002

    Logged In: YES
    user_id=31392

    Good suggestion. I hadn't planned to change anything, but
    wanted to capture the feature request and share the code.

    @nascheme
    Copy link
    Member

    Logged In: YES
    user_id=35752

    I would prefer it if setup.py would only print what it's
    compiling and not what it's skipping.

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented May 31, 2002

    Logged In: YES
    user_id=31392

    I've attached a new patch that uses a global log module.
    (The added file, log.py, is a separate attachment to this
    patch submission.) The patch is incomplete, as it removes
    the announce() method of several objects. I haven't
    bothered to replace all the calls to announce in the
    commands; that needs to be done before this patch can be
    accepted, but it's too tedious for today :-).

    The new approach is to eliminate all uses of verbose except
    one on the Distriubtion object that can be controlled by -v
    and -q arguments. The value of Distribution.verbose is used
    to set a logging threshold, stored in a global variable in
    the log module. All code that wants to print a message
    calls log.method().

    The default verbosity is 1, which skips messages that say
    "skipping ...". It does print any activity actually
    performed, like calling a C compiler.

    I'm expect more thought needs to be put into the level that
    each message is logged at.

    @nobody
    Copy link
    Mannequin

    nobody mannequin commented May 31, 2002

    Logged In: NO

    Good idea in general.

    Removing .announce() however is not since this
    is used by third party tools extending distutils with
    their own subclasses (BTW, this is something
    you always have to keep in mind: distutils is
    made to be extended, so any change to the core
    API will break packaging tools).

    @jhylton
    Copy link
    Mannequin Author

    jhylton mannequin commented Jun 4, 2002

    Logged In: YES
    user_id=31392

    Modified version checked in preserving announce() as
    recommended by MAL.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants