内容简介:不得不说python的自制包的相关工具真是多且混乱,什么setuptools,什么distutils,什么wheel,什么egg!!怎么有这么多啊??而且我的需求且且是创建一个自制包管理自己常用的代码,也必不想提交到PyPI,仅仅只需要安装到本机就行。下面就是几个关键步骤。
不得不说 python 的自制包的相关 工具 真是多且混乱,什么setuptools,什么distutils,什么wheel,什么egg!!怎么有这么多啊??
而且我的需求且且是创建一个自制包管理自己常用的代码,也必不想提交到PyPI,仅仅只需要安装到本机就行。
下面就是几个关键步骤。
-
文件目录布局
├── package1
│ └──-├── init .py
| |── mod1.py
│ └── mod2.py
├── setup.py
|── README.md - 编写setup.py文件,类似如下:
from setuptools import setup, find_packages
setup(
name="kamustools",
version="1.0.1",
author="Kamuszhou",
author_email="zausiu@gmail.com",
description="tools used by kamuszhou exclusively.",
license="BSD",
keywords="kamus",
url="https://blog.ykyi.net",
packages=find_packages(),
long_description="Long descrition is actually short...",
classifiers=[
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
)
- python3 setup.py sdist bdist_wheel
- pip install ./dist/kamustools-1.0.1.tar.gz
就这四步,其他各种功能,以后要用了再慢慢看吧,实在太庞杂了。满足我自己需求的这四个简单步骤就记录在这里。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Learn Python 3 the Hard Way
Zed A. Shaw / Addison / 2017-7-7 / USD 30.74
You Will Learn Python 3! Zed Shaw has perfected the world’s best system for learning Python 3. Follow it and you will succeed—just like the millions of beginners Zed has taught to date! You bring t......一起来看看 《Learn Python 3 the Hard Way》 这本书的介绍吧!