Use sysconfig for Python module locations#5423
Conversation
|
Ok, appveyor is failing. I'll need to look into this with a separate dummy PR |
|
Pointed appveyor to |
| # use the exact one discovered by CMake. | ||
| PYTHON=`cat build/CMake_Python3_EXECUTABLE` | ||
| PYTHONPATH=$PYTHONPATH:$PREFIX/$($PYTHON -c "import distutils.sysconfig as sc; print(sc.get_python_lib(prefix='', plat_specific=True,standard_lib=False))") | ||
| PYTHONPATH=$PYTHONPATH:$PREFIX/$($PYTHON -c "import sysconfig as sc; print(sc.get_path('platlib', sc.get_preferred_scheme('user'), vars={'userbase': '.'}))") |
There was a problem hiding this comment.
Same comment as on the fontforgebuilds pr, I think this should be
| PYTHONPATH=$PYTHONPATH:$PREFIX/$($PYTHON -c "import sysconfig as sc; print(sc.get_path('platlib', sc.get_preferred_scheme('user'), vars={'userbase': '.'}))") | |
| PYTHONPATH=$PYTHONPATH:$PREFIX/$($PYTHON -c "import sysconfig as sc; print(sc.get_path('platlib', sc.get_preferred_scheme('prefix'), vars={'platbase': '.'}))") |
There was a problem hiding this comment.
Please see jtanx/fontforgebuilds#21 (comment)
Unfortunately
'prefix'key is inconsistent across platforms. On MacOS the preferred scheme forprefixisosx_framework_library, and its platlib entry looks like'platlib': '/usr/local/{platlibdir}/python{py_version_short}/site-packages'This forces absolute path (which is discouraged by CMake) and the variable names are different for each platform. You can check this at https://github.com/iorsh/fontforge/actions/runs/9223726161/ - see the "Run pyhook smoke test" entry for Mac and Linux
f76eb53 to
7e3a2be
Compare
|
@jtanx, do you want any additional changes here? Could you please merge if this is ok with you? |
skef
left a comment
There was a problem hiding this comment.
This is a little scary but I suppose since it's CI stuff the results should be self-evident. If you give me the go-ahead I'll merge.
|
Woops, forgot to reply to this one. I think there may have still been something but I've forgotten now, so if it builds, send it |
distutils is deprecated with removal planned for Python 3.12.
This change is necessary to update CI to macos-12, which doesn't have Python 3.10.
TODO: Revert
iorsh/fontforgebuildsrepo before merge and after jtanx/fontforgebuilds#21 is merged into fontforgebuilds