classification
Title: sysconfig's osx_framework_user puts headers in different locations from distutils
Type: behavior Stage:
Components: Library (Lib), macOS Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, ronaldoussoren, uranusjr
Priority: normal Keywords:

Created on 2021-04-27 07:53 by uranusjr, last changed 2021-04-30 22:16 by terry.reedy.

Messages (1)
msg392037 - (view) Author: Tzu-ping Chung (uranusjr) * Date: 2021-04-27 07:53
When built in framework mode on macOS, distutils puts user-site headers under `{userbase}/include/python{py_version_short}{abiflags}`:

>>> import sys
>>> print(sys.platform, sys._framework)
darwin Python
>>> from distutils.dist import Distribution
>>> c = Distribution().get_command_obj('install')
>>> c.user = True
>>> c.finalize_options()
>>> print(c.install_headers)
/Users/uranusjr/Library/Python/3.9/include/python3.9/UNKNOWN

But sysconfig lacks the `pythonX.Y` part:

>>> import sysconfig
>>> print(sysconfig.get_path('include', scheme='osx_framework_user'))
/Users/uranusjr/Library/Python/3.9/include

This is inconsistent to all other schemes, such as `posix_user` (tested on the `python:3.9-slim` OCI image):

>>> import sys
>>> print(sys.platform, sys._framework)
linux
>>> from distutils.dist import Distribution
>>> c = Distribution().get_command_obj('install')
>>> c.user = True
>>> c.finalize_options()
>>> print(c.install_headers)
/root/.local/include/python3.9/UNKNOWN
>>> import sysconfig
>>> print(sysconfig.get_path('include', scheme='posix_user'))
/root/.local/include/python3.9

Note that the paths on `posix_user` only differs by one component (`UNKNOWN`, which is the distribution name), but `osx_framework_user` differs by two.
History
Date User Action Args
2021-04-30 22:16:45terry.reedysettitle: sysconfig’s osx_framework_user puts headers in different locations from distutils -> sysconfig's osx_framework_user puts headers in different locations from distutils
versions: - Python 3.6, Python 3.7, Python 3.8, Python 3.9, Python 3.11
2021-04-27 08:20:33uranusjrsetnosy: + ronaldoussoren, ned.deily
type: behavior
components: + macOS
2021-04-27 07:53:25uranusjrcreate