setup.py
# coding=utf-8
from setuptools import setup, find_packages
# from pip._internal.req import parse_requirements
# from pip._internal.network.session import PipSession
# install_reqs = parse_requirements('xxx/requirements_pip.txt', session=PipSession())
# reqs = [ir for ir in install_reqs]
with open('xxx/requirements_pip.txt', 'r') as f:
req = f.read().split('\n')
setup(
name="xxx", # 发布的包的名称
version="1.0.0", # 发布包的版本序号
description="xxx DEMO", # 发布包的描述信息
author="x", # 发布包的作者信息
author_email="x@aaa.com", # 作者的联系邮箱
packages=["xxx"],
# include_package_data=True, # include everything in source control
# ...but exclude README.txt from all packages
python_requires='>=3.8',
install_requires=req,
)
requirements_pip.txt
DBUtils
ray==1.10.0
datacompy
redis==4.1.3
elasticsearch_dsl
有两种打包方式: 1.源代码分发打包
python setup.py sdist
python setup.py install
- wheel打包(安装后会出现在pip list中)
|