from distutils.core import setup, Extension
from setuptools import setup, Extension
from wheel.bdist_wheel import bdist_wheel
import os

# 定义你的C扩展模块
extension = Extension(
    'wtina226',
    sources=['wtina226.c'],
    extra_compile_args=['-g'],
    extra_link_args=['-g']
)

# 定义setup函数
def setup_package():
    setup(
        name='wtina226',
        version='1.0.1',
        description='607 iic 3 control',
        author='maplePan',
        author_email='suwan.pan@witium.com',
        license='MIT',
        #packages=['wtina226'],
        ext_modules=[extension],
        python_requires='>=3.7',
        classifiers=[
            'Development Status :: 3 - Alpha',
            'Intended Audience :: Developers',
            'License :: OSI Approved :: MIT License',
            'Programming Language :: Python :: 3.7',
            'Programming Language :: Python :: 3.8',
            'Programming Language :: Python :: 3.9',
        ],
    )

# 确保在非sdist模式下运行bdist_wheel
if __name__ == '__main__':
    os.system('rm -rf build')
    os.system('rm -rf dist')
    os.system('rm -rf *.egg-info')
    setup_package()
