Skip to content

python-config.py should be part of the stdlib #77620

Description

@pitrou
BPO 33439
Nosy @warsaw, @doko42, @gpshead, @ncoghlan, @pitrou, @encukou, @nanjekyejoannah, @shihai1991, @FFY00

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 2018-05-07.12:15:49.732>
labels = ['3.8', 'type-feature', 'library', 'build']
title = 'python-config.py should be part of the stdlib'
updated_at = <Date 2021-10-25.16:54:17.188>
user = 'https://github.com/pitrou'

bugs.python.org fields:

activity = <Date 2021-10-25.16:54:17.188>
actor = 'gregory.p.smith'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Build', 'Library (Lib)']
creation = <Date 2018-05-07.12:15:49.732>
creator = 'pitrou'
dependencies = []
files = []
hgrepos = []
issue_num = 33439
keywords = []
message_count = 7.0
messages = ['316264', '348546', '348558', '404883', '404901', '404930', '404985']
nosy_count = 9.0
nosy_names = ['barry', 'doko', 'gregory.p.smith', 'ncoghlan', 'pitrou', 'petr.viktorin', 'nanjekyejoannah', 'shihai1991', 'FFY00']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue33439'
versions = ['Python 3.8']

Activity

  1. pitrou commented on May 7, 2018

    @pitrou
    MemberAuthor

    Rather than (or in addition to) being a standalone script, python-config should be invokable as a stdlib module, e.g. "python -m sysconfig.config". This would prevent the risk of invoking the wrong script on PATH.

  2. added
    buildThe build process and cross-build
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on May 7, 2018
  3. doko42 commented on Jul 27, 2019

    @doko42
    Member

    what are the situations where the path for python and python-config is different?

    This proposal doesn't say anything how to retrieve the correct information for cross builds using this module. From my point of view, python-config should stay outside the standard library.

  4. shihai1991 commented on Jul 27, 2019

    @shihai1991
    Member

    En, looks like just only makefile would call python-config.py.
    IMHO, if no out user call this script, looks it move to stdlib would be better.

  5. nanjekyejoannah commented on Oct 23, 2021

    @nanjekyejoannah
    Contributor

    I posted on Python-dev (not sure if it will help), I wanted to do this in 2019 but looks like there is still no consensus yet.

  6. encukou commented on Oct 23, 2021

    @encukou
    Member

    It seems it could be moved to sysconfig itself -- the CLI options from python-config would fit there nicely.

  7. nanjekyejoannah commented on Oct 24, 2021

    @nanjekyejoannah
    Contributor

    Yes, this was also proposed here: https://bugs.python.org/issue11602

  8. gpshead commented on Oct 25, 2021

    @gpshead
    Member

    Misc/python-config.in ultimately becomes a Python script that prints things to stdout. It isn't written to be a module as is. Any work to make it one is effectively writing entirely new code to do what it does.

    To keep a single source of truth for python-config behavior instead of having two as we do today (as doko noted in bpo-16235), while still exposing the values it provides for use from Python I suggest:

    1. Get rid of the Misc/python-config.in python code.
    2. Use Misc/python-config.sh.in exclusively.
    3. Enhancing that to be able to generate a tiny data-only sysconfig.configure module.
    4. Invoke python-config.sh --generate-sysconfig-bits during build time to generate a sysconfig/configure.py.

    This should reduce the maintenance burden and is kinder to cross-compiliation builds (which we generally are lousy at supporting despite their importance to the world, so our bar today is merely "not regressing").


    All that said, in what contexts would having anything that python-config produces today be available from sysconfig be useful?

  9. transferred this issue fromon Apr 10, 2022
  10. encukou commented on Aug 21, 2023

    @encukou
    Member

    All that said, in what contexts would having anything that python-config produces today be available from sysconfig be useful?

    In contexts where your pythonX-config command doesn't match your Python. For example, in a venv.

  11. added
    3.13only security fixes
    and removed
    3.12only security fixes
    on Jan 5, 2024
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

    buildThe build process and cross-buildstdlibStandard Library Python modules in the Lib/ directorytopic-sysconfigtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions