Re: Understanding pybuild

2019-12-19 Thread Ole Streicher
Hi Dmitry,

Dmitry Shachnev  writes:
> On Thu, Dec 19, 2019 at 01:09:40PM +0100, Ole Streicher wrote:
>> 2. dh_auto_test then tries runs the tests in .pybuild. If the test need
>> data files installed, they must be copied manually (right?).
>
> You can use debian/pybuild.testfiles to copy the test files. See pybuild(1)
> for details.

That would formalize it a bit, but still does not solve the underlying
problem: it requires that I maintain the list of these files manually,
while upstream already does this (by adding them to the list of data
files).

And also, the built time tests are with pybuild not done with the files
(anc compilations) that are finally installed, but the installed files
(especially Python extensions) are created again from scratch, doubling
the compile time and introducing another difficile source of error.

Best regards

Ole



Re: Understanding pybuild

2019-12-19 Thread Dmitry Shachnev
Hi Ole!

On Thu, Dec 19, 2019 at 01:09:40PM +0100, Ole Streicher wrote:
> Hi,
>
> I am currently updating scikit-image (skimage) to its newest version,
> and I have some difficulties to understand how pybuild works (for
> setup.py packages):
>
> 1. first, dh_auto_build calls "python3.X setup.py build" to create the
> packages (Python files and compiled extensions) in
> ..pybuild/cpython3_3.X/. This however does not include the copying of any
> data files.
>
> 2. dh_auto_test then tries runs the tests in .pybuild. If the test need
> data files installed, they must be copied manually (right?).

You can use debian/pybuild.testfiles to copy the test files. See pybuild(1)
for details.

--
Dmitry Shachnev


signature.asc
Description: PGP signature


Re: kmer: Python2 removal in sid/bullseye

2019-12-19 Thread Andreas Tille
Hi Scott,

thanks a lot for your hint.

On Thu, Dec 19, 2019 at 01:34:08PM -0500, Scott Talbert wrote:
> 
> The 'file' class doesn't exist anymore in Python 3.  You'll have to rewrite
> myfile to not use it.

OK, I simply went with

...
@@ -608,6 +608,11 @@ Last-Update: Thu, 19 Dec 2019 10:43:09 +0100
  
  # from __future__ import generators  # Necessary before Python 2.3
  
+-class myfile(file):
++class myfile():
+ "A temporary anonymous file"
+ def __init__(self):
+ filename = tempfile.mktemp()
 @@ -27,8 +27,8 @@ class ListLikeFileIter:
  self._fileIter = iter(self._fileptr.readline,"")
  def __del__(self):
...


This brings me to the next error where a Module written in C is not
found:



python3 /usr/bin/../lib/atac/bin/AtacDriver.py 
/tmp/atac-test.XqdEPl/results/work/LeprvsTuber.matches.extended

Traceback (most recent call last):
  File "/usr/bin/../lib/atac/bin/AtacDriver.py", line 26, in 
import localAlignerInterface
ModuleNotFoundError: No module named 'localAlignerInterface'
PYTHONPATH=/usr/bin/../lib/atac/lib
Chainer failed.



The file /usr/lib/atac/lib/localAlignerInterfacemodule.so exists
but it seems the Python3 script can't load it.


Kind regards

Andreas.

-- 
http://fam-tille.de



Re: kmer: Python2 removal in sid/bullseye

2019-12-19 Thread Scott Talbert

On Thu, 19 Dec 2019, Andreas Tille wrote:


Traceback (most recent call last):
 File "/usr/bin/../lib/atac/bin/AtacDriver.py", line 18, in 
   import MyFile
 File "/usr/lib/atac/lib/MyFile.py", line 6, in 
   class myfile(file):
NameError: name 'file' is not defined
PYTHONPATH=/usr/bin/../lib/atac/lib
Chainer failed.


The 'file' class doesn't exist anymore in Python 3.  You'll have to 
rewrite myfile to not use it.


Scott



Re: kmer: Python2 removal in sid/bullseye

2019-12-19 Thread Andreas Tille
Control: tags -1 help

Hi,

I tried to convert kmer to Python3 in Git[1].  Unfortunately I'm stumbling
upon an issue in the test suite:

...
python3 /usr/bin/../lib/atac/bin/AtacDriver.py 
/tmp/atac-test.doxZJ4/results/work/LeprvsTuber.matches.extended

Traceback (most recent call last):
  File "/usr/bin/../lib/atac/bin/AtacDriver.py", line 18, in 
import MyFile
  File "/usr/lib/atac/lib/MyFile.py", line 6, in 
class myfile(file):
NameError: name 'file' is not defined
PYTHONPATH=/usr/bin/../lib/atac/lib
Chainer failed.


Any idea what's wrong here?

Kind regards

Andreas.


[1] https://salsa.debian.org/med-team/kmer

-- 
http://fam-tille.de



Understanding pybuild

2019-12-19 Thread Ole Streicher
Hi,

I am currently updating scikit-image (skimage) to its newest version,
and I have some difficulties to understand how pybuild works (for
setup.py packages):

1. first, dh_auto_build calls "python3.X setup.py build" to create the
packages (Python files and compiled extensions) in
..pybuild/cpython3_3.X/. This however does not include the copying of any
data files.

2. dh_auto_test then tries runs the tests in .pybuild. If the test need
data files installed, they must be copied manually (right?).

3. dh_auto_install finally calls "python3.X setup.py install ..." to
install the complete packages (Python files, extensions, and data files)
from their original place to debian/tmp/. This includes a re-compilation
of the extensions.

What I do not understand now is: what is the purpose of step 1? Except
for the tests, these files seem to be unused. And for the tests, they
are not complete, since the data files are missing.

And what is the canonical way to get the data files copied to
..pybuild/...? They are already marked as such in setup.py. Doing this
manually by the Debian maintainer seems a constant source of error.

Best

Ole