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

2018-01-26 Thread Stephane Wirtel via Python-ideas
Hi Barry, Sometimes, I need to read the tests of a package because I don't understand the usage of a function/method/class and unfortunately, there is no documentation. In this case, and only in this case, I will try to find the tests and in the worst case, download the source and try to

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

2018-01-26 Thread Barry Warsaw
Guido van Rossum wrote: > IIUC another common layout is to have folders named test or tests inside > each package. This would avoid requiring any changes to the site-packages > layout. That's what I do for all my personal code. Yes, it means the test directories are shipped with the sdist, but

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

2018-01-22 Thread Nick Coghlan
On 20 January 2018 at 04:39, Chris Barker wrote: > So maybe the way to go is to come up with recommendations for a standard way > to do it -- maybe published by PyPa? I don't think the trade-offs here are clear enough for us to add an opinionated guide to

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

2018-01-19 Thread Chris Barker
On Fri, Jan 19, 2018 at 11:21 AM, Giampaolo Rodola' wrote: > > I personally include them in psutil distribution so that users can test > the installation with "python -m psutil.test". I have even this documented > as I think it's an added value. > or: pytest --pyargs

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

2018-01-19 Thread Giampaolo Rodola'
On Fri, Jan 19, 2018 at 5:23 PM, Paul Moore wrote: > Another common approach is to not ship tests as part of your (runtime) > package at all - they are in the sdist but not the wheels nor are they > deployed with "setup.py install". In my experience, this is the usual >

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

2018-01-19 Thread Chris Barker
hmm, 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

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

2018-01-19 Thread Paul Moore
On 19 January 2018 at 18:19, Stefan Krah wrote: > On Fri, Jan 19, 2018 at 05:30:43PM +, 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

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

2018-01-19 Thread Stefan Krah
On Fri, Jan 19, 2018 at 05:30:43PM +, 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

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

2018-01-19 Thread Petr Viktorin
FWIW, I've had very good experience with putting tests for package `foo` in a directory/package called `test_foo`. This combines the best of both worlds -- it can be easily separated for distribution (like `tests`), and it doesn't cause name conflicts (like `foo.tests`). On 01/19/2018

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

2018-01-19 Thread Paul Moore
On 19 January 2018 at 17:08, Stefan Krah wrote: > On Fri, Jan 19, 2018 at 04:23:23PM +, Paul Moore wrote: >> Another common approach is to not ship tests as part of your (runtime) >> package at all - they are in the sdist but not the wheels nor are they >> deployed with

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

2018-01-19 Thread Wolfgang Maier
On 01/19/2018 05:48 PM, Guido van Rossum wrote: On Fri, Jan 19, 2018 at 8:30 AM, Wolfgang Maier > wrote: I think that's a really nice idea. With an official site-packages/test directory there

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

2018-01-19 Thread Stefan Krah
On Fri, Jan 19, 2018 at 04:23:23PM +, Paul Moore wrote: > Another common approach is to not ship tests as part of your (runtime) > package at all - they are in the sdist but not the wheels nor are they > deployed with "setup.py install". In my experience, this is the usual > approach projects

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

2018-01-19 Thread Guido van Rossum
On Fri, Jan 19, 2018 at 8:30 AM, Wolfgang Maier < wolfgang.ma...@biologie.uni-freiburg.de> wrote: > > I think that's a really nice idea. > With an official site-packages/test directory there could be pip support > for optionally installing tests alongside a package if its layout allows > it. So

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

2018-01-19 Thread Wolfgang Maier
On 01/19/2018 03:27 PM, Stefan Krah wrote: Hello, I wonder if we could get an official site-packages/test directory. Currently it seems to be problematic to distribute tests if they are outside the package directory. Here is a nice overview of the two main layout possibilities:

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

2018-01-19 Thread Paul Moore
Another common approach is to not ship tests as part of your (runtime) package at all - they are in the sdist but not the wheels nor are they deployed with "setup.py install". In my experience, this is the usual approach projects take if they don't have the tests in the package directory. (I don't

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

2018-01-19 Thread Guido van Rossum
IIUC another common layout is to have folders named test or tests inside each package. This would avoid requiring any changes to the site-packages layout. On Fri, Jan 19, 2018 at 6:27 AM, Stefan Krah wrote: > > Hello, > > I wonder if we could get an official

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

2018-01-19 Thread Stefan Krah
Hello, I wonder if we could get an official site-packages/test directory. Currently it seems to be problematic to distribute tests if they are outside the package directory. Here is a nice overview of the two main layout possibilities: