OCA / maintainer-tools

Odoo Maintainers Tools & conventions for OCA members which evaluate and maintain repositories.
GNU Affero General Public License v3.0
277 stars 460 forks source link

oca-github-login failing #489

Open pniederlag opened 3 years ago

pniederlag commented 3 years ago

Steps to reproduce

  1. reading readme in order to get involved
  2. git clone and pipx install ./maintainer-tools
  3. start with oca-github-login pniederlag

Current behavior

Two-Factor-Auth is enabled on my account


oca-github-login pniederlag
Password for pniederlag: 
Traceback (most recent call last):
  File "/home/pn/.local/bin/oca-github-login", line 8, in <module>
    sys.exit(main())
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/tools/github_login.py", line 78, in main
    authorize_token(args.username)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/tools/github_login.py", line 54, in authorize_token
    two_factor_callback=two_factor_prompt)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/api.py", line 29, in deprecation_wrapper
    return func(*args, **kwargs)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/api.py", line 72, in authorize
    username, password, scopes, note, note_url, client_id, client_secret
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/github.py", line 503, in authorize
    json = self._json(self._post(url, data=data), 201)
  File "/home/pn/.local/pipx/venvs/oca-maintainers-tools/lib/python3.6/site-packages/github3/models.py", line 156, in _json
    raise exceptions.error_for(response)
github3.exceptions.NotFoundError: 404 Not Found

### Expected behavior

- token is added

### Workaround

- run python tools/config.py creates a oca.cfg in current directory
- create token with necessary permissions on personal github account
- Add github username and token in oca.cfg
simahawk commented 3 years ago

the workaround works for me as well. Can you propose a PR to include this in the readme?

NL66278 commented 2 years ago

The workaround also worked for this problem:

$ oca-github-login NL66278
Password for NL66278: 
Traceback (most recent call last):
  File "/home/openeyedev/run/odoo-15.0/bin/oca-github-login", line 11, in <module>
    load_entry_point('oca-maintainers-tools==0.1.dev1062+g7d8a9f9', 'console_scripts', 'oca-github-login')()
  File "/home/openeyedev/run/odoo-15.0/lib/python3.9/site-packages/oca_maintainers_tools-0.1.dev1062+g7d8a9f9-py3.9.egg/tools/github_login.py", line 78, in main
    authorize_token(args.username)
  File "/home/openeyedev/run/odoo-15.0/lib/python3.9/site-packages/oca_maintainers_tools-0.1.dev1062+g7d8a9f9-py3.9.egg/tools/github_login.py", line 53, in authorize_token
    auth = github3.authorize(user, password, scopes, note, note_url,
AttributeError: module 'github3' has no attribute 'authorize
simahawk commented 2 years ago

I think I ended up pinning an old version and the forgot to report here.... wait

simahawk commented 2 years ago

Last version that worked for me was 1.4.0 I think. A bit of history here https://github.com/OCA/maintainer-tools/issues/446

bealdav commented 1 year ago

I also fail in

    auth = github3.authorize(user, password, scopes, note, note_url,
AttributeError: module 'github3' has no attribute 'authorize

What is the fallback to get oca-github-login working.

Do you know which commit ? Thanks

ilyasProgrammer commented 1 year ago

I have same issue. 404 or module 'github3' has no attribute 'authorize. Depend on version. What access rights need to enable for token ?

simahawk commented 1 year ago

GH lib api changed a lot, we should update/refactor/trash things here. If you have time, any contrib is welcomed ;) Meanwhile, workaround: use a token and run export GITHUB_TOKEN=xyz