Django-bootstrap3: Add tests to PyPI sdist

Created on 27 Oct 2020  ·  7Comments  ·  Source: zostera/django-bootstrap3

Distros need to run tests before promoting packages, and this is especially important here. Without tests in the PyPI sdist, we need to fetch the tarball from github, and then we need to rely on poetry to build the package. While poetry is a pretty decent tool for development, it is a lot more cumbersome and error prone than using raw setuptools.

As you are already releasing wheels on PyPI, adding tests to the sdist wont impact most users who will be fetching the wheels via pip, but it will make packagers lives a bit easier.

c.f. https://build.opensuse.org/request/show/844174

If that link stops working, you can see my initial packaging at https://build.opensuse.org/package/view_file/devel:languages:python:django/python-django-bootstrap3/python-django-bootstrap3.spec?expand=1&rev=364ea37ba17ad34941623d7a5701551f , where I use a few sed commands to sanitise the pyproject.toml, and then use @dephell to convert the pyproject.toml to setup.py , so that the GitHub tarball build can be done using the same toolchain as if it was a PyPI released sdist. We have only recently got poetry working on openSUSE Tumbleweed (we had to bootstrap it using dephell until recently), and it hasnt been released as part of any openSUSE release.
You can see how few distros are actually keeping up with poetry releases at https://repology.org/project/python:poetry-core/versions , and a few more appear on https://repology.org/project/python:poetry/versions (poetry now depends on poetry-core, so discrepancies in those lists suggests those distros are not keeping up with poetry releases).

Most helpful comment

poetry is great for use within development projects. Probably the best in my experience, at least from a usability & simplicity perspective. I'll try to get it to emit the tests into the sdist.

All 7 comments

https://build.opensuse.org/request/show/844174#comment-1341223

Please at least move to poetry-core as build backend.

Maybe I should just get rid of poetry. Too much magic?

poetry(-core) is a valid PEP517 backend and nothing should stop you to use it.

The fact that you are publishing a poetry generated setup.py in the sdist is actually enough: https://build.opensuse.org/request/show/844269

Please just include the tests into the sdist (but make sure that setuptools does not install them as package, when setup.py install is called. I do not know how to achieve this, maybe this is related: https://github.com/python-poetry/poetry/issues/1338)

Thanks @bnavigator. I'm considering reverting the choice for poetry because I feel uncomfortable not understanding everything that it does (not) do.

poetry is great for use within development projects. Probably the best in my experience, at least from a usability & simplicity perspective. I'll try to get it to emit the tests into the sdist.

Thanks @dyve . No need to push out a new release - @bnavigator has already got the current version packaged for openSUSE. We'll take advantage of this for the next release.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kutera picture kutera  ·  8Comments

Macainian picture Macainian  ·  6Comments

radzhome picture radzhome  ·  4Comments

kodeshpa picture kodeshpa  ·  3Comments

maanbsat picture maanbsat  ·  3Comments