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

Issues creating new abc classroom template #358

Closed nkorinek closed 3 years ago

nkorinek commented 3 years ago

This testing was done on this branch: https://github.com/earthlab/abc-classroom/pull/335 .

The first error I ran into was an issue with shutil.copy inside the template. When creating a new assignment, I got this output.''

 abc-new-template ea-2021-02-ms-remote-sensing --github --mode merge
Loading configuration from config.yml
Oops! The directory specified: template_repos/ea-2021-02-ms-remote-sensing-template already exists for this course; will keep directory but overwrite existing files with same names
Copying assignment files to template_repos/ea-2021-02-ms-remote-sensing-template: 
Moving: /home/nathan/GitHub/ea-python-spring-2021-abc/nbgrader/release/ea-2021-02-ms-remote-sensing/ea-2021-02-ms-remote-sensing.ipynb
Copied 1 files to your template assignment git repo: /home/nathan/GitHub/ea-python-spring-2021-abc/template_repos/ea-2021-02-ms-remote-sensing-template!
The files copied include: [PosixPath('/home/nathan/GitHub/ea-python-spring-2021-abc/nbgrader/release/ea-2021-02-ms-remote-sensing/ea-2021-02-ms-remote-sensing.ipynb')]
Copying extra files: 
 extra_files/colored-bar.png
 extra_files/earth-lab-logo-rgb.png
 extra_files/readme.md
 extra_files/.github
Traceback (most recent call last):
  File "/home/nathan/miniconda3/envs/abc-dev/bin/abc-new-template", line 33, in <module>
    sys.exit(load_entry_point('abc-classroom', 'console_scripts', 'abc-new-template')())
  File "/home/nathan/GitHub/abc-classroom/abcclassroom/__main__.py", line 143, in new_template
    template.new_update_template(args)
  File "/home/nathan/GitHub/abc-classroom/abcclassroom/template.py", line 31, in new_update_template
    create_template(
  File "/home/nathan/GitHub/abc-classroom/abcclassroom/template.py", line 89, in create_template
    copy_extra_files(config, template_repo_path, assignment_name)
  File "/home/nathan/GitHub/abc-classroom/abcclassroom/template.py", line 335, in copy_extra_files
    shutil.copy(f, template_repo)
  File "/home/nathan/miniconda3/envs/abc-dev/lib/python3.8/shutil.py", line 415, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/nathan/miniconda3/envs/abc-dev/lib/python3.8/shutil.py", line 261, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
IsADirectoryError: [Errno 21] Is a directory: '/home/nathan/GitHub/ea-python-spring-2021-abc/extra_files/.github'

I got past this error by moving the extra_files/.github. At some point during this an empty GitHub repo with this assignments name was created. It may have been this step that created the empty repo on GitHub for the assignment, we're not entirely sure how that was made.

After that, when I reran the above code I got the following error.

abc-new-template ea-2021-02-ms-remote-sensing --github --mode merge
Loading configuration from config.yml
Oops! The directory specified: template_repos/ea-2021-02-ms-remote-sensing-template already exists for this course; will keep directory but overwrite existing files with same names
Copying assignment files to template_repos/ea-2021-02-ms-remote-sensing-template: 
Moving: /home/nathan/GitHub/ea-python-spring-2021-abc/nbgrader/release/ea-2021-02-ms-remote-sensing/ea-2021-02-ms-remote-sensing.ipynb
Copied 1 files to your template assignment git repo: /home/nathan/GitHub/ea-python-spring-2021-abc/template_repos/ea-2021-02-ms-remote-sensing-template!
The files copied include: [PosixPath('/home/nathan/GitHub/ea-python-spring-2021-abc/nbgrader/release/ea-2021-02-ms-remote-sensing/ea-2021-02-ms-remote-sensing.ipynb')]
Copying extra files: 
 extra_files/colored-bar.png
 extra_files/earth-lab-logo-rgb.png
 extra_files/readme.md
 extra_files/environment.yml
 extra_files/.gitignore
Changing name of 'master' branch to 'main'
        in repo /home/nathan/GitHub/ea-python-spring-2021-abc/template_repos/ea-2021-02-ms-remote-sensing-template
Updating assignment list in config
Writing modified config at /home/nathan/GitHub/ea-python-spring-2021-abc
Creating remote repo ea-2021-02-ms-remote-sensing-template
Creating new repository ea-2021-02-ms-remote-sensing-template at https://github.com/earthlab-education
Pushing any changes to remote repository on GitHub.
Push to github failed. This is usually because there are
            changes on the remote that you do not have locally. Here is the
            github error:
error: src refspec main does not match any
error: failed to push some refs to 'git@github.com:earthlab-education/ea-2021-02-ms-remote-sensing-template.git'

We just pushed everything manually after this error.

nkorinek commented 3 years ago

@lwasser this issue can be closed!