import os
import re
from setuptools import setup, find_packages
from io import open

with open(os.path.join(os.path.dirname(__file__), 'nebulascrape', '__init__.py')) as fp:
    VERSION = re.match(r".*__version__ = '(.*?)'", fp.read(), re.S).group(1)

with open('README.md', 'r', encoding='utf-8') as fp:
    readme = fp.read()

setup(
    name='nebulascrape',
    author='MERO',
    author_email='mero@ps.com',
    version=VERSION,
    packages=find_packages(exclude=['tests*']),
    description='NebulaScrape — Ultra-powerful HTTP scraping library with smart bypass, async support, and modular transport.',
    long_description=readme,
    long_description_content_type='text/markdown',
    url='https://github.com/MERO/nebulascrape',
    keywords=[
        'nebulascrape', 'cloudflare', 'scraping', 'ddos', 'scrape',
        'webscraper', 'anti-bot', 'waf', 'bypass', 'challenge',
        'akamai', 'datadome', 'perimeterx', 'kasada', 'async',
        'fingerprint', 'tls', 'http2'
    ],
    include_package_data=True,
    install_requires=[
        'requests>=2.9.2',
        'requests_toolbelt>=0.9.1',
        'pyparsing>=2.4.7',
        'httpx[http2]>=0.24.0',
        'h2>=4.0.0',
        'aiohttp>=3.8.0',
    ],
    extras_require={
        'headless': ['curl_cffi>=0.5.0'],
        'brotli': ['brotli>=1.0.9'],
    },
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'License :: OSI Approved :: MIT License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: 3.10',
        'Programming Language :: Python :: 3.11',
        'Programming Language :: Python :: 3.12',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]
)
