-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
enhancementgenerated-packageRelated to the generated package, i.e. after running cookiecutterRelated to the generated package, i.e. after running cookiecutter
Description
At https://packaging.python.org/tutorials/packaging-projects/ it says Static metadata should be preferred and dynamic metadata should be used only as an escape hatch when absolutely necessary. Currently the template is using a dynamic metadata, see
python-template/{{cookiecutter.project_slug}}/setup.py
Lines 26 to 74 in 55129e2
| setup( | |
| name='{{ cookiecutter.project_slug.lower().replace(' ', '_').replace('-', '_')}}', | |
| version=version, | |
| description="{{ cookiecutter.project_short_description.replace('\"', '\\\"') }}", | |
| long_description=readme + '\n\n', | |
| author="{{ cookiecutter.full_name.replace('\"', '\\\"') }}", | |
| author_email='{{ cookiecutter.email }}', | |
| url='https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug.lower().replace(' ', '_').replace('-', '_')}}', | |
| packages=[ | |
| '{{ cookiecutter.project_slug.lower().replace(' ', '_').replace('-', '_')}}', | |
| ], | |
| include_package_data=True, | |
| {%- if cookiecutter.open_source_license in license_classifiers %} | |
| license="{{ cookiecutter.open_source_license }}", | |
| {%- endif %} | |
| zip_safe=False, | |
| keywords='{{ cookiecutter.project_slug }}', | |
| classifiers=[ | |
| 'Development Status :: 2 - Pre-Alpha', | |
| 'Intended Audience :: Developers', | |
| {%- if cookiecutter.open_source_license in license_classifiers %} | |
| '{{ license_classifiers[cookiecutter.open_source_license] }}', | |
| {%- endif %} | |
| 'Natural Language :: English', | |
| 'Programming Language :: Python :: 3', | |
| 'Programming Language :: Python :: 3.5', | |
| 'Programming Language :: Python :: 3.6', | |
| 'Programming Language :: Python :: 3.7', | |
| ], | |
| test_suite='tests', | |
| install_requires=[], # FIXME: add your package's dependencies to this list | |
| setup_requires=[ | |
| # dependency for `python setup.py test` | |
| 'pytest-runner', | |
| # dependencies for `python setup.py build_sphinx` | |
| 'sphinx', | |
| 'sphinx_rtd_theme', | |
| 'recommonmark' | |
| ], | |
| tests_require=[ | |
| 'pytest', | |
| 'pytest-cov', | |
| 'pycodestyle', | |
| ], | |
| extras_require={ | |
| 'dev': ['prospector[with_pyroma]', 'yapf', 'isort'], | |
| }, | |
| data_files=[('citation/{{ cookiecutter.project_slug.lower().replace(' ', '_').replace('-', '_')}}', ['CITATION.cff'])] | |
| ) |
To follow best practices we should move those metadata from setup.py to setup.cfg.
The setup.py is still needed for non-pure Python packages (aka packages with C++/C code), but should be very short by default.
Metadata
Metadata
Assignees
Labels
enhancementgenerated-packageRelated to the generated package, i.e. after running cookiecutterRelated to the generated package, i.e. after running cookiecutter