Skip to content

distutils package deprecation warning in configure.py #42186

Closed

Description

@targos

D:\Git\nodejs\node\configure.py:17: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives

@nodejs/python

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    pythonPRs and issues that require attention from people who are familiar with Python.
    on Mar 2, 2022
  2. cclauss commented on Mar 2, 2022

    @cclauss
    Contributor

    I think we have at least 18 months before Python 3.12 is released.
    https://www.python.org/dev/peps/pep-0664

  3. richardlau commented on Mar 2, 2022

    @richardlau
    Member

    For reference:

    from distutils.version import StrictVersion

    PEP 632 suggests to use packaging, although that doesn't appear to be a built-in module (unlike distutils) and may be another package to install (either via pip or your OS' package manager). Or maybe we can just parse into tuples as suggested in #29927 (comment).

    gyp-next will also be affected: https://github.com/nodejs/gyp-next/blob/35305d66b4f377e0f00e52d0426164a592779f17/pylib/gyp/input.py#L19

    from distutils.version import StrictVersion

  4. cclauss commented on Mar 2, 2022

    @cclauss
    Contributor
  5. AdamMajer commented on Aug 10, 2023

    @AdamMajer
    Contributor

    node-gyp has same issue here (nodejs/node-gyp#2869) so the solution is probably to use same solution.

    BTW, this is already causing build failures for Fedora Rawhide

  6. changed the title [-]Python 3 deprecation warning in configure.py[/-] [+]distutils package deprecation warning in configure.py[/+] on Aug 12, 2023
  7. cclauss commented on Aug 12, 2023

    @cclauss
    Contributor

    Yes. The code in question is vendored in from Node-gyp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.pythonPRs and issues that require attention from people who are familiar with Python.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions