Verifying that pytest works correctly against an sdist

I’m a maintainer of rdflib, we recently made some changes to how we build our release artifacts (sdist and wheel), and this seems to have caused some problems for https://github.com/conda-forge/rdflib-feedstock [ref]. We fixed some of the problems [[ref]], but there are still more.

To ensure that all problems are fixed and to prevent future problems, I would like to run test from the sdists, but I’m actually not that clear on how you do this. If I just install the sdist, this does not install the tests. I can just extract the sdist and then run the files, but I’m not sure if this is what you do for the rdflib-feedstock.

I also don’t see anything that would help me understand what is happening in the github actions logs. Presumably what is happening is guided by recipe/meta.yaml - but I’m not sure how exactly.

I would appreciate it if someone could give me some details, so I can replicate this process to ensure things work as they should, and potentially even integrate it into the CI pipeline of RDFLib.

I did not notice the link to Azure pipelines at first, that somewhat answers my question. To actually test the sdist I am now using this process. Any feedback on it will be welcome.

I’m a bit confused as to what the issue is.

the conda-build recipe simply calls pip install – so if your sdist can be pip installed, then it should work.

I presume you’ve got other tests for that, but if not, then in the CI, you should be able to simply build the sdist, then install it and run your tests.

You shouldn’t need to add the tests to the sdists to do this, as the code is all there in the repo.

I’m not a poetry user, but it looks like this would do it:

poetry build -f sdist

(that should create a tarball somewhere – probably in the dist dir)

pip install dist/name_of_sdist

then:

pytest --pyargs rdflib

BTW: you can get pretty far debugging issues in the recipe by running conda-build on your own machine.

Also – I’m still a bit confused about poetry vs pip – but you could presumably run poetry install in the conda-forge recipe instead.

HTH

BTW, if you are distributing this on PyPi, then if folks can pip install it from PyPi, then conda-build should work, too.