question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add tests to PyPI sdist

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jayvdbcommented, 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.

1reaction
jayvdbcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using TestPyPI - Python Packaging User Guide
Because TestPyPI has a separate database from the live PyPI, you'll need a separate user account specifically for TestPyPI. Go to https://test.pypi.org/account/ ...
Read more >
Building and Uploading to PyPi - The Sheer Joy of Packaging!
Make sure artifacts have been generated in the dist subdirectory. Exercise 3: Publish artifacts on PyPI¶. $ twine upload --repository-url https://test.pypi ...
Read more >
Create a PyPI (pip) package, test it and publish it using Github ...
This should create a new folder called dist in your current directory. Let's upload that folder using twine : python3 -m twine upload ......
Read more >
How to build, test and publish an open source Python library
Running the tests with GitHub Actions · Checkout the current repository · Install the specified Python version · Configure GitHub's action caching ...
Read more >
Publishing your Python packages on TestPyPi before ...
Uploading to TestPyPi · 1. Create an account on TestPyPi · 2. Update setup.py · 3. Build your package · 4. Upload your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found