earthlab / abc-classroom

Tools to automate github classroom and autograding workflows
https://abc-classroom.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
29 stars 21 forks source link

error when creating template repo - can't find the extra_files directory #268

Closed lwasser closed 3 years ago

lwasser commented 4 years ago
(earth-analytics-python) CIRES-EL-DM-041:fall-2020-abc-ea-bootcamp leahwasser$ abc-new-template bootcamp-2020-03-github
Loading configuration from config.yml
Creating new template repo at /Users/leahwasser/github/1-bootcamp-course/fall-2020-abc-ea-bootcamp/assignment_repos/bootcamp-2020-03-github-template
repo path: /Users/leahwasser/github/1-bootcamp-course/fall-2020-abc-ea-bootcamp/assignment_repos/bootcamp-2020-03-github-template
Getting assignment files
copying /Users/leahwasser/github/1-bootcamp-course/fall-2020-abc-ea-bootcamp/ea-bootcamp-fall-2020-nbgrader/release/bootcamp-2020-03-github/README.md to /Users/leahwasser/github/1-bootcamp-course/fall-2020-abc-ea-bootcamp/assignment_repos/bootcamp-2020-03-github-template
copying /Users/leahwasser/github/1-bootcamp-course/fall-2020-abc-ea-bootcamp/ea-bootcamp-fall-2020-nbgrader/release/bootcamp-2020-03-github/bootcamp-03-github.ipynb to /Users/leahwasser/github/1-bootcamp-course/fall-2020-abc-ea-bootcamp/assignment_repos/bootcamp-2020-03-github-template
Copied 2 files
Traceback (most recent call last):
  File "/Users/leahwasser/opt/miniconda3/envs/earth-analytics-python/bin/abc-new-template", line 8, in <module>
    sys.exit(new_template())
  File "/Users/leahwasser/opt/miniconda3/envs/earth-analytics-python/lib/python3.8/site-packages/abcclassroom/__main__.py", line 181, in new_template
    template.new_update_template(args)
  File "/Users/leahwasser/opt/miniconda3/envs/earth-analytics-python/lib/python3.8/site-packages/abcclassroom/template.py", line 32, in new_update_template
    create_extra_files(config, template_repo_path, assignment)
  File "/Users/leahwasser/opt/miniconda3/envs/earth-analytics-python/lib/python3.8/site-packages/abcclassroom/template.py", line 178, in create_extra_files
    nfiles = len(extra_files)
TypeError: object of type 'NoneType' has no len()
(earth-analytics-python) CIRES-EL-DM-041:fall-2020-abc-ea-bootcamp leahwasser$ 
nkorinek commented 4 years ago

@lwasser this bug is related to https://github.com/earthlab/abc-classroom/issues/272#issuecomment-693685486 since the folder doesn't exist it can't check the length of the files listed in the folder.

lwasser commented 4 years ago

what folder is it looking for @nkorinek ? i ask because the quickstart should make the directory but #272 it was failing when running the quickstart. i wouldnt think it would fail when running abc-quickstart ... super weird.

can we for this template function do a check to ensure extra_files exist and provide a little note that it doesn't exist so it fails gracefully? that seems like a good solution here.

nkorinek commented 4 years ago

Can do!

nkorinek commented 4 years ago

Hey @lwasser so in trying to fix this I've realized that this isn't an issue anymore. The line that crashed the code here, nfiles = len(extra_files), doesn't exist in abc-classroom anymore.

I was adding in this check in the quickstart module, where we discussed we don't need this check anymore, as we decided that we can assume the package was bundled correctly. . I added that check, realized it was in the wrong place, then went over to the template module to fix it there. However, this line of code no longer exists, it counts the files differently now. The new way that it checks the length of the folder also has a check to make sure the folder exists, and will fail gracefully if it doesn't.

All this to say, I'm fairly sure that in the next release of abc-classroom, this error has already been addressed and I don't have to open up a PR for it. Let me know if I'm missing something!

lwasser commented 4 years ago

ahhhh. ok @nkorinek well how about this. there is a shiny new version of abc-classroom on pypi already. conda forge will come tomorrow. do you want to test both pypi and conda forge for me ?

if all is good we can close this issue and reference the manifest file bundle issue!!

this is great!

i'll create a new issue on docstrings. and will have you work on another (feature) not bug next!

lwasser commented 3 years ago

@nkorinek were you able to test this on your computer? it seems to be working for me and if it works for you then i'll close this issue.

nkorinek commented 3 years ago

Yes, this works locally for me @lwasser !

lwasser commented 3 years ago

yay closing. thanks @nkorinek !