diff --git a/{{ cookiecutter.package_name }}/docs/conf.py b/{{ cookiecutter.package_name }}/docs/conf.py index 89a01f0..b5182c1 100644 --- a/{{ cookiecutter.package_name }}/docs/conf.py +++ b/{{ cookiecutter.package_name }}/docs/conf.py @@ -5,16 +5,15 @@ # http://www.sphinx-doc.org/en/master/config -import datetime - # -- Project information ----------------------------------------------------- # The full version, including alpha/beta/rc tags from {{ cookiecutter.module_name }} import __version__ + release = __version__ project = "{{ cookiecutter.package_name }}" -copyright = str(datetime.datetime.now().year) + " , {{ cookiecutter.author_name }}" # noqa: A001 +copyright = str(datetime.datetime.now().year) + " , {{ cookiecutter.author_name }}" # noqa: A001 author = "{{ cookiecutter.author_name }}" # -- General configuration --------------------------------------------------- diff --git a/{{ cookiecutter.package_name }}/setup.py b/{{ cookiecutter.package_name }}/setup.py index c98cd51..7499bb1 100755 --- a/{{ cookiecutter.package_name }}/setup.py +++ b/{{ cookiecutter.package_name }}/setup.py @@ -1,8 +1,8 @@ #!/usr/bin/env python -from setuptools import setup {%- if cookiecutter.use_compiled_extensions == 'y' %} from extension_helpers import get_extensions {%- endif %} +from setuptools import setup setup( {%- if cookiecutter.use_compiled_extensions == 'y' -%} ext_modules=get_extensions() diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py index 5bd9399..86d71b2 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/__init__.py @@ -1,9 +1,11 @@ +{%- if cookiecutter.include_example_code == 'y' -%} +from .example_mod import do_primes +{%- endif %} from .version import version as __version__ -{%- if cookiecutter.include_example_code == 'y' %} -from .example_mod import do_primes +{% if cookiecutter.include_example_code == 'y' -%} # Then you can be explicit to control what ends up in the namespace, __all__ = ['do_primes'] -{% else %} +{% else -%} __all__ = [] -{%- endif -%} +{% endif -%} diff --git a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py index c262053..b2eff69 100644 --- a/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py +++ b/{{ cookiecutter.package_name }}/{{ cookiecutter.module_name }}/example_mod.py @@ -54,9 +54,10 @@ def do_primes(n, usecython=False): def main(args=None): - from astropy.utils.compat import argparse from time import time + from astropy.utils.compat import argparse + parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('-c', '--use-cython', dest='cy', action='store_true', help='Use the Cython-based Prime number generator.')