我正在将我的配置从setup.py移动到setup.cfg并且在设置entry_points参数时遇到问题,有人可以告诉我什么是正确的语法?目前我正在使用混合方法,但是,我想将entry_points移动到setup.cfg。
来自
def setup_package():
setup(version=get_version(), entry_points={'console_scripts':['app=my_package.app.run:cli'],})
到
[metadata]
name = my-package
description = my-package
license = unlicensed
long-description = README.md
platforms = any
classifiers =
Programming Language :: Python
[options]
zip_safe = False
packages = my_package, my_package.app
include_package_data = True
package_dir =
= .
tests_require = pytest; pytest-cov
[entry_points]
console_scripts =
my-package = my_package.app.run:cli
由于
答案 0 :(得分:10)
该部分必须为true
。请参阅https://github.com/github/octodns/blob/4b44ab14b1f0a52f1051c67656d6e3dd6f0ba903/setup.cfg#L34
[options.entry_points]
答案 1 :(得分:-3)
使用python 3.6和setuptools 39.0.1,我希望您将入口点从.py
移动到.cfg
。
我的setup.py
,专注于入口点声明:
from setuptools import setup
setup(
entry_points={
'pytest11': [
'mytest = mytest.plugin',
],
},
)
我最终完成了这项工作setup.cfg
:
... # other standard declarations
[options.entry_points]
pytest11 =
mytest = mytest.plugin