Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jan 27, 2020
1 parent dce1c2c commit 3430879
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 21 deletions.
8 changes: 2 additions & 6 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"license": ["BSD 3-Clause", "GNU GPL v3+", "Apache Software Licence 2.0", "BSD 2-Clause", "Other"],
"project_url": "http://docs.astropy.org/projects/package-template/",
"project_version": "0.0.dev",
"include_example_code": "y",
"include_example_cython_code": "n",
"include_cextern_folder": "n",
"use_compiled_extensions": "y",
"include_example_code": "n",
"edit_on_github_extension": "False",
"github_project": "astropy/astropy",
"use_travis_ci": "y",
Expand All @@ -19,9 +19,5 @@
"initialize_git_repo": "y",
"_parent_project": "astropy",
"_install_requires": "astropy",
"_copy_without_render": [
"docs/_templates"
],
"minimum_python_version": ["3.7", "3.6", "3.5"],
"astropy_helpers_version": "v3.2.1"
}
5 changes: 1 addition & 4 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,12 @@ def process_licence(licence_name):
remove_file('.rtd-environment.yml')
remove_file('readthedocs.yml')

if '{{ cookiecutter.include_cextern_folder }}' != 'y':
remove_dir("cextern")

if '{{ cookiecutter.include_example_code }}' != 'y':
remove_dir('{{ cookiecutter.module_name }}/example_subpkg/')
remove_file('{{ cookiecutter.module_name }}/example_mod.py')
remove_file('{{ cookiecutter.module_name }}/tests/test_example.py')

if '{{ cookiecutter.include_example_cython_code }}' != 'y':
if '{{ cookiecutter.use_compiled_extensions }}' != 'y' or '{{ cookiecutter.include_example_code }}' != 'y':
remove_file('{{ cookiecutter.module_name }}/example_c.pyx')

if '{{ cookiecutter.initialize_git_repo }}' == 'y':
Expand Down
2 changes: 0 additions & 2 deletions {{ cookiecutter.package_name }}/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
:target: http://www.astropy.org
:alt: Powered by Astropy Badge

{{ cookiecutter.long_description|wordwrap(break_long_words=False) }}


License
-------
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion {{ cookiecutter.package_name }}/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Documentation
=============

This is the documentation for {{ cookiecutter.package_name }}.
{{ cookiecutter.long_description|wordwrap(break_long_words=False) }}

.. toctree::
:maxdepth: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def primes(imax):

def do_primes(n, usecython=False):
if usecython:
{% if cookiecutter.include_example_cython_code != 'y' %}
{% if cookiecutter.use_compiled_extensions != 'y' %}
raise Exception("This template does not have the example C code included.")
{% else %}
from .example_c import primes as cprimes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if cookiecutter.include_example_cython_code == 'y' %}
{% if cookiecutter.use_compiled_extensions == 'y' %}
def test_primes_c():
from ..example_c import primes as primes_c
assert primes_c(10) == [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
Expand Down

0 comments on commit 3430879

Please sign in to comment.