Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to PyPI sdist #492

Closed
jayvdb opened this issue Oct 27, 2020 · 7 comments · Fixed by #494
Closed

Add tests to PyPI sdist #492

jayvdb opened this issue Oct 27, 2020 · 7 comments · Fixed by #494

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Oct 27, 2020

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).

@bnavigator
Copy link

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

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

@dyve
Copy link
Member

dyve commented Oct 27, 2020

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

@bnavigator
Copy link

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

@bnavigator
Copy link

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: python-poetry/poetry#1338)

@dyve
Copy link
Member

dyve commented Oct 27, 2020

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

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 27, 2020

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.

jayvdb added a commit to jayvdb/django-bootstrap3 that referenced this issue Oct 27, 2020
@dyve dyve closed this as completed in #494 Oct 28, 2020
dyve pushed a commit that referenced this issue Oct 28, 2020
@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 28, 2020

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.

darkmoon-joker added a commit to darkmoon-joker/django-bootstrap that referenced this issue Dec 13, 2023
codemachine0313 added a commit to codemachine0313/django-bootstrap3 that referenced this issue Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants