Hi Andreas, Thank you for response! Yes, I'm running from the conservation_code directory. I'll try to build with pdebuild, check if something changed and fix everything we discussed.
2016-06-02 10:13 GMT+03:00 Andreas Tille <[email protected]>: > [CCing the list for more input - I'll be not reliably available online > today > and tomorrow] > > Good morning Tanya, > > On Thu, Jun 02, 2016 at 08:37:36AM +0300, merlettaia wrote: > > The test I wrote is unfinished - I had an error message when I tried to > run > > this simple test locally, now I'm stuck, and can't decide how to fix. > > I think I should provide some details - maybe this error unreproducible, > > and appears only on my VM, I don't know. And some questions - maybe you > > could help me find the best way to fix them. There are several related > > problems with this package: > > > > Problem 1. When I run adt-run, this error appears: > > "... > > s_matrix = read_scoring_matrix(s_matrix_file) > > File "/tmp/autopkgtest.ASxyOi/deps/usr/bin/score_conservation", line > 547, > > in read_scoring_matrix > > return identity(20) > > NameError: global name 'identity' is not defined > > " > > - it appears because package numpy, where identity method is located, is > > imported in conditional statement, and is not imported globally in > module. > > Hmmm, I admit I do not understand this since I called the script from my > local machine (which would be nice to work as well in any case). > > > When alignment matrix, which by default is searched at > matrix/blosum62.bla > > (directory is relative to script), > > This is true in the source directory layout. However, I think we should > make this working even outside this directory layout to serve as a > sensible example for users. While adt-run is running inside the > unpackaged source and we can assume what you said I usually install the > test script as example for users in /usr/share/doc/<packagename> to > learn how to use the program. > > Since the matrix files are installed to > /usr/share/conservation-code/matrix > conservation-code should find these files there. > > > can't be found at that location, this > > identity method is used to get some 'default' alignment matrix. > > The fix for this error must be simple - to add import statement before > > calling identity method (fix upstream code). > > Sounds sensible. You might like to create a quilt patch (if specifying > /usr/share/conservation-code/matrix does not help). > > > Now this error shows that a package is installed incorrectly, and some > > related files can't be found. > > > > I think I have to fix upstream and to add separate test to ensure all > goes > > fine with default parameters. Do you agree, or is it redundant? > > Agreed. > > > Problem 2. When I run svn-buildpackage with current debian/install file, > > these messages appear: > > "... > > /data/src/build-area/conservation-code-20110309.0/debian/install: 1: > > /data/src/build-area/conservation-code-20110309.0/debian/install: > > distributions: not found > > /data/src/build-area/conservation-code-20110309.0/debian/install: 2: > > /data/src/build-area/conservation-code-20110309.0/debian/install: matrix: > > not found > > /data/src/build-area/conservation-code-20110309.0/debian/install: 3: > > /data/src/build-area/conservation-code-20110309.0/debian/install: > > score_conservation: not found > > ... > > " > > Are you running it from the conservation_code directory? I personally > do not use svn-buildpackage but rather pdebuild (to build in pbuilder or > simply debuild to run on the local machine. So the proper sequence to > build is > > apt-get source conservation-code > cd conservation-code-20110309.0 > # copy your changes from svn to debian/ dir but > # cd back to this dir > pdebuild > # or debuild > > What you wrote sounds like starting in wrong dir. > > > For the reasons unknown, data from matrix and distribution folders and > > score_conservation file can't be found. > > I can not reproduce this. > > > For now I think it's some strange > > problem with VM. Do this messages appear when you run svn-buildpackage? > Or > > am I doing something wrong? > > I do not think that the VM is to be blamed for this kind of error. > > > Problem 3 - Combines problems 1 and 2. > > While installing, contents of the score_conservation.py (which by default > > uses matrix/blosum62.bla) is copied to score_conservation (which by > default > > uses matrix/blosum62.bla), and this files goes to usr/bin/, when default > > alignment matrix file goes in package folder. Thus, when we run > > score_conservation with default alignment matrix, error message described > > as Problem 1 appears. > > That's why I said we probably need to adapt the path to matrix dir inside > the code. > > While beeing at it: The current packaging method is wrong since Python > code should go to /usr/share/<packagename> to enable pybuild create .pyc > files. It might be (or not) that in this case the matrix files will be > found. Please wait until you see my commit for this. > > > For me it seems to be the best solution to use a symlink named > > score_conservation to score_conservation.py instead of copying that file > - > > to keep python script in package folder to avoid problems with default > > parameters (it can also require small fix in upstream). Do you think it > is > > ok or there can be better solution? > > Yes, it is - also for the reasons I mentioned above. > > > Sorry if I'm unclear or too verbose :( > > You are pretty clear. ;-) > > > And thank you for remarks! > > You are welcome > > Andreas. > > -- > http://fam-tille.de > -- Best wishes, Tanya.

