Repository navigation
python-config code should be in sysconfig #55811
Description
Activity
python-config has the following non-trivial code for discovery of cflags/ldflags, which should be callable as a sysconfig API instead:
elif opt in ('--includes', '--cflags'): flags = ['-I' + sysconfig.get_path('include'), '-I' + sysconfig.get_path('platinclude')] if opt == '--cflags': flags.extend(getvar('CFLAGS').split()) print(' '.join(flags)) elif opt in ('--libs', '--ldflags'): libs = getvar('LIBS').split() + getvar('SYSLIBS').split() libs.append('-lpython' + pyver + sys.abiflags) # add the prefix/lib/pythonX.Y/config dir, but only if there is no # shared library in prefix/lib/. if opt == '--ldflags': if not getvar('Py_ENABLE_SHARED'): libs.insert(0, '-L' + getvar('LIBPL')) libs.extend(getvar('LINKFORSHARED').split()) print(' '.join(libs))Also, it begs the question why distutils doesn't use the same code in its compiler class, or even in customize_compiler()...
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Mar 18, 2011 - addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Mar 18, 2011 +1
+1 on the request. I don’t think it can go in 3.2, though. I’ll propose a patch, this will let me learn more about the flags.
Also, it begs the question why distutils doesn't use the same code in
its compiler class, or even in customize_compiler()...Certainly because distutils pre-dates python-config. In packaging, we should certainly use sysconfig functions.
- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directoryand removedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Jun 18, 2011 @eric.araujo curious if you still have the interest to work on this. If not, I can help open a PR.
I don’t have specific expertise in this, so please take it!
- addedbuildThe build process and cross-buildThe build process and cross-build3.11only security fixesonly security fixesand removedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Oct 23, 2021 I can help out, but would like to wait until we get a resolution in python/issues-test-cpython#25718 as it will likely conflict.
Closing as duplicate of more recent issue, which has more up to date discussion.
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:
bugs.python.org fields: