setuptools setup()

https://setuptools.readthedocs.io/en/latest/setuptools.html#new-and-changed-setup-keywords

参数描述
nameA string specifying the name of the package.
versionA string specifying the version number of the package.
descriptionA string describing the package in a single line.
long_descriptionA string providing a longer description of the package.
long_description_content_typeA string specifying the content type is used for the long_description (e.g. text/markdown)
authorA string specifying the author of the package.
author_emailA string specifying the email address of the package author.
maintainerA string specifying the name of the current maintainer
maintainer_emailA string specifying the email address of the current maintainer, if different from the author.
urlA string specifying the URL for the package homepage.
download_urlA string specifying the URL to download the package.
packagesA list of strings specifying the packages that setuptools will manipulate.
py_modulesA list of strings specifying the modules that setuptools will manipulate.
scripts指明脚本文件,自动放在path
ext_packag
ext_modules
`setuptools.setup` 是用于配置和构建 Python 包的函数,它属于 setuptools 包的一部分。它用于定义包的元数据、依赖关系和其他配置选项,以便在安装或发布包时进行正确的构建和安装。 这个函数通常在 `setup.py` 文件中被调用,该文件用于描述和配置 Python 包。`setuptools.setup` 函数接受一系列参数,用于指定包的名称、版本、作者、依赖关系、入口点等信息。通过调用这个函数,可以生成一个用于安装或发布包的配置文件。 以下是一个示例 `setup.py` 文件的基本结构: ```python from setuptools import setup setup( name='my_package', version='1.0.0', author='Your Name', description='Description of your package', install_requires=[ 'dependency1', 'dependency2', ], packages=['my_package'], entry_points={ 'console_scripts': [ 'my_script = my_package.module:main', ], }, classifiers=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 3', ], ) ``` 在上面的示例中,`name` 表示包的名称,`version` 表示包的版本号,`author` 表示包的作者,`description` 是对包的简要描述。`install_requires` 是一个列表,指定了包的依赖项。`packages` 列表指定了要包含在包中的模块或包。`entry_points` 字典用于定义可执行命令的入口点,可以在命令行中直接使用。`classifiers` 是一组描述包的分类信息的字符串。 通过运行 `python setup.py install` 命令,可以根据配置文件来构建和安装包。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值