GithubHelp home page GithubHelp logo

Comments (5)

betatim avatar betatim commented on June 23, 2024 2

#40 doesn't quite close this issue as we still use a file local to the repository to store the token instead of placing it in ~/.abc.token (or some such). That is for another PR to solve.

from abc-classroom.

betatim avatar betatim commented on June 23, 2024

Alternatively place the token in ~/.abc.config and share it between all courses.

from abc-classroom.

lwasser avatar lwasser commented on June 23, 2024

Note - this is the error i get running nbinit when i already have a token (just for the record)

Traceback (most recent call last):
  File "/Users/leah-su/anaconda3/bin/nbinit", line 11, in <module>
    sys.exit(init())
  File "/Users/leah-su/anaconda3/lib/python3.6/site-packages/grading/__main__.py", line 60, in init
    two_factor_callback=two_factor)
  File "/Users/leah-su/anaconda3/lib/python3.6/site-packages/github3/api.py", line 26, in deprecation_wrapper
    return func(*args, **kwargs)
  File "/Users/leah-su/anaconda3/lib/python3.6/site-packages/github3/api.py", line 59, in authorize
    client_secret)
  File "/Users/leah-su/anaconda3/lib/python3.6/site-packages/github3/github.py", line 462, in authorize
    json = self._json(self._post(url, data=data), 201)
  File "/Users/leah-su/anaconda3/lib/python3.6/site-packages/github3/models.py", line 156, in _json
    raise exceptions.error_for(response)
github3.exceptions.UnprocessableEntity: 422 Validation Failed

from abc-classroom.

lwasser avatar lwasser commented on June 23, 2024

related to this is -- is this authorize() call deprecated? see here please. something odd is going on with the init command that i can't figure out .i seem to have to delete it each time or every so often. could be user error!

As it currently stands in the PR below, i just check for the config file in the template dir. if that contains the token then nbinit doesn't do anything. If not, it will authenticate and create a token.

NOTE - this will still fail if a token exists (i think??) as i believe authorize() makes a new token. I tried to figure out how to get a list of existing tokens and was having some issue with that. there is a check_auth method that i think might do what we want.

I think we want to

  1. check to see if a token exists in the file - do nothing if it's there - all good! maybe print a happy message
  2. If it's not there
    a. check to see if that token exists in the gh account. if it does, grab the token vals and add to yml
    b. if it's not there run authorize

from abc-classroom.

betatim avatar betatim commented on June 23, 2024

Good catch with the deprecation. I hadn't noticed this. Take a look at #40

from abc-classroom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.