Игорь Стариков / idle sign
Видео выступления
setup(
version='.'.join(map(str, VERSION)),
long_description=codecs.open(os.path.join(BASE, 'README.rst')).read(),
packages=find_packages(exclude=['tests*']),
name='mypackage',
url='http://idlesign.github.io/idletalks/005_declarative_cfg/',
description='My demo package',
license='BSD 3-Clause License',
author='me',
package_data={
'src.extra': ['*.tar.gz', '*.dat']
},
entry_points={
'console_scripts': ['myrunner=src.cli:main'],
},
zip_safe=False,
install_requires=['cryptography>=1.1'],
tests_require=['pytest'],
extras_require={
'virtualize': ['virtualenv>=1.10'],
},
classifiers=[
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.6',
],
)
Декларативное конфигурирование доступно начиная с версии 30.4.0
setup(setup_requires=['setuptools>=30.4.0'])
[metadata]
name = mypackage
version = attr: src.VERSION
url = http://idlesign.github.io/idletalks/005_declarative_cfg/
author = me
description = My demo package
long_description = file: README.rst
license = BSD 3-Clause License
[metadata.classifiers]
Operating System :: OS Independent
Programming Language :: Python :: 3.6
[options]
packages = find:
zip_safe = False
install_requires = cryptography>=1.1
tests_require = pytest
[options.packages.find]
exclude = tests*
[options.extras_require]
virtualize = virtualenv>=1.10
[options.package_data]
src.extra = *.tar.gz, *.dat
[options.entry_points]
console_scripts = myrunner = src.cli:main
from setuptools.config import read_configuration
conf_dict = read_configuration('setup.cfg', ignore_option_errors=True)
{
'options': {
'entry_points': {'console_scripts': ['myrunner = src.cli:main']},
'extras_require': {'virtualize': ['virtualenv>=1.10']}, 'install_requires': ['cryptography>=1.1'],
'package_data': {'src.extra': ['*.tar.gz', '*.dat']}, 'zip_safe': False, 'packages': [],
'tests_require': ['pytest']
},
'metadata': {
'name': 'mypackage', 'license': 'BSD 3-Clause License', 'author': 'me',
'url': 'http://idlesign.github.io/idletalks/005_declarative_cfg/',
'classifiers': ['Operating System :: OS Independent', 'Programming Language :: Python :: 3.6'],
'long_description': 'file: README.rst', 'description': 'My demo package'
}
}
{
'metadata': {
'description': 'Rolling backport of unittest.mock for all Pythons', 'author': 'Testing Cabal',
'url': 'https://github.com/testing-cabal/mock', 'author_email': 'testing-in-python@lists.idyll.org',
'classifiers': ['Development Status :: 5 - Production/Stable', ...], 'name': 'mock'
}
}
Эти слайды можно найти тут — http://bit.ly/ist_005