[Python-ideas] Official site-packages/test directory

Chris Barker chris.barker at noaa.gov
Fri Jan 19 13:39:12 EST 2018


I've struggled for ages with this problem -- I have some packages with
REALLY big test suites. so I don't put the tests in the package.

But their are also numerous issues with building and installing the package
(C code, lots of dependencies, etc), so it would be really nice to have a
way to test the actual installed package after the fact (and, be able to
properly test conda packages as well -- easy if the tests are in the
package, hard if not...)

So I like the idea of having a standard way / place to install tests.

However, somehow I never thought to make a my_package_tests package --
d'uh! seems the obvious way to handle teh "optionally install the tests"

I still like the idea of separate location, but Paul is right that it's a
change that would have to filter out through a lot of infrastructure, so
maybe not practical.

So maybe the way to go is to come up with recommendations for a standard
way to do it -- maybe published by PyPa?


On Fri, Jan 19, 2018 at 10:19 AM, Stefan Krah <stefan at bytereef.org> wrote:

> On Fri, Jan 19, 2018 at 05:30:43PM +0000, Paul Moore wrote:
> [cut]
> > I'd think that the idea of a site-packages/stest directory would need
> > a much more compelling use case to justify it.
> Thanks for the detailed explanation!  It sounds that there's much more work
> involved than I thought, so it's probably better to drop this proposal.
> > PS There's nothing stopping a (distribution) package FOO from
> > installing (Python) packages foo and foo-tests. It's not common, and
> > probably violates people's expectations, but it's not *illegal* (the
> > setuptools distribution installs pkg_resources as well as setuptools,
> > for a well-known example). So in theory, if people wanted this enough,
> > they could have implemented it right now, without needing any change
> > to Python or the packaging ecosystem.
> If people don't come with pitchforks, that's a good solution. I suspected
> that people would complain both if foo-tests were installed automatically
> like pkg_resources but also if foo-tests were a separate optional package
> (too much hassle).
> Stefan Krah
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180119/4dfe232b/attachment.html>

More information about the Python-ideas mailing list