"""
Setup script for lovensepy package.

This script sets up the metadata and requirements for the lovensepy package,
allowing it to be installed via setuptools.
"""
from pathlib import Path
from setuptools import setup, find_packages

# Read version from version.py (same dir as setup.py)
_version = {}
with open(Path(__file__).parent / "version.py") as f:
    exec(f.read(), _version)
VERSION = _version["VERSION"]

# get the description programmatically
with open('README.md', 'r', encoding='utf-8') as f:
    long_description = f.read()

# get the requirements programmatically
with open('requirements.txt', 'r', encoding='utf-8') as f:
    requirements = [
        line.strip() for line in f
        if line.strip()
        and not line.startswith('#')
    ]

# create the metadata for the package
setup(
    name='lovensepy',
    version=VERSION,
    packages=find_packages(),
    install_requires=requirements,
    author='Koval Yaroslav',
    description='A python implementation of the Lovense API',
    long_description=long_description,
    long_description_content_type='text/markdown',
    url='https://github.com/koval01/lovensepy',
    classifiers=[
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: OS Independent',
    ]
)
