Skip to content

Commit

Permalink
Update extension template to reflect best practice w.r.t. requirements.
Browse files Browse the repository at this point in the history
Extensions should use a separate ``requirements.txt`` file to list their
dependencies (instead of ``setup.py``). This was already documented but
the ``setup.py`` template did not mention it.
  • Loading branch information
torfsen committed Jun 13, 2016
1 parent fde822f commit 23e0ea3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ckan/pastertemplates/template/MANIFEST.in_tmpl
@@ -1,2 +1,4 @@
include README.rst
include LICENSE
include requirements.txt
recursive-include ckanext/{{ project_shortname }} *.html *.json *.js *.less *.css *.mo
Empty file.
16 changes: 9 additions & 7 deletions ckan/pastertemplates/template/setup.py_tmpl
Expand Up @@ -56,11 +56,12 @@ setup(
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
namespace_packages=['ckanext'],

# List run-time dependencies here. These will be installed by pip when your
# project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/technical.html#install-requires-vs-requirements-files
install_requires=[],
install_requires=[
# CKAN extensions should not list dependencies here, but in a separate
# ``requirements.txt`` file.
#
# http://docs.ckan.org/en/latest/extensions/best-practices.html#add-third-party-libraries-to-requirements-txt
],

# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these
Expand All @@ -81,8 +82,9 @@ setup(
entry_points='''
[ckan.plugins]
{{ project_shortname }}=ckanext.{{ project_shortname }}.plugin:{{ plugin_class_name }}
[babel.extractors]
ckan = ckan.lib.extract:extract_ckan

[babel.extractors]
ckan = ckan.lib.extract:extract_ckan
''',

# If you are changing from the default layout of your extension, you may
Expand Down

0 comments on commit 23e0ea3

Please sign in to comment.