Skip to content

Commit 1a9c385

Browse files
committed
build: try 3.12 xapian build again.
Well configure needs to be taught not to use imp library under 3.12 as imp doesn't exist anymore. Update sed script for configure to make the required modifications. This should work going back to 3.6 as the replacement: imp.gettag() -> sys.implementation.cache_tag imp.util.cache_from_source -> importlib.util.cache_from_source works in 3.6.9 at least and doc claims they were introduced in 3.2/3.4. Geesh what a pain. Good thing there was a dockerfile with 3.12rc2 I could use to debug this.
1 parent 103d196 commit 1a9c385

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/ci-test.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,17 @@ jobs:
204204
# 3.11 or newer.
205205
# Change distutils.sysconfig... to just sysconfig and SO
206206
# to EXT_SUFFIX to get valid value.
207-
if [[ $PYTHON_VERSION == "3."* ]]; then sed -i -e '/PYTHON3_SO=/s/distutils\.//g' -e '/PYTHON3_SO=/s/"SO"/"EXT_SUFFIX"/g' configure; ./configure --prefix=$VIRTUAL_ENV --with-python3 --disable-documentation; fi
208-
case "$PYTHON_VERSION" in nightly|3.12*) echo skipping xapian build;; *) make && sudo make install; esac
207+
if [[ $PYTHON_VERSION == "3."* ]]; then \
208+
sed -i \
209+
-e '/PYTHON3_SO=/s/distutils\.//g' \
210+
-e '/PYTHON3_SO=/s/"SO"/"EXT_SUFFIX"/g' \
211+
-e '/PYTHON3_CACHE_TAG=/s/imp;print(imp.get_tag())/sys;print(sys.implementation.cache_tag)/' \
212+
-e '/PYTHON3_CACHE_OPT1_EXT=/s/imp\.get_tag()/sys.implementation.cache_tag/g' \
213+
-e '/PYTHON3_CACHE_OPT1_EXT=/s/imp\b/importlib/' \
214+
configure; \
215+
./configure --prefix=$VIRTUAL_ENV --with-python3 --disable-documentation; \
216+
fi
217+
case "$PYTHON_VERSION" in nightly) echo skipping xapian build;; *) make && sudo make install; esac
209218

210219
- name: Install pytest and other packages needed for running tests
211220
run: pip install flake8 mock pytest pytest-cov requests

0 commit comments

Comments
 (0)