Poetry: Packages distributed on PyPi don't have tests

Created on 11 Jan 2019  路  11Comments  路  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Question

After examining the tarballs from PyPi for packages that use poetry none of them had their tests distributed.

Because of this occurrence I was wondering if that behavior was being enforced somehow here.

Most helpful comment

Packages for Gentoo Linux also support a dedicated testing phase for the exact reasons @worldofpeace mentioned above.

All 11 comments

Where are your tests in your source tree ?

If they are in a specific directory, I've solved a similar issue by adding to my pyproject.toml:

packages = [
    { include = "myproject"},
    { include = "migrations"},
    { include = "etc"},
    { include = "tests"},
    { include = "scripts"},
]

Where are your tests in your source tree ?

This is actually a problem for me packaging poetry and its dependents.
And their tests tend to be at tests/.

If they are in a specific directory, I've solved a similar issue by adding to my pyproject.toml:

That appears to possibly be a solution? Maybe @sdispater could add that to all their pyproject.toml?

@worldofpeace Poetry does not package the tests directory in the release tarballs so you have to package them explicitly like @sfermigier said.

@sdispater certain distributions of Linux, specifically Debian is the main one I am aware of, require that they build debian package using the source tarball, and having tests in that source tarball allows them to run tests to verify the package was installed successfully.

The complaint here isn't for projects using poetry but that poetry itself does not ship a source tarball with tests and thus it is harder to package.

Yes this is useful for downstream distributions to test if the package works correctly with their build recipe. Also, it provides a great way to test if the dependencies packaged by the distribution are compatible.

I recently reviewed and merged this package for NixOS and we have that same policy as Debian.

Packages for Gentoo Linux also support a dedicated testing phase for the exact reasons @worldofpeace mentioned above.

Since there are many distros that would greatly appreciate having these tests would you accept my prs to add what sfermigier has suggested @sdispater?

A related problem is #1067 in which I'm trying to include the tests only into the source distribution, not into the wheel.

1133 added the ability to add different packages (like tests) for different formats. Poetry will not do so automatically聽since the tests don't necessarily reside in a tests directory. It's the responsibility of the project maintainers to specify that the sdist should contain the tests package聽

Thanks for adding this feature @sdispater

Thanks, though the issue here was that I was requesting if poetry and related packages (it's dependents) authored by you @sdispater could include the tests like that in the sdist.

Was this page helpful?
0 / 5 - 0 ratings