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

[Bug] no for read_the_docs_ results in crash in cookiecutter #500

Closed wkerzendorf closed 1 year ago

wkerzendorf commented 3 years ago
use_read_the_docs [y]: n
sphinx_theme [astropy-bootstrap]:
required_dependencies [astropy]:
optional_dependencies []:
Select minimum_python_version:
1 - 3.7
2 - 3.8
3 - 3.9
Choose from 1, 2, 3 [1]:
Traceback (most recent call last):
  File "/var/folders/d8/0jgrxkjs4yj6qpzvv22rdtsr0000gn/T/tmpz84v0hsr.py", line 47, in <module>
    remove_file('.rtd-environment.yml')
  File "/var/folders/d8/0jgrxkjs4yj6qpzvv22rdtsr0000gn/T/tmpz84v0hsr.py", line 8, in remove_file
    os.remove(os.path.join(PROJECT_DIRECTORY, filepath))
FileNotFoundError: [Errno 2] No such file or directory: '/Users/xxxxx/python/xxxx/.rtd-environment.yml'
pllim commented 3 years ago

This sounds very familiar but I cannot dig up an existing issue or PR. Hmm!

I think the fix is to allow silent failure for remove_file when the file doesn't exist but will have to defer to @Cadair et al.

hamogu commented 3 years ago

I just hit this bug, too. Exact same error with wildly different input, so seems like a legit bug and not just a random fluke.

pllim commented 1 year ago

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