Problem with python-package - test run

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with python-package - test run

Axel Braun-2
Hi all,

I was recently building new modules for the tryton-server.
One of the modules runs a test-script:

%check
python setup.py test

Problem: Unlike the installation, which takes all resources from the
repository (e.g. the server module trytond), the test wants to download this
from pypi:

[   39s] + python setup.py test
[   39s] running test
[   39s] Searching for trytond>=3.8,<3.9
[   39s] Reading https://pypi.python.org/simple/trytond/
[   39s] Download error on https://pypi.python.org/simple/trytond/: [Errno -2]
Name or service not known -- Some packages may not be found!
[   39s] Couldn't find index page for 'trytond' (maybe misspelled?)
[   39s] Scanning index of all packages (this may take a while)
[   39s] Reading https://pypi.python.org/simple/
[   39s] Download error on https://pypi.python.org/simple/: [Errno -2] Name or
service not known -- Some packages may not be found!
[   39s] No local packages or download links found for trytond>=3.8,<3.9
[   39s] error: Could not find suitable distribution for
Requirement.parse('trytond>=3.8,<3.9')
[   39s] error: Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)
[   39s]
[   39s]
[   39s] RPM build errors:
[   39s]     Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)

The idea to add trytond as build requirement did not help either, as this
produces dome other funny error messages (about some missing mysql-stuff -
which I see first time now)

Is there a way to tell the test to *not* download from pypi, but to use local
resources instead?

Thanks
Axel
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with python-package - test run

Benjamin Denisart
On 11/14/2015 11:04 PM, Axel Braun wrote:

> Hi all,
>
> I was recently building new modules for the tryton-server.
> One of the modules runs a test-script:
>
> %check
> python setup.py test
>
> Problem: Unlike the installation, which takes all resources from the
> repository (e.g. the server module trytond), the test wants to download this
> from pypi:
>
> [   39s] + python setup.py test
> [   39s] running test
> [   39s] Searching for trytond>=3.8,<3.9
> [   39s] Reading https://pypi.python.org/simple/trytond/
> [   39s] Download error on https://pypi.python.org/simple/trytond/: [Errno -2]
> Name or service not known -- Some packages may not be found!
> [   39s] Couldn't find index page for 'trytond' (maybe misspelled?)
> [   39s] Scanning index of all packages (this may take a while)
> [   39s] Reading https://pypi.python.org/simple/
> [   39s] Download error on https://pypi.python.org/simple/: [Errno -2] Name or
> service not known -- Some packages may not be found!
> [   39s] No local packages or download links found for trytond>=3.8,<3.9
> [   39s] error: Could not find suitable distribution for
> Requirement.parse('trytond>=3.8,<3.9')
> [   39s] error: Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)
> [   39s]
> [   39s]
> [   39s] RPM build errors:
> [   39s]     Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)
>
> The idea to add trytond as build requirement did not help either, as this
> produces dome other funny error messages (about some missing mysql-stuff -
> which I see first time now)
>
> Is there a way to tell the test to *not* download from pypi, but to use local
> resources instead?
>
> Thanks
> Axel
Link to your package ?
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with python-package - test run

Axel Braun-2
Am Samstag, 14. November 2015, 23:07:32 schrieb Benjamin Denisart:

> On 11/14/2015 11:04 PM, Axel Braun wrote:
> > Hi all,
> >
> > I was recently building new modules for the tryton-server.
> > One of the modules runs a test-script:
> >
> > %check
> > python setup.py test
> >
> > Problem: Unlike the installation, which takes all resources from the
> > repository (e.g. the server module trytond), the test wants to download
> > this from pypi:
> >
> > [   39s] + python setup.py test
> > [   39s] running test
> > [   39s] Searching for trytond>=3.8,<3.9
> > [   39s] Reading https://pypi.python.org/simple/trytond/
> > [   39s] Download error on https://pypi.python.org/simple/trytond/: [Errno
> > -2] Name or service not known -- Some packages may not be found!
> > [   39s] Couldn't find index page for 'trytond' (maybe misspelled?)
> > [   39s] Scanning index of all packages (this may take a while)
> > [   39s] Reading https://pypi.python.org/simple/
> > [   39s] Download error on https://pypi.python.org/simple/: [Errno -2]
> > Name or service not known -- Some packages may not be found!
> > [   39s] No local packages or download links found for trytond>=3.8,<3.9
> > [   39s] error: Could not find suitable distribution for
> > Requirement.parse('trytond>=3.8,<3.9')
> > [   39s] error: Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)
> > [   39s]
> > [   39s]
> > [   39s] RPM build errors:
> > [   39s]     Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)
> >
> > The idea to add trytond as build requirement did not help either, as this
> > produces dome other funny error messages (about some missing mysql-stuff -
> > which I see first time now)
> >
> > Is there a way to tell the test to *not* download from pypi, but to use
> > local resources instead?
>
> Link to your package ?

