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

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

Open
pitrou opened this issue May 7, 2018 · 8 comments
Open

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

pitrou opened this issue May 7, 2018 · 8 comments
Labels
3.13 bugs and security fixes build The build process and cross-build stdlib Python modules in the Lib dir topic-sysconfig type-feature A feature request or enhancement

Comments

@pitrou
Copy link
Member

pitrou commented May 7, 2018

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']

@pitrou
Copy link
Member Author

pitrou commented May 7, 2018

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.

@pitrou pitrou added 3.8 (EOL) end of life build The build process and cross-build stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels May 7, 2018
@doko42
Copy link
Member

doko42 commented Jul 27, 2019

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.

@shihai1991
Copy link
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.

@nanjekyejoannah
Copy link
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.

@encukou
Copy link
Member

encukou commented Oct 23, 2021

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

@nanjekyejoannah
Copy link
Contributor

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

@gpshead
Copy link
Member

gpshead commented Oct 25, 2021

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?

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@FFY00 FFY00 added 3.12 bugs and security fixes topic-sysconfig and removed 3.8 (EOL) end of life labels Apr 3, 2023
@encukou
Copy link
Member

encukou commented Aug 21, 2023

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.

@erlend-aasland erlend-aasland added 3.13 bugs and security fixes and removed 3.12 bugs and security fixes labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes build The build process and cross-build stdlib Python modules in the Lib dir topic-sysconfig type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

8 participants