astropy / package-template

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

APE17 - cookiecutter fails step 0 - example setup.py? #463

Closed HeloiseS closed 1 year ago

HeloiseS commented 4 years ago

Hello,

trying to do the migration in APE17: https://docs.astropy.org/projects/package-template/en/latest/ape17.html#step-rerender

Step 0 fails - badly for me - I checked if i could do this import in my interpreter and I have no issue so i don't know what's gone wrong

Traceback (most recent call last):
  File "/tmp/tmpnubQPB.py", line 5, in <module>
    import urllib.request
ImportError: No module named request
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully

Anyways, since i don't have my new shiny setup.py is it fine to use the astropy one as a basis?

astrofrog commented 4 years ago

@HeloiseS - just to check, are you using Python 2.7? If so, can you try using Python 3.6 or later?

HeloiseS commented 4 years ago

Thanks! I'm using 3.6.9 :)

astrofrog commented 4 years ago

@HeloiseS - ok thanks for checking, can you try again as I think I've removed the offending import (which wasn't needed)

astrofrog commented 4 years ago

(Just FYI I'm transferring the issue to the package-template repository)

HeloiseS commented 4 years ago

Thanks I re-ran cookie cutter and now I get the follow :/

Traceback (most recent call last):
  File "/tmp/tmpAG7jlI.py", line 46, in <module>
    remove_file('.rtd-environment.yml')
  File "/tmp/tmpAG7jlI.py", line 8, in remove_file
    os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
OSError: [Errno 2] No such file or directory: '/home/fste075/my_package_tmp/hoki/.rtd-environment.yml'
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)
Cadair commented 4 years ago

This looks like a real bug in the template, the names of the files in the template and the hook don't match. Easiest immediate workaround for you @HeloiseS is to just set use_readthedocs to true and delete the files yourself.

HeloiseS commented 4 years ago

Thanks :) will do

pllim commented 1 year ago

https://github.com/astropy/package-template#deprecation-warning