I tried a
osc linkpac Application:ERP:Tryton:3.8 trytond Application:ERP:Tryton:3.8
trytond_customs
...but that did not help

Thanks
Axel
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with python-package - test run

Claudio Freire
On Sat, Nov 14, 2015 at 7:41 PM, Axel Braun <[hidden email]> wrote:

> Am Samstag, 14. November 2015, 23:07:32 schrieb Benjamin Denisart:
>> On 11/14/2015 11:04 PM, Axel Braun wrote:
>> > Hi all,
>> >
>> > I was recently building new modules for the tryton-server.
>> > One of the modules runs a test-script:
>> >
>> > %check
>> > python setup.py test
>> >
>> > Problem: Unlike the installation, which takes all resources from the
>> > repository (e.g. the server module trytond), the test wants to download
>> > this from pypi:
>> >
>> > [   39s] + python setup.py test
>> > [   39s] running test
>> > [   39s] Searching for trytond>=3.8,<3.9
>> > [   39s] Reading https://pypi.python.org/simple/trytond/
>> > [   39s] Download error on https://pypi.python.org/simple/trytond/: [Errno
>> > -2] Name or service not known -- Some packages may not be found!
>> > [   39s] Couldn't find index page for 'trytond' (maybe misspelled?)
>> > [   39s] Scanning index of all packages (this may take a while)
>> > [   39s] Reading https://pypi.python.org/simple/
>> > [   39s] Download error on https://pypi.python.org/simple/: [Errno -2]
>> > Name or service not known -- Some packages may not be found!
>> > [   39s] No local packages or download links found for trytond>=3.8,<3.9
>> > [   39s] error: Could not find suitable distribution for
>> > Requirement.parse('trytond>=3.8,<3.9')
>> > [   39s] error: Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)
>> > [   39s]
>> > [   39s]
>> > [   39s] RPM build errors:
>> > [   39s]     Bad exit status from /var/tmp/rpm-tmp.IMguh4 (%check)
>> >
>> > The idea to add trytond as build requirement did not help either, as this
>> > produces dome other funny error messages (about some missing mysql-stuff -
>> > which I see first time now)
>> >
>> > Is there a way to tell the test to *not* download from pypi, but to use
>> > local resources instead?
>>
>> Link to your package ?
>
> I tried a
> osc linkpac Application:ERP:Tryton:3.8 trytond Application:ERP:Tryton:3.8
> trytond_customs
> ...but that did not help


I think the suggestion was to link the mysql stuff into your package
and add it as build requires.

And if it wasn't that, I'd suggest that ;-)

Or just add it as build requirement without linking if it's in your
base repository.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with python-package - test run

Jason Craig-3
In reply to this post by Axel Braun-2
On 11/14/2015 03:41 PM, Axel Braun wrote:

> Am Samstag, 14. November 2015, 23:07:32 schrieb Benjamin Denisart:
>> On 11/14/2015 11:04 PM, Axel Braun wrote:
>>> Hi all,
>>>
>>> I was recently building new modules for the tryton-server.
>>> One of the modules runs a test-script:
>>>
>>> %check
>>> python setup.py test
>>>
>>> Problem: Unlike the installation, which takes all resources from the
>>> repository (e.g. the server module trytond), the test wants to download
>>> this from pypi:
>>>
>>> [   39s] + python setup.py test
>>> [   39s] running test
>>> [   39s] Searching for trytond>=3.8,<3.9
>>> [   39s] Reading https://pypi.python.org/simple/trytond/
>>> [   39s] Download error on https://pypi.python.org/simple/trytond/: [Errno
>>> -2] Name or service not known -- Some packages may not be found!
...
>>> The idea to add trytond as build requirement did not help either, as this
>>> produces dome other funny error messages (about some missing mysql-stuff -
>>> which I see first time now)
>>>
>>> Is there a way to tell the test to *not* download from pypi, but to use
>>> local resources instead?

Basically tests in Python packages sometimes have requirements that the
package itself doesn't need to run. A common example of this is
python-nose, this package is made for tests, but the end user doesn't
really need it installed unless they want to run the package's tests
themselves (rather uncommon). So BuildRequires: python-nose would be
added, but not Requires: python-nose.

In your case however, I think that trytond is probably required for the
package to run as well as to be tested. Once you add trytond to
Requires, then the test run gets a little further but now doesn't have
whatever the mysql requirement the package needs, so that's why that is
showing up for the first time. The setuptools process will quit on the
first package it needs that isn't found, it won't give you a complete
list of missing packages.

