quachtina96 / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

.c files should be distributed with source, Cython should not be required for install, and other build issues #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It seems like people frequently have issues building and/or installing pysam, 
at least I do.

I've been confused lately as I tried to build/install for issue 122. Here's an 
example:

    A. Create fresh virtualenv
    B. hg clone https://code.google.com/p/pysam/
    C. cd pysam
    D. python setup.py install
    E. Got "pysam/csamtools.c: No such file or directory". csamtools_sources (in setup.py) is ['pysam/csamtools.c']
    F. pip install cython
    G. python setup.py
    H. same error, but now csamtools_sources is ['pysam/csamtools.pyx']
    I. pip install pyrex (see issue 56)
    J. Now it works.
    K. Oh wait, "ImportError: No module named csamtools"
    L. ...uhhhh....

Cython is a fantastic development tool, but it shouldn't be required for most 
pysam users. Cython strongly recommends distributing .c files instead of 
requiring Cython for build [1].

This would be a HUGE improvement. Only pysam developers would need Cython, 
which would save a lot of complexity and build time.

I'm happy to implement these changes, but I wanted to announce the 
ideas/problems for discussion before I start making big changes.

On a side note, I don't understand why I would need both Pyrex and Cython. 
Isn't Cython a fork of Pyrex?

[1] 
http://docs.cython.org/src/userguide/source_files_and_compilation.html#distribut
ing-cython-modules

Original issue reported on code.google.com by bucha...@gmail.com on 8 Oct 2013 at 7:15

GoogleCodeExporter commented 9 years ago
Oh, ignore my ImportError note, of course that comes from trying to import 
pysam while in the pysam directory...d'oh!

Original comment by bucha...@gmail.com on 8 Oct 2013 at 7:22

GoogleCodeExporter commented 9 years ago
Hi,

The .c files are not part of the source tree, but they are part of MANIFEST.in 
and thus should be part of the tar-ball. 

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 4 Nov 2013 at 7:50

GoogleCodeExporter commented 9 years ago
`pip install pysam` downloads and installs cython. If the .c files are part of 
the tarball, why is cython necessary?

Outside of the tarball, it would be nice if I could check out the source from 
the repository and build it (for testing purposes) without needing to worry 
about cython. Or if cython is a must, building the source needs to be simple 
and reliable.

Original comment by bucha...@gmail.com on 5 Nov 2013 at 5:13

GoogleCodeExporter commented 9 years ago
Cython is installed for python 3. The bundled C-files are only python 2.7 
compatible.

My preference would be to always cythonize, but it seems that for some the 
bundled .c
files are preferred.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 24 Nov 2013 at 10:18

GoogleCodeExporter commented 9 years ago
Could python 3 compatible C-files be produced?

What are the benefits of including Cython for those who aren't pysam core 
developers?

Are users (who aren't core developers) writing Cython code?

What's the ratio of pysam users to core developers?

time_install_cython * end_users < development_convenience * core_developers?

Maybe answering those questions can help guide your decision.

Original comment by bucha...@gmail.com on 26 Nov 2013 at 8:08

GoogleCodeExporter commented 9 years ago
Hi Buchanae,

Thanks you for your suggestions. Python 3 compatible C-files can be produced - 
but where to stop? It becomes a maintenance nightmare. The cython project is 
much better placed to resolve such issues. I don't see why installing cython is 
a problem. If there is a generic way for cython based project to install on all 
systems, I am
happy to use it.

I am not sure where the pyrex dependence comes from, but will investigate.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 26 Nov 2013 at 9:57