Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use static meta data in setup.cfg #84

Closed
sverhoeven opened this issue Mar 31, 2021 · 2 comments
Closed

Use static meta data in setup.cfg #84

sverhoeven opened this issue Mar 31, 2021 · 2 comments
Assignees
Labels
enhancement generated-package Related to the generated package, i.e. after running cookiecutter

Comments

@sverhoeven
Copy link
Member

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

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.

@fdiblen fdiblen added this to the 0.3.0 milestone Apr 7, 2021
@jspaaks jspaaks added the generated-package Related to the generated package, i.e. after running cookiecutter label Apr 14, 2021
@jspaaks jspaaks self-assigned this Apr 14, 2021
@jspaaks
Copy link

jspaaks commented Apr 14, 2021

PR #153

@jspaaks
Copy link

jspaaks commented Apr 14, 2021

PR was merged, closing

@jspaaks jspaaks closed this as completed Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement generated-package Related to the generated package, i.e. after running cookiecutter
Projects
None yet
Development

No branches or pull requests

3 participants