import os
from setuptools import setup, Extension

def get_extensions():
    import numpy
    module = Extension(
        "nucleotorch",
        sources=["seq2torch.c"],
        include_dirs=[numpy.get_include()],
        extra_compile_args=[],
        extra_link_args=["-undefined", "dynamic_lookup"],
    )
    return [module]

# __file__ is in the src directory, so go one level up to repo root
here = os.path.abspath(os.path.dirname(__file__))
readme_path = os.path.join(here, "README_dup.md")
with open(readme_path, "r", encoding="utf-8") as f:
    long_description = f.read()

setup(
    name="nucleotorch",
    version="1.1.5",
    author="Alex Williams",
    author_email="agwilliams200@gmail.com",
    description="Convert FASTQ and FASTA reads to binary PyTorch tensors!",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/agwilliams201/nucleotorch",
    classifiers=[
        "Programming Language :: Python :: 3",
        "Programming Language :: C",
        "License :: Public Domain",
        "Operating System :: OS Independent",
    ],
    ext_modules=get_extensions(),
    python_requires='>=3.6',
)
