from pathlib import Path
from setuptools import setup

ROOT = Path(__file__).resolve().parent

# Read README reliably
long_description = (ROOT / "README.md").read_text(encoding="utf-8")

# Read requirements reliably + ignore blanks/comments
req_path = ROOT / "requirements.txt"
install_requires = []
if req_path.exists():
    install_requires = [
        line.strip()
        for line in req_path.read_text(encoding="utf-8").splitlines()
        if line.strip() and not line.strip().startswith("#")
    ]

setup(
    name="bio-pypage",
    version="0.2.0",
    description="Python implementation of the PAGE algorithm",
    author="Artemy Bakulin, Noam Teyssier",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/goodarzilab/pyPAGE",
    author_email="logic2000.bakulin@gmail.com",
    packages=["pypage", "pypage.io"],
    install_requires=install_requires,
    entry_points={
        "console_scripts": [
            "pypage=pypage.cli:main",
            "pypage-sc=pypage.cli_sc:main",
        ],
    },
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
    ],
)