from setuptools import setup, find_packages
import atexit
import shutil
name = "sdk"
def rm_temp():
"""
删除打包过程中产生的中间文件
:return:
"""
shutil.rmtree('build')
shutil.rmtree('{}.egg-info'.format(name))
# 注册 rm_temp
atexit.register(rm_temp)
setup(
name="{}".format(name),
version="0.0.1",
author="JHC",
author_email="JHC000abc@gmail.com",
packages=find_packages(),
# sdk/plugins/unrar.exe 移动到Lib\site-packages下
package_data={
'sdk': ['plugins/*','base/*','temp/*','tools/*','utils/*'],
},
data_files=[(R"Lib\site-packages",["sdk/plugins/unrar.exe"]),(R"Lib\site-packages",["sdk/plugins/SourceHanSerifSC-Bold.otf"])],
# 需要安装的包
install_requires=[
'pycryptodome',
'bce-python-sdk',
'cup',
'unrar',
'pymysql',
'pillow',
'opencv-python',
'selenium-wire',
'selenium',
'lxml==4.9.1',
'python-dotenv',
'requests',
'rarfile',
'xlsxwriter',
'xlrd',
'chardet',
'numpy',
'nb-log',
'urllib3',
'python-dateutil',
'zhconv',
'pypinyin',
'pydub',
],
)
# 先装 wheel (有时还可能会要更新pip 和 setuptools)
# pip install wheel -i https://mirrors.aliyun.com/pypi/simple/
# 生成 .whl 文件
# python setup.py bdist_wheel
# 安装 .whl
# pip install -i https://mirrors.aliyun.com/pypi/simple/ python_sdk-0.0.1-py3-none-any.whl
# 卸载
# pip uninstall -y python-sdk
Python setup.py 编写
于 2023-12-05 14:25:17 首次发布