一个非常古老的示例包
example-pkg-hta-helloworld的Python项目详细描述
示例python包
示例如何创建python包并部署到pip注册表
先决条件
- 安装车轮
python3-mpipinstall--user--upgradesetuptoolswheel
- 安装绳线
构建和部署步骤
- 转到设置.py目录并运行以下命令
- 它会生成很多文件,包括dist目录,其中包括包
python3setup.pysdistbdist_wheel
- 将所有文件上载到测试服务器
- 上传完成后,尝试访问链接https://test.pypi.org/project/example-pkg-YOUR-USERNAME-HERE
- 别忘了先在website上创建API令牌
# first uploadtwineupload--repository-urlhttps://test.pypi.org/legacy/dist/*
- 或者上传到世界
- 别忘了先在website上创建API令牌
# no need for url twine will use default onetwineuploaddist/*
如何使用
- 对于测试服务器
pip3install-ihttps://test.pypi.org/simple/example-pkg-hta-helloworld
- 对于全球
pip3installexample-pkg-hta-helloworld
- 然后在python3控制台中使用
#access python consolepython3importhta_helloworld_pkg
参考文献
- 项目
标签: