Re: pybuild: where to put --test-pytest?

2014-03-15 Thread Barry Warsaw
On Mar 15, 2014, at 12:06 AM, Piotr Ożarowski wrote:

>In distutils build plugin, pybuild already checks for "test_suite" in
>setup.py (which apparently is not the only case where 
>`{interpreter} setup.py test` should be invoked), invokes
>`{interpreter} -m unittest discover -v`... but only for some interpreter
>versions or nose/pytest/tox equivalents (which you have enable because,
>guess what, it's not that obvious when you can use one instead of the
>other).
>
>Please try to convince upstream authors to use ONE AND ONLY ONE
>interface.

Sigh.  I've tried.  I've also tried to get the PEP 426, etc. crowd to consider
adding test-specific metadata, but was told that it was off the table for now.
I hope to bring this up again at the upcoming Pycon 2014.  I could use some
allies :).

-Barry


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140315132404.521f3...@limelight.wooz.org



Re: Compiled C modules are not found by test suite (Was: Help needed for python-biopython which splits up modules into two packages per Python version)

2014-03-15 Thread Éric Araujo

Le 15/03/2014 07:52, Piotr Ożarowski a écrit :

The problem is package's root directory has higher priority on sys.path
and your package has both Bio and BioSQL it there (instead of in src or lib
directory, like other upstreams do... you know... "Python standards")


  Sure, a part of the community puts code in src or lib, but that’s not 
the majority of packages I have seen.  I don’t think there is one 
standard for that.


  Regards


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/532472c6.10...@netwok.org



Re: Selecting python-flask vs python3-flask

2014-03-15 Thread Thomas Goirand
On 03/15/2014 07:39 PM, Mathieu Malaterre wrote:
> [CC me please]
> 
> Hi,
> 
>   I am trying to work on :
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=740907
> 
>   Basically I have an example package (dh_installexamples) which needs
> to depends on python-flask. Depending whether my users installed
> python3-openslide or python-openslide, I need to Recommends on
> python3-flask or (exclusive) python-flask.
> 
>   I have not figure out how to do that. I could not find anything like
> this in the doc.
> 
> Thanks for help,

Why wouldn't you recommend both?

Also, if these really are examples, they should be treated as
documentation somehow, not as a library, and therefore, I don't see why
the severity for #740907 should be "grave". The package is perfectly
useable: one can read the source code... I'd downgrade the severity to
wishlist (unless I completely misunderstood the purpose of this
-examples package).

Thomas Goirand (zigo)


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/532470b7.3000...@debian.org



Re: Compiled C modules are not found by test suite (Was: Help needed for python-biopython which splits up modules into two packages per Python version)

