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

Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure #71994

Closed
Rosuav opened this issue Aug 19, 2016 · 8 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@Rosuav
Copy link
Contributor

Rosuav commented Aug 19, 2016

BPO 27807
Nosy @terryjreedy, @vstinner, @ezio-melotti, @voidspace, @Rosuav, @miss-islington
PRs
  • bpo-27807: Skip test_site.test_startup_imports() if pth file #19060
  • [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) #19089
  • [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) #19090
  • [3.7] [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090) #19093
  • Files
  • no-site-packages-in-test.patch
  • 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 2020-03-20.14:32:53.418>
    created_at = <Date 2016-08-19.22:05:23.814>
    labels = ['3.7', '3.8', 'type-bug', 'tests', '3.9']
    title = 'Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure'
    updated_at = <Date 2020-03-20.14:32:53.416>
    user = 'https://github.com/Rosuav'

    bugs.python.org fields:

    activity = <Date 2020-03-20.14:32:53.416>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-03-20.14:32:53.418>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2016-08-19.22:05:23.814>
    creator = 'Rosuav'
    dependencies = []
    files = ['44158']
    hgrepos = []
    issue_num = 27807
    keywords = ['patch']
    message_count = 8.0
    messages = ['273160', '273165', '364523', '364526', '364536', '364668', '364672', '364673']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'vstinner', 'ezio.melotti', 'michael.foord', 'Rosuav', 'miss-islington']
    pr_nums = ['19060', '19089', '19090', '19093']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27807'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @Rosuav
    Copy link
    Contributor Author

    Rosuav commented Aug 19, 2016

    Having matplotlib installed globally causes test_site to fail, due to the .pth file importing types. The point of the test is to monitor startup dependencies (and thus time) for the core interpreter and standard library, not third-party libraries, so having a test failure due to a .pth is not overly useful.

    Solution suggested by Steve Dower: hack out all .pth handling during this one test, leaving everything else unchanged.

    @Rosuav Rosuav added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Aug 19, 2016
    @terryjreedy
    Copy link
    Member

    I think hitting adventurous users like Chris who locally compile and test with this failure is wrong. There is no core dev 'site' expert, so I picked 'testing'.

    @vstinner
    Copy link
    Member

    Fedora and RHEL downstream issue: https://bugzilla.redhat.com/show_bug.cgi?id=1814392

    @vstinner
    Copy link
    Member

    I marked bpo-35691 as a duplicate of this issue.

    @vstinner vstinner changed the title Prevent site-packages .pth files from causing test_site failure Prevent site-packages .pth files from causing test_site failure: test_site.test_startup_imports() failure Mar 18, 2020
    @vstinner
    Copy link
    Member

    New changeset d18de46 by Victor Stinner in branch 'master':
    bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060)
    d18de46

    @vstinner
    Copy link
    Member

    New changeset ba26bf3 by Victor Stinner in branch '3.8':
    [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090)
    ba26bf3

    @miss-islington
    Copy link
    Contributor

    New changeset 6056b7b by Miss Islington (bot) in branch '3.7':
    [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090)
    6056b7b

    @vstinner
    Copy link
    Member

    The issue is now fixed in 3.7, 3.8 and master branches.

    Thanks Chris Angelico for the bug report.

    @vstinner vstinner added 3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes labels Mar 20, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 (EOL) end of life 3.9 only security fixes tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants