astropy / package-template

Template for packages that use Astropy. Maintainer: @astrofrog
http://docs.astropy.org/projects/package-template/en/latest/
Other
60 stars 62 forks source link

Unable to install package template #333

Closed perwin closed 6 years ago

perwin commented 6 years ago

I'm getting a consistent failure trying to install the package template (purely for exploratory purposes at the moment, which is why my example has minimal answers to the questions). It crashes right at the end of the question-asking phase. The culprit appears to be a call in the jinja2 package to a non-existent attribute of the arrow module.

It does create a skeleton directory structure with some of the associated files and subdirectories (cextern, docs, licenses), but not any of the promised example files.

I'm hoping this is some peculiar issue someone has seen before...?

(MacBook Pro 2017, macOS 10.12.6, python.org Python 3.6, cookiecutter and other packages installed via pip)

$ cookiecutter -c cookiecutter gh:astropy/package-template
You've downloaded /Users/erwin/.cookiecutters/package-template before. Is it okay to delete and re-download it? [yes]: yes
package_name [packagename]: MyTest
module_name [mytest]: 
short_description [MyTest]: 
long_description []: 
author_name [Astropy Developers]: 
author_email []: 
Select license:
1 - BSD 3-Clause
2 - GNU GPL v3+
3 - Apache Software Licence 2.0
4 - BSD 2-Clause
5 - Other
Choose from 1, 2, 3, 4, 5 [1]: 1
project_url [http://astropy.org]: 
project_version [0.0.dev0]: 
include_example_code [y]: 
include_example_cython_code [n]: y
include_cextern_folder [n]: 
edit_on_github_extension [False]: 
github_project [astropy/astropy]: 
use_travis_ci [y]: 
use_appveyor_ci [y]: n
use_read_the_docs [y]: 
sphinx_theme [astropy-bootstrap]: 
initialize_git_repo [y]: 
Select minimum_python_version:
1 - 3.6
2 - 3.5
3 - 2.7
Choose from 1, 2, 3 [1]: 3
astropy_helpers_version [v2.0.6]: 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/cookiecutter", line 11, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/cli.py", line 120, in main
    password=os.environ.get('COOKIECUTTER_REPO_PASSWORD')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/main.py", line 94, in cookiecutter
    output_dir=output_dir
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/generate.py", line 364, in generate_files
    generate_file(project_dir, infile, context, env)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cookiecutter/generate.py", line 172, in generate_file
    rendered_file = tmpl.render(**context)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "./licenses/APACHE2.rst", line 1, in top-level template code
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/jinja2_time/jinja2_time.py", line 35, in _now
    return arrow.now(timezone).strftime(datetime_format)
AttributeError: module 'arrow' has no attribute 'now'
perwin commented 6 years ago

OK, my apologies -- this seems to have been due to a conflict between the arrow package and and older (unrelated) "arrow.py" module that was sitting in a miscellaneous files directory that's on my Python path. Renaming the latter seems to have fixed things, and the package template installs correctly now.