jckantor / nbpages

Command line tool to maintain a repository of Jupyter notebooks.
https://jckantor.github.io/nbpages/
MIT License
2 stars 4 forks source link

Error setting up dual repo #51

Closed adowling2 closed 4 years ago

adowling2 commented 4 years ago

@jckantor I am trying to set up https://github.com/ndcbe/cbe-xx258 to be the public version of https://github.com/ndcbe/CBExx258-instructor. After creating the public repo, I tried to run nbpages --setup, but got the following error message:

Traceback (most recent call last):
  File "/anaconda3/bin/nbpages", line 11, in <module>
    load_entry_point('nbpaages', 'console_scripts', 'nbpages')()
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/adowling/DowlingLab/Teaching/nbpages/src/nbpages/__init__.py", line 4, in <module>
    from .nbcollection import Nb, NbCollection
  File "/Users/adowling/DowlingLab/Teaching/nbpages/src/nbpages/nbcollection.py", line 20, in <module>
    sys.exit(1)
NameError: name 'sys' is not defined

I then manually made nbpages.cfg using the example here:

https://github.com/ndcbe/nbpages-testing-public/blob/master/nbpages.cfg

When I run nbpages --setup, I get the following error message:

Traceback (most recent call last):
  File "/anaconda3/bin/nbpages", line 11, in <module>
    load_entry_point('nbpaages', 'console_scripts', 'nbpages')()
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Users/adowling/DowlingLab/Teaching/nbpages/src/nbpages/__init__.py", line 4, in <module>
    from .nbcollection import Nb, NbCollection
  File "/Users/adowling/DowlingLab/Teaching/nbpages/src/nbpages/nbcollection.py", line 24, in <module>
    config = config["nbpages"]
  File "/anaconda3/lib/python3.7/configparser.py", line 958, in __getitem__
    raise KeyError(key)
KeyError: 'nbpages'

I am using the master branch of nbpages.

jckantor commented 4 years ago

There was a logical error in the import of modules resulting a circular dependence on the configuration file. The dependency was removed. A secondary issue was then incorrect logic on the deletion of redundant backups for the edge case of a new repository with no previous backup. These were fixed and tested.