I would check the package's setup.py to see what the "install_requires"
packages are and add all these to the Requires for your package. Also
sometimes whoever made the Python package didn't accurately set
"install_requires", so you have to dig around in documentation or by
trial and error to see what packages are going to be required to
test/run the package.

Also it is possible that the trytond package, not the package you are
working on, does not have the proper Requires set, so that the missing
mysql stuff OBS is complaining about is really something that should be
included with trytond.

>> Link to your package ?
>
> I tried a
> osc linkpac Application:ERP:Tryton:3.8 trytond Application:ERP:Tryton:3.8
> trytond_customs
> ...but that did not help

I think maybe he was asking for a URL to the package on OBS so he could
look at the package himself?

--
Jason Craig
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with python-package - test run

Benjamin Denisart
On 11/17/2015 07:39 PM, Jason Craig wrote:
>
> I think maybe he was asking for a URL to the package on OBS so he
> could look at the package himself?
>
> --
> Jason Craig
Exactly. Sorry for being late ;-). I think Jason is right, by the way.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problem with python-package - test run

Axel Braun-2
In reply to this post by Jason Craig-3
Hi all,

Am Dienstag, 17. November 2015, 11:39:12 schrieb Jason Craig:

> On 11/14/2015 03:41 PM, Axel Braun wrote:
> > Am Samstag, 14. November 2015, 23:07:32 schrieb Benjamin Denisart:
> >> On 11/14/2015 11:04 PM, Axel Braun wrote:
> >>> Hi all,
> >>>
> >>> I was recently building new modules for the tryton-server.
> >>> One of the modules runs a test-script:
> >>>
> >>> %check
> >>> python setup.py test
> >>>
> >>> Problem: Unlike the installation, which takes all resources from the
> >>> repository (e.g. the server module trytond), the test wants to download
> >>> this from pypi:
> >>>
> >>> [   39s] + python setup.py test
> >>> [   39s] running test
> >>> [   39s] Searching for trytond>=3.8,<3.9
> >>> [   39s] Reading https://pypi.python.org/simple/trytond/
> >>> [   39s] Download error on https://pypi.python.org/simple/trytond/:
> >>> [Errno
> >>> -2] Name or service not known -- Some packages may not be found!
>
> ...
>
> >>> The idea to add trytond as build requirement did not help either, as
> >>> this
> >>> produces dome other funny error messages (about some missing mysql-stuff
> >>> -
> >>> which I see first time now)
> >>>
> >>> Is there a way to tell the test to *not* download from pypi, but to use
> >>> local resources instead?
>
> Basically tests in Python packages sometimes have requirements that the
> package itself doesn't need to run. A common example of this is
> python-nose, this package is made for tests, but the end user doesn't
> really need it installed unless they want to run the package's tests
> themselves (rather uncommon). So BuildRequires: python-nose would be
> added, but not Requires: python-nose.
>
> In your case however, I think that trytond is probably required for the
> package to run as well as to be tested. Once you add trytond to
> Requires, then the test run gets a little further but now doesn't have
> whatever the mysql requirement the package needs, so that's why that is
> showing up for the first time. The setuptools process will quit on the
> first package it needs that isn't found, it won't give you a complete
> list of missing packages.

Yes, thats what I found out in between as well.
Trytond runs mostly with a postgres-DB, and there is no dependency on mysql in
the spec for trytond.

I had a chat with the author of trytond as well.
He explained me that trytond uses for tests SQlite - this may be where the
requirement comes from. I added (beside others)

BuildRequires:  libmysqlclient-devel
BuildRequires: mariadb

and that removed the error.
Now it does not find the tryton.cfg file, although it is in the package.....

> I would check the package's setup.py to see what the "install_requires"
> packages are and add all these to the Requires for your package. Also
> sometimes whoever made the Python package didn't accurately set
> "install_requires", so you have to dig around in documentation or by
> trial and error to see what packages are going to be required to
> test/run the package.
>
> Also it is possible that the trytond package, not the package you are
> working on, does not have the proper Requires set, so that the missing
> mysql stuff OBS is complaining about is really something that should be
> included with trytond.
>
> >> Link to your package ?
> >
> > I tried a
> > osc linkpac Application:ERP:Tryton:3.8 trytond Application:ERP:Tryton:3.8
> > trytond_customs
> > ...but that did not help
>
> I think maybe he was asking for a URL to the package on OBS so he could
> look at the package himself?

Sure:
https://build.opensuse.org/package/show/Application:ERP:Tryton:3.8/trytond_customs

Problem with Build enables is that the 'older' Distris SLE12 ond openSUSE 13.1
dont find libsqlclient.so.18 anymore - probably there is an older version
available for these.

So, under this light I think about dropping the test....

I'm currently on vacation, so I might not answer immediately.

Thanks guys
Axel


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]