importlib_metadata: hopefully fix the build for good this time. (#9338)

The presence of HaikuPorter's work git repo interferes with the
operation of some python packages used at build time, causing
builds with "hp -G" to succeed, but fail without that flag, unless
these work-arounds are applied:

- exporting a `SETUPTOOLS_SCM_PRETEND_VERSION` variable
- `rm -rf dist`
This commit is contained in:
OscarL
2023-09-02 13:35:12 -03:00
committed by GitHub
parent c948cb067b
commit 0be177f1c2

View File

@@ -51,11 +51,21 @@ done
INSTALL()
{
# Needed due to the presence of HaikuPorter's work .git dir:
# setuptools_scm assumes that .git is from the project, and fails to get the info it needs
# generating wrong default value in that case.
export SETUPTOOLS_SCM_PRETEND_VERSION=$portVersion
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
python=python${PYTHON_VERSIONS[$i]}
# Needed to build without -G in the haikuporter build call.
# the presence of HaikuPorter's working .git dir seems to confuse
# some python's builds/packages.
rm -rf dist
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer -p $prefix dist/*.whl