在他們的setup.py Python包中提供了一些信息。 這個信息可以在蛋的PKG_INFO文件中找到。如何獲得Python分發URL?
一旦我安裝了軟件包,我怎樣才能訪問它們?
舉例來說,如果我有以下模塊:
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
任何想法?
似乎是http://stackoverflow.com/questions/20683118/how-to-access-python-package-metadata的副本 - 從 - 中 - 中 - 蟒蛇控制檯 – Natim