Skip to content

Commit

Permalink
Upstreaming precommit lessons from sunpy-template
Browse files Browse the repository at this point in the history
  • Loading branch information
CyclingNinja committed Mar 1, 2024
1 parent 17c1575 commit 2d28565
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 2 additions & 3 deletions {{ cookiecutter.package_name }}/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion {{ cookiecutter.package_name }}/setup.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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 -%}
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down

0 comments on commit 2d28565

Please sign in to comment.