python发布模块、安装模块和卸载模块

一、模块发布
1.
在这里插入图片描述

from distutils.core import setup
setup(
    name='hm_message',
    description='1.0',
    long_description='完整模块-发布模块测试',
    author='ouyanghao',
    author_email='953816929@qq.com',
    url='https://blog.csdn.net/thgjkgdrf?spm=1001.2101.3001.5343&type=collect',
    py_modules=[
        'hm_message.test_1',
        'hm_message.test_2'
    ]
)
PS D:\pythonprojects\python-auto-test\test\test_package> python setup.py build 
running build
running build_py                                      
creating build                                        
creating build\lib                                    
creating build\lib\hm_message                         
copying hm_message\__init__.py -> build\lib\hm_message
copying hm_message\test_1.py -> build\lib\hm_message  
copying hm_message\test_2.py -> build\lib\hm_message  
PS D:\pythonprojects\python-auto-test\test\test_package> tree
卷 新加卷 的文件夹 PATH 列表                             
卷序列号为 0000024E 7AED:3DED                            
D:.                                                      
├─build                                                  
│  └─lib                                                 
│      └─hm_message                                      
└─hm_message                                             
PS D:\pythonprojects\python-auto-test\test\test_package> 
PS D:\pythonprojects\python-auto-test\test\test_package> python setup.py sdist
running sdist
running check                                      
warning: check: missing required meta-data: version

warning: sdist: manifest template 'MANIFEST.in' does not exist (using default file list)

warning: sdist: standard file not found: should have one of README, README.txt, README.rst

writing manifest file 'MANIFEST'
creating hm_message-0.0.0
creating hm_message-0.0.0\hm_message
making hard links in hm_message-0.0.0...
hard linking setup.py -> hm_message-0.0.0
hard linking hm_message\__init__.py -> hm_message-0.0.0\hm_message
hard linking hm_message\test_1.py -> hm_message-0.0.0\hm_message
hard linking hm_message\test_2.py -> hm_message-0.0.0\hm_message
creating dist
Creating tar archive
removing 'hm_message-0.0.0' (and everything under it)
PS D:\pythonprojects\python-auto-test\test\test_package>tree
卷 新加卷 的文件夹 PATH 列表
卷序列号为 000002BF 7AED:3DED
D:.
├─build
│  └─lib
│      └─hm_message
├─dist
└─hm_message
PS D:\pythonprojects\python-auto-test\test\test_package> ls .\dist\


    目录: D:\pythonprojects\python-auto-test\test\test_package\dist


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         2022/3/23     18:08            993 hm_message-0.0.0.tar.gz


PS D:\pythonprojects\python-auto-test\test\test_package>

模块发布完成。
二、模块安装
1.tar -zxvf hm_message-0.0.0.tar.gz
2.sudo python setup.py install
三、卸载模块
删除python安装包里的dist-packages目录下的hm_message即可
例如,sudo rm -r hm_message



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值