Skip to content
Snippets Groups Projects
Select Git revision
  • f9f3b362eac85a060c8dd2e676c50a1265ce0622
  • main default protected
  • torch2
  • torch1
  • dev protected
  • 20230311_new_default
  • 20230311
  • design protected
  • 20230129
  • 20230111
  • 20221005 protected
  • 20220418 protected
  • v0.20
  • v0.19
  • v0.18
  • v0.17
  • v0.16.4
  • v0.16.3
  • v0.16.2
  • v0.16.1
  • v0.16
  • v0.15
  • v0.14
  • v0.13
  • v0.12.4
  • v0.12.3
  • v0.12.2
  • v0.12.1
  • v0.12
  • v0.11
  • v0.10
  • v0.9.1
32 results

make_models.jl

Blame
  • setup.py 2.58 KiB
    from os import environ, PathLike
    from setuptools import setup, find_packages
    # from glob import glob
    # If you have .pyx things to cythonize
    from distutils.extension import Extension
    #from Cython.Build import cythonize
    # https://github.com/daler/pybedtools/issues/253
    from pybedtools.helpers import get_includes as pybedtools_get_includes
    from pysam import get_include as pysam_get_include
    
    name = "bam25prime"
    __version__ = "0.1"
    
    
    # https://stackoverflow.com/a/54138355/1878788
    # defer the import of these modules after setup_requires have been provided
    #class pysam_get_includes(str):
    #    def __str__(self):
    #        from pysam import get_include
    #        includes = get_include()
    #        print(*includes, sep="\n")
    #        return "|".join(includes)
    #
    #class pybedtools_get_includes(str):
    #    def __str__(self):
    #        from pybedtools.helpers import get_includes
    #        includes = get_includes()
    #        print(*includes, sep="\n")
    #        return "|".join(includes)
    
    
    # https://github.com/cython/cython/blob/master/docs/src/reference/compilation.rst#configuring-the-c-build
    extensions = [
        Extension(
            "bam25prime.libcollapsesam", ["bam25prime/libcollapsesam.pyx"],
            #include_dirs=pysam_get_includes().split("|")),
            include_dirs=pysam_get_include()),
        Extension(
            "bam25prime.libcollapsebed", ["bam25prime/libcollapsebed.pyx"],
            #include_dirs=glob("%s/src/bedtools2-2.27.1/src/utils/*" % environ["HOME"]),
            #include_dirs=pybedtools_get_includes().split("|"),
            include_dirs=pybedtools_get_includes(),
            language="c++"),
        ]
    
    setup(
        name=name,
        version=__version__,
        description="Library providing utilities to collapse aligned segments"
                    "in a bam file to their 5-prime end.",
        author="Blaise Li",
        author_email="blaise.li@normalesup.org",
        license="MIT",
        package_data={"bam25prime": ["py.typed", "bam25prime.pyi"]},
        packages=find_packages(),
        zip_safe=False,
        entry_points={
            "console_scripts": ["bam25prime = bam25prime.bam25prime:main",]
        },
        # scripts=["bin/%s" % name],
        #ext_modules = cythonize(extensions),
        ext_modules = extensions,
        #ext_modules = cythonize("bam25prime/libbam25prime.pyx", include_path=pysam_get_include()),
        setup_requires=[
            "wheel",
            "cython",
        ],
        install_requires=[
            "pysam",
            "pybedtools @ git+https://github.com/blaiseli/pybedtools.git@pep518",
            # "pybedtools",
        ]
    )
    # If you have .pyx things to cythonize
        #ext_modules = cythonize("libsmallrna/libsmallrna.pyx"),
        #install_requires=["cytoolz"],
        #zip_safe=False)