Closed claudep closed 3 years ago
Now I'm blocked on how to use the system python3-xapian when running any python command...
I was finally able to set PYTHONPATH, but the system-installed python3-xapian is version specific, so it cannot be used with different Python versions. Looks like we have no other choice than building xapian in each test run, which is resource wasting IMHO.
Using #201 and actions/cache@v2
to cache the wheel, you'll have a better time.
- name: Check for cached xapian wheel
id: xapian-cache
uses: actions/cache@v2
with:
path: xapian*.whl
key: xapian-${{ matrix.xapian-version }}-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('xapian_wheel_builder.sh') }}
- name: Build xapian wheel
if: steps.xapian-cache.outputs.cache-hit != 'true'
run: |
./xapian_wheel_builder.sh ${{ matrix.xapian-version }}
This leads to a cache key that looks something like this:
xapian-1.4.9-Linux-/opt/hostedtoolcache/Python/3.6.14/x64-3102be70278fa7f0245c13c9aadfdd7c6caa11774c7374646652f70378e2887b
and a wheel named something like: xapian-1.4.9-cp36-cp36m-linux_x86_64.whl
Once you've built or pulled the wheel from cache, install as you would any wheel.
@asedeno, Now that #201 is in, do you want/have time to take this patch and finish it with the cached wheels?
@claudep, I've got something going on my fork, but the wheel builder does not bring along a xapian-delve
so the tests fail. I'll try to look into that.
I'd be grateful!
@claudep, here's what I have cooking:
xapian_wheel_builder.sh
will package the build's xapian-delve
along side the library and bindings.tests/xapian_tests/tests/test_backend.py
will learn to look for a xapian-delve
in the same path as the xapian
module, and if it finds one, it will use it.
I'm currently struggling to find the correct paths to copy files between django-haystack and xapian-haystack checkouts.