pip的whell包.whl打包过程记录

发布时间 2023-11-09 09:43:43作者: lytcreate

1.目录结构
-test_package
--src
--test_package
-- __init__.py
--function.py
-- setup.py

2.文件说明

set_up.py
setup(
    name='holiday-cn',
    version=version,
    license='ZPL 2.1',
    description="""\
        xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.""".replace('\n', ' '),
    author='xxx',
    author_email='xxx@163.com',
    packages=find_packages('src'),
    package_dir={'': 'src'},
    include_package_data=True,
    install_requires=[
        # 依赖的库
        'pytz',
    ],
)

__init__.py
from .function import function1
from .function import function2

__all__ = ('function1', 'function2')

function.py
自定义功能实现

  

3.打包:pip install setuptools wheel
完成后dist目录下会生成对应的whl文件,直接使用pip install xxx.whl安装即可