materialsproject / emmet

Be a master builder of databases of material properties. Avoid the Kragle.
https://materialsproject.github.io/emmet/
Other
53 stars 68 forks source link

ImportError: cannot import name 'authorize' from 'github3' #438

Closed Andrew-S-Rosen closed 1 year ago

Andrew-S-Rosen commented 2 years ago

In a fresh Python 3.8 environment, I pip install .'d emmet-core and then emmet-cli from the main branch and got the following traceback when doing emmet -h.

Traceback (most recent call last):
  File "/global/homes/r/rosen/software/miniconda/envs/emmet/bin/emmet", line 5, in <module>
    from emmet.cli.entry_point import safe_entry_point
  File "/global/homes/r/rosen/software/miniconda/envs/emmet/lib/python3.8/site-packages/emmet/cli/entry_point.py", line 6, in <module>
    from github3 import authorize, login
ImportError: cannot import name 'authorize' from 'github3' (/global/homes/r/rosen/software/miniconda/envs/emmet/lib/python3.8/site-packages/github3/__init__.py)

My current workaround is to use emmet 0.2.0 and downgrade github3.py to 1.3.0. Definitely not sustainable...

tschaume commented 1 year ago

The authorization API to create and retrieve access tokens on a user's behalf is not supported by GitHub anymore. I've moved the authorize import out of the way. The workaround is to manually create a (classic) GitHub token with user, repo, and gist permissions, and save it in the .emmet_credentials file in your home directory.