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

Bug: _needs_reinstall captures `python setup.py --name` stderr in addition to stdout #1052

Closed
hashbrowncipher opened this Issue Oct 10, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@hashbrowncipher
Contributor

hashbrowncipher commented Oct 10, 2018

I ran into this bug because my setup.py --name uses the warnings module, which prints to stderr. As a result, tox was unable to infer the location of my egg_info directory.

@hashbrowncipher

This comment has been minimized.

Contributor

hashbrowncipher commented Oct 10, 2018

This has the side-effect of not showing users the warning that their setup.py presumably wanted seen.

@gaborbernat

This comment has been minimized.

Member

gaborbernat commented Oct 10, 2018

Is #1051 fix for this? Or this is an additional one?

@hashbrowncipher

This comment has been minimized.

Contributor

hashbrowncipher commented Oct 10, 2018

This is separate from #1051. I wrote up a failing test case for the behavior I'd like to succeed:

def test_warning_emitted(cmd, initproj):
    initproj(
        "spam-0.0.1",
        filedefs={
            "tox.ini": """
        [testenv]
        skipsdist=True
        usedevelop=True
    """,
            "setup.py": """
        from setuptools import setup
        from warnings import warn
        warn("I am a warning")

        setup(name="spam", version="0.0.1")
    """
        }
    )
    result = cmd()
    result = cmd()
    assert "develop-inst-noop" in result.out
@gaborbernat

This comment has been minimized.

Member

gaborbernat commented Oct 10, 2018

In this case I would propose to print the warning ourselves too, but still continue with the build. Will address.

igor-sadchenko pushed a commit to igor-sadchenko/tox that referenced this issue Oct 24, 2018

Don't capture stderr when doing `setup.py --name` (closes tox-dev#1052)…
… (tox-dev#1068)

As suggested in tox-dev#1052, this prints the warning and continues with the build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment