GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [doc] replace 'distutils' examples with 'setuptools' · Issue #90163 · python/cpython

[doc] replace 'distutils' examples with 'setuptools' #90163

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[doc] replace 'distutils' examples with 'setuptools'#90163
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided

Description

elmjag
mannequin
opened on Dec 7, 2021
Issue body actions
BPO 46005
Nosy @taleinat, @merwok, @sobolevn, @elmjag
PRs
  • bpo-46005: add note about setuptools to Doc/extending/building.rst #30062
  • 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 = None
    created_at = <Date 2021-12-07.08:08:57.511>
    labels = ['3.11', 'type-feature', '3.10', 'docs']
    title = "[doc] replace 'distutils' examples with 'setuptools'"
    updated_at = <Date 2022-02-02.07:53:49.787>
    user = 'https://github.com/elmjag'

    bugs.python.org fields:

    activity = <Date 2022-02-02.07:53:49.787>
    actor = 'elmjag'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2021-12-07.08:08:57.511>
    creator = 'elmjag'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46005
    keywords = ['patch']
    message_count = 6.0
    messages = ['407896', '408333', '408428', '409512', '410844', '412341']
    nosy_count = 5.0
    nosy_names = ['taleinat', 'eric.araujo', 'docs@python', 'sobolevn', 'elmjag']
    pr_nums = ['30062']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue46005'
    versions = ['Python 3.10', 'Python 3.11']

    Activity

    Next
    1. elmjag commented on Dec 7, 2021

      @elmjag
      elmjagmannequin
      on Dec 7, 2021
      MannequinAuthor
      More actions

      As the distutils have been deprecated, the documentation on building C/C++ extension modules should be updated to use more future proof tool.

      I guess the section:

      'Building C and C++ Extensions with distutils'

      should be replaced with:

      'Building C and C++ Extensions with setuptools'

      Here is link to the section that needs to be updated/replaced:

      https://docs.python.org/3/extending/building.html#building-c-and-c-extensions-with-distutils

    2. elmjag
      added
      3.10 (EOL)end of lifeend of life
      3.11only security fixesonly security fixes
      on Dec 7, 2021
    3. elmjag
      assigned
      docspython
      on Dec 7, 2021
    4. elmjag
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      3.10 (EOL)end of lifeend of life
      type-featureA feature request or enhancementA feature request or enhancement
      3.11only security fixesonly security fixes
      on Dec 7, 2021
    5. elmjag
      assigned
      docspython
      on Dec 7, 2021
    6. elmjag
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      type-featureA feature request or enhancementA feature request or enhancement
      on Dec 7, 2021
    7. sobolevn commented on Dec 11, 2021

      @sobolevn
      sobolevn
      on Dec 11, 2021
      Member
      More actions

      Or maybe we should just include https://github.com/python/cpython/blob/main/Doc/distutils/_setuptools_disclaimer.rst as others do?

      I will send my proposal :)

    8. elmjag commented on Dec 13, 2021

      @elmjag
      elmjagmannequin
      on Dec 13, 2021
      MannequinAuthor
      More actions

      I think it would be very helpful to include an example how to build with setuptools as well. As it in the end boils down to two simple steps:

      • install 'setuptools' package
      • change import line:

      "from distutils.core import setup, Extension"

      to

      "from setuptools import setup, Extension"

      It took me a lot of time to figure out that 'setuptools' have this 'drop-in replacement' API for distutils. IMHO, it's not very well documented anywhere.

      I can make a PR with such addition, if you thinks it's good idea.

    9. merwok commented on Jan 2, 2022

      @merwok
      merwok
      on Jan 2, 2022
      Member
      More actions

      Distutils is deprecated, and core Python docs are not the place to show how to use a specific build system (thanks to a lot of work, we now have multiple viable build systems!).

    10. taleinat commented on Jan 18, 2022

      @taleinat
      taleinat
      on Jan 18, 2022
      Contributor
      More actions

      First, I think that it's good and useful to have full, well-maintained examples of how to build extension modules in the docs.

      Second, until distutils is removed, I think we should keep the documentation for how to use it. Due to this, I don't think adding the "setuptools disclaimer" would be appropriate, since we shouldn't remove the section once the setuptools docs are updated.

      It seems to me that we should:

      1. Add a prominent note about distutils being deprecated and what that means: can one still use it, should one still use it, when is it planned to be removed, etc.

      2. Add mention that 3rd-party tools are now the recommended way to build extensions. Include links to the sections in these libraries' docs explaining how to build extensions.

    11. 2 remaining items

    12. AA-Turner
      added
      3.12only security fixesonly security fixes
      on Jun 9, 2022
    13. jacalata commented on Jun 25, 2022

      @jacalata
      jacalata
      on Jun 25, 2022
      More actions

      This is the setuptools doc page: https://setuptools.pypa.io/en/latest/userguide/ext_modules.html, which is probably what needs to be updated

    14. CAM-Gerlach
      removed
      type-featureA feature request or enhancementA feature request or enhancement
      on Mar 14, 2023
    15. aisk commented on Sep 18, 2023

      @aisk
      aisk
      on Sep 18, 2023
      Member
      More actions

      Currently, distutil has been removed. Should we remove this section and only refer to other third-party tools, especially setuptools?

    16. hugovk commented on Sep 18, 2023

      @hugovk
      hugovk
      on Sep 18, 2023
      Member
      More actions

      This is how the pages looks now for 3.12 (will become /3/ when 3.12 is released): https://docs.python.org/3.12/extending/building.html

      Compare with 3.11 (the current /3/ docs version): https://docs.python.org/3.11/extending/building.html

      For 3.12 the distutils section has been removed, and replaced with a a reference to the setuptools page (in PR #95239).

      Is there anything else that needs doing for this issue or can we close it?

    17. merwok commented on Sep 18, 2023

      @merwok
      merwok
      on Sep 18, 2023
      Member
      More actions

      OK to close for me. @taleinat ?

    18. AA-Turner commented on Sep 19, 2023

      @AA-Turner
      AA-Turner
      on Sep 19, 2023
      Member
      More actions

      #108030 addresses one final part (extending/windows).

      A

    19. StanFromIreland commented on Aug 10, 2025

      @StanFromIreland
      StanFromIreland
      on Aug 10, 2025
      Member
      More actions

      #108030 addresses one final part (extending/windows).

      This is now under a new issue, I think this is complete then?

    20. StanFromIreland
      added
      pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
      and removed
      3.11only security fixesonly security fixes
      3.10 (EOL)end of lifeend of life
      3.12only security fixesonly security fixes
      on Aug 10, 2025
    21. github-project-automation
      moved this to Todo in docs issueson Aug 10, 2025
    22. github-project-automation
      added this to docs issueson Aug 10, 2025
    23. sobolevn
      closed this as not plannedon Aug 10, 2025
    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

      docsDocumentation in the Doc dirDocumentation in the Doc dirpendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided

      Projects

      • docs issues
        Status
        Todo
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.