在他们的 setup.py Python 包中提供了一些信息。然后可以在鸡蛋的 PKG_INFO 文件中找到此信息。
安装软件包后如何访问它们?
例如,如果我有以下模块:
setup(name='myproject',
version='1.2.0.dev0',
description='Demo of a setup.py file.',
long_description=README + "\n\n" + CHANGELOG + "\n\n" + CONTRIBUTORS,
license='Apache License (2.0)',
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"License :: OSI Approved :: Apache Software License"
],
keywords="web sync json storage services",
url='https://github.com/Kinto/kinto')
如何使用 Python 取回 setup.py 中提供的信息?
我在想类似的事情:
import pkg_resource
url = pkg_resource.get_distribution(__package__).url
任何想法?