Python小推车初学者python学习

Python学习打call第三十六天:模块打包

2019-03-11  本文已影响32人  暖A暖

1.什么是模块打包

2.怎么打包

site-packages
├── IPython
├── Jinja2-2.10.dist-info
├── MarkupSafe-1.1.0.dist-info
├── Pygments-2.2.0.dist-info
├── Send2Trash-1.5.0.dist-info
├── __pycache__
├── appnope
├── appnope-0.1.0.dist-info
├── backcall
├── backcall-0.1.0.dist-info
├── bleach
├── bleach-3.0.2.dist-info
├── certifi
├── certifi-2018.10.15.dist-info
├── chardet
├── chardet-3.0.4.dist-info

3.如何打包、打包后推送到哪里

package/
├── README.rst
├── etc
│   └── xkd.conf
├── first_package
│   └── __init__.py
├── second_package
│   └── __init__.py
└── setup.py
from setuptools import setup, find_packages
setup(
    name='package',
    version='1.0.0',
    packages = find_packages(),
    install_requires=[
        "requests>=2.19.1",
        "PyYAML>=3.13",
    ],
    description='XKD COURSE FOR TEST',
    long_description=open("README.rst").read(),
    url='github 地址',
    author='Robby',
    author_email='yinhuanyicn@gmail.com',
    license='Apache License 2.0',
    package_data = {
        # 将 .txt和.rst文件也打包进去
        '': ['*.txt', '*.rst'],
    },
    data_files=['etc/xkd.conf',],
    keywords=['xkdpackage',],
)
打包后会生成一些目录:build、dist、xkdpackage.egg-info

参考:https://www.9xkd.com/user/plan-view.html?id=2413640729

上一篇 下一篇

猜你喜欢

热点阅读