On 10/21/21 8:55 PM, Michael Fladischer wrote:
> Hi,
> 
> I'm working on src:pytest-lazy-fixtures and was trying to get the
> unittests to run but it seems that I have run into a problem that I'm
> not sure on how to fix it in a clean way.
> 
> pytest-lazy-fixtures is a pytest plugin and registers itself through the
> Python entrypoints mechanism. In its unitests, it assumes that this
> registration has already happened but during dh_auto_test there is no
> .egg-info directory available. I could use "python3 setup.py develop -x"
> to generate it, but this registers the package in /usr inside the build
> chroot which I think is not the best solution.
> 
> Is there an other, less intrusive way to register the entrypoint before
> running the tests?
> 
> Thanks,
> Michael
> 

Hi Michael,

I do this in many of my packages (or a variation of this) to solve that
problem:

override_dh_install:
        python3 setup.py install --install-layout=deb \
                --root=$(CURDIR)/debian/tmp

ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
        PYTHONPATH=$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages \
                dh_auto_test
endif

        dh_install

override_dh_auto_test:
        echo "Do nothing..."

I hope this helps,
Cheers,

Thomas Goirand (zigo)

Reply via email to