2014-03-15 Thread Piotr Ożarowski
[Éric Araujo, 2014-03-15]
> Hi,
> 
> >>   I tried the first solution and did not see a difference in tests:
> >>both times, 223 tests were run successfully.  I’d like to reproduce
> >>the errors you mention to be sure that any change I make is actually
> >>a fix.
> >
> >I guess this is the solution since if the C modules are not found the
> >test is just skipped (and does not fail).
> 
> I expected to see fewer tests run when the C modules are found.  I was not
> able to find one example test that runs if a C module is found and skipped
> if not.
> 
> >If you could provide this very patch I'd be really glad.
> 
> Run “python build_ext --inplace build test” for tests, “python install” to
> copy all files to the debian/tmp/etc directory.  This will avoid the other
> bug I mention (http://bugs.python.org/issue5977#msg213606).
> 
> I did not use the debian/rules makefile, but modifying line 45 to add
> “build_ext --inplace build” before “test” should do the trick.
> 
> (Putting the option in a setup.cfg file as I initially advised would cause
> the error I alluded to when running “setup.py install”.)

pybuild takes care of "distutils cannot find files it build in previous
step and has to build them again" problem. I just checked
python-biopython and all .so files are in the right location
(yey pybuild! :).

The problem is package's root directory has higher priority on sys.path
and your package has both Bio and BioSQL it there (instead of in src or lib
directory, like other upstreams do... you know... "Python standards")

anyway, that's one of the reasons I do this in pybuild:

  cd BUILD_DIRECTORY; run_tests

this way files from you package's root directory are not taken into account.

To fix your problem apply this change (not tested, because clean target
is not doing the right thing and I'm too lazy to fix it):

-   dh_auto_test -- --test --system=custom --test-args='env 
DIALIGN2_DIR=/usr/share/dialign EMBOSS_ROOT=/usr/lib/emboss 
PYTHONPATH={build_dir} {interpreter} setup.py test'
+   dh_auto_test -- --test --system=custom --test-args='env 
DIALIGN2_DIR=/usr/share/dialign EMBOSS_ROOT=/usr/lib/emboss; cd {build_dir}; 
{interpreter} setup.py test'

-- 
Piotr Ożarowski Debian GNU/Linux Developer
www.ozarowski.pl  www.griffith.cc   www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645


signature.asc
Description: Digital signature


Selecting python-flask vs python3-flask

2014-03-15 Thread Mathieu Malaterre
[CC me please]

Hi,

  I am trying to work on :

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=740907

  Basically I have an example package (dh_installexamples) which needs
to depends on python-flask. Depending whether my users installed
python3-openslide or python-openslide, I need to Recommends on
python3-flask or (exclusive) python-flask.

  I have not figure out how to do that. I could not find anything like
this in the doc.

Thanks for help,
-- 
Mathieu


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CA+7wUsyWCYd2qkjy=koSz241PRyrsis2CKQQV-tEv-10=dt...@mail.gmail.com



Re: Compiled C modules are not found by test suite (Was: Help needed for python-biopython which splits up modules into two packages per Python version)

2014-03-15 Thread Julian Taylor
On 15.03.2014 00:15, Éric Araujo wrote:
>   Hello,
> 
>   I got the code and the debian directory.  I confirmed that extension
> modules are in the build directory, not alongside the Python modules, so
> they can’t be imported from tests.
> 
>   There are two ways to fix that: either make distutils build the
> extensions alongside the Python modules, or make the test import all
> code from the build directory.  I’m surprised that this isn’t a common
> issue for PMPT.
> 

a typical approach is to not test in dh_auto_test but to install and
then test from debian/tmp by setting PYTHONPATH


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/532430c0.9030...@googlemail.com



Re: Compiled C modules are not found by test suite (Was: Help needed for python-biopython which splits up modules into two packages per Python version)

2014-03-15 Thread Éric Araujo

Hi,


   I tried the first solution and did not see a difference in tests:
both times, 223 tests were run successfully.  I’d like to reproduce
the errors you mention to be sure that any change I make is actually
a fix.


I guess this is the solution since if the C modules are not found the
test is just skipped (and does not fail).


I expected to see fewer tests run when the C modules are found.  I was 
not able to find one example test that runs if a C module is found and 
skipped if not.



If you could provide this very patch I'd be really glad.


Run “python build_ext --inplace build test” for tests, “python install” 
to copy all files to the debian/tmp/etc directory.  This will avoid the 
other bug I mention (http://bugs.python.org/issue5977#msg213606).


I did not use the debian/rules makefile, but modifying line 45 to add 
“build_ext --inplace build” before “test” should do the trick.


(Putting the option in a setup.cfg file as I initially advised would 
cause the error I alluded to when running “setup.py install”.)


Cheers


--
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/53242318.4090...@netwok.org



Re: Compiled C modules are not found by test suite (Was: Help needed for python-biopython which splits up modules into two packages per Python version)

2014-03-15 Thread Andreas Tille
Hi Éric,

On Fri, Mar 14, 2014 at 07:15:26PM -0400, Éric Araujo wrote:
>   There are two ways to fix that: either make distutils build the
> extensions alongside the Python modules, or make the test import all
> code from the build directory.  I’m surprised that this isn’t a
> common issue for PMPT.

+1

I admit that I was somehow afraid to ask a FAQ and a quite simple answer
to it since running test suitws should be normal and there are several
packages containing C modules.
 
>   I tried the first solution and did not see a difference in tests:
> both times, 223 tests were run successfully.  I’d like to reproduce
> the errors you mention to be sure that any change I make is actually
> a fix.

I guess this is the solution since if the C modules are not found the
test is just skipped (and does not fail).  If you could provide this
very patch I'd be really glad.
 
>   Unfortunately, there is a long-standing bug in distutils where
> extensions modules built alongside the Python modules are not found
> by the install command.  This means that you’d have to compile twice
> (once in-place to run the tests, one to a build directory to install
> to debian/tmp/etc.), or that you’d prefer the other fix.

I think I'll try what you tested to get 223 tests running and see how
far this helps.

Kind regards

 Andreas.

-- 
http://fam-tille.de


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140315094319.gg15...@an3as.eu