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

[easy] test_distutils logs 3 DeprecationWarning warnings #88006

Closed
vstinner opened this issue Apr 14, 2021 · 4 comments
Closed

[easy] test_distutils logs 3 DeprecationWarning warnings #88006

vstinner opened this issue Apr 14, 2021 · 4 comments
Labels
easy tests Tests in the Lib/test dir

Comments

@vstinner
Copy link
Member

BPO 43840
Nosy @vstinner, @tirkarthi
Superseder
  • bpo-41282: Deprecate and remove distutils
  • 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 2021-04-14.14:06:08.853>
    created_at = <Date 2021-04-14.11:06:17.809>
    labels = ['easy', 'tests']
    title = '[easy] test_distutils logs 3 DeprecationWarning warnings'
    updated_at = <Date 2021-04-14.14:06:08.852>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2021-04-14.14:06:08.852>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-04-14.14:06:08.853>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2021-04-14.11:06:17.809>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43840
    keywords = ['easy', 'newcomer friendly']
    message_count = 4.0
    messages = ['391054', '391055', '391075', '391078']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'xtreak']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '41282'
    type = None
    url = 'https://bugs.python.org/issue43840'
    versions = []

    @vstinner
    Copy link
    Member Author

    test_distutils logs 3 DeprecationWarning warnings. They are emitted on purpose and related to PEP-632.

    Does someone want to propose a fix for that?

    "with self.assertWarns(DeprecationWarning):" or warnings_helper.check_warnings() of test.support.warnings_helper can be used.

    $ ./python -m test -v test_distutils 
    (...)
    0:00:00 load avg: 5.49 [1/1] test_distutils
    /home/vstinner/python/master/Lib/test/test_distutils.py:8: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      import distutils.tests

    (...)

    test_byte_compile_optimized (distutils.tests.test_build_py.BuildPyTestCase) ... /tmp/tmpptdx9r50.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP-632 for potential alternatives
    from distutils.util import byte_compile
    ok

    (...)

    test_byte_compile (distutils.tests.test_install_lib.InstallLibTestCase) ... /tmp/tmpk_cfc09q.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP-632 for potential alternatives
    from distutils.util import byte_compile
    ok

    (...)

    Tests result: SUCCESS

    --

    By the way, it would be nice to ignore the DeprecationWarning in setup.py as well for now:

    $ make
    (...)
    /home/vstinner/python/master/./setup.py:33: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils import log
    (...)

    This warning is annoying.

    @vstinner vstinner added tests Tests in the Lib/test dir easy labels Apr 14, 2021
    @vstinner
    Copy link
    Member Author

    Another warning:

    $ ./python -m test -v test_check_c_globals
    (...)
    DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      import distutils.ccompiler
    (...)
    Tests result: SUCCESS

    @tirkarthi
    Copy link
    Member

    I have reported this in the original issue earlier https://bugs.python.org/issue41282#msg388224 . See also https://bugs.python.org/issue43425 for more discussion over handling this.

    @vstinner
    Copy link
    Member Author

    Ok, let's reuse bpo-41282.

    I created PR 25405 and PR 25406.

    @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
    easy tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants