regro / rever

Releaser of Versions
https://regro.github.io/rever-docs/
BSD 3-Clause "New" or "Revised" License
75 stars 34 forks source link

module 'github3' has no attribute 'authorize' #246

Closed geoffreygarrett closed 3 years ago

geoffreygarrett commented 3 years ago

Can't seem to get ghrelease working in the workflow. I remember it worked in the past. After minor investigation, seems to be incompatibility with github3.py 2.0.0?

(tudat-docs) ggarrett@DESKTOP-48LNJLH:/mnt/c/Users/ggarr/Repositories/tudat-bundle/tudatpy$ rever check
All CLI and import requirements met for authors activity
Warning! Found 8,544 executable files in the PATH directories!
activity-check:authors:Checked activity authors
No checks needed for version_bump activity
No checks needed for changelog activity
All CLI and import requirements met for ghrelease activity
GitHub Username: ggarrett13
GitHub Password for ggarrett13:
Unable to login to GitHub
module 'github3' has no attribute 'authorize'

Packages installed:

(tudat-docs) ggarrett@DESKTOP-48LNJLH:/mnt/c/Users/ggarr/Repositories/tudat-bundle/tudatpy$ conda install rever -c conda
-forge
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/ggarrett/anaconda3/envs/tudat-docs

  added / updated specs:
    - rever

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ndg-httpsclient-0.5.1      |             py_1          26 KB  conda-forge
    pyasn1-0.4.8               |             py_0          53 KB  conda-forge
    ------------------------------------------------------------
                                           Total:          79 KB

The following NEW packages will be INSTALLED:

  backports          conda-forge/noarch::backports-1.0-py_2
  backports.functoo~ conda-forge/noarch::backports.functools_lru_cache-1.6.4-pyhd8ed1ab_0
  brotlipy           conda-forge/linux-64::brotlipy-0.7.0-py38h8df0ef7_1001
  cffi               pkgs/main/linux-64::cffi-1.14.5-py38h261ae71_0
  chardet            conda-forge/linux-64::chardet-4.0.0-py38h578d9bd_1
  conda-suggest      conda-forge/noarch::conda-suggest-0.1.1-pyh9f0ad1d_0
  conda-suggest-con~ conda-forge/linux-64::conda-suggest-conda-forge-2021.4.24-ha770c72_0
  cryptography       conda-forge/linux-64::cryptography-3.4.7-py38ha5dfef3_0
  github3.py         conda-forge/noarch::github3.py-2.0.0-pyhd8ed1ab_0
  idna               conda-forge/noarch::idna-2.10-pyh9f0ad1d_0
  jwcrypto           conda-forge/noarch::jwcrypto-0.6.0-py_0
  lazyasd            conda-forge/noarch::lazyasd-0.1.4-py_1
  ndg-httpsclient    conda-forge/noarch::ndg-httpsclient-0.5.1-py_1
  prompt-toolkit     conda-forge/noarch::prompt-toolkit-3.0.18-pyha770c72_0
  prompt_toolkit     conda-forge/noarch::prompt_toolkit-3.0.18-hd8ed1ab_0
  pyasn1             conda-forge/noarch::pyasn1-0.4.8-py_0
  pycparser          conda-forge/noarch::pycparser-2.20-pyh9f0ad1d_2
  pygments           conda-forge/noarch::pygments-2.8.1-pyhd8ed1ab_0
  pyopenssl          conda-forge/noarch::pyopenssl-20.0.1-pyhd8ed1ab_0
  pysocks            conda-forge/linux-64::pysocks-1.7.1-py38h578d9bd_3
  python-dateutil    conda-forge/noarch::python-dateutil-2.8.1-py_0
  python_abi         conda-forge/linux-64::python_abi-3.8-1_cp38
  requests           conda-forge/noarch::requests-2.25.1-pyhd3deb0d_0
  rever              conda-forge/noarch::rever-0.4.8-py_0
  ruamel.yaml        conda-forge/linux-64::ruamel.yaml-0.16.12-py38h25fe258_1
  ruamel.yaml.clib   conda-forge/linux-64::ruamel.yaml.clib-0.2.2-py38h25fe258_1
  setproctitle       conda-forge/linux-64::setproctitle-1.1.10-py38h1e0a361_1003
  simplejson         conda-forge/linux-64::simplejson-3.17.2-py38h1e0a361_1
  six                conda-forge/noarch::six-1.15.0-pyh9f0ad1d_0
  tqdm               conda-forge/noarch::tqdm-4.60.0-pyhd8ed1ab_0
  uritemplate        conda-forge/noarch::uritemplate-3.0.1-py_0
  urllib3            conda-forge/noarch::urllib3-1.26.4-pyhd8ed1ab_0
  wcwidth            conda-forge/noarch::wcwidth-0.2.5-pyh9f0ad1d_2
  xonsh              conda-forge/linux-64::xonsh-0.9.27-py38h578d9bd_0

The following packages will be UPDATED:

  certifi            pkgs/main::certifi-2020.12.5-py38h06a~ --> conda-forge::certifi-2020.12.5-py38h578d9bd_1

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates    pkgs/main::ca-certificates-2021.4.13-~ --> conda-forge::ca-certificates-2020.12.5-ha878542_0

Proceed ([y]/n)? y

Downloading and Extracting Packages
ndg-httpsclient-0.5. | 26 KB     | ############################################################################# | 100%
pyasn1-0.4.8         | 53 KB     | ############################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
geoffreygarrett commented 3 years ago

After forcing install of github3.py 1.3.0:

/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/rever/github.xsh:90: DeprecationWarning: The anonymous API function `github3.api.authorize` is deprecated. Use `GitHub.authorize` instead.
  auth = github3.authorize(username, password, scopes, note, note_url,
activity-error:ghrelease:activity failed with execption:

But also finally:

github3.exceptions.NotFoundError: 404 Not Found
geoffreygarrett commented 3 years ago

Installed from source, I realized that this is a known issue. Why not make a new conda release? Regardless, there's another issue cropping up (completely new tag/release version, never used).

(tudat-docs) ggarrett@DESKTOP-48LNJLH:/mnt/c/Users/ggarr/Repositories/tudat-bundle/tudatpy$ rever 0.5.24
Warning! Found 8,543 executable files in the PATH directories!
activity-start:authors:starting activity authors
wrote authors to AUTHORS
wrote authors since 0.5.23-rc to rever/LATEST-AUTHORS.json
wrote mailmap file to .mailmap
[feature/po_updates c33cc5e] Updated authorship for 0.5.24
 1 file changed, 1 insertion(+), 1 deletion(-)
activity-end:authors:activity authors complete
activity-start:version_bump:starting activity version_bump
[feature/po_updates 9f0cd2b] bumped version to 0.5.24
activity-end:version_bump:activity version_bump complete
activity-start:changelog:starting activity changelog
[feature/po_updates 8d64aff] Updated CHANGELOG for 0.5.24
 1 file changed, 9 insertions(+)
activity-end:changelog:activity changelog complete
activity-start:ghrelease:starting activity ghrelease
Archiving repository as rever/tudatpy-0.5.24.tar.gz
fatal: not a valid object name: 0.5.24
activity-error:ghrelease:activity failed with exception:
Traceback (most recent call last):
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/rever/activity.xsh", line 83, in __call__
    self.func(*args, **kwargs)
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/rever/activities/ghrelease.xsh", line 108, in _func
    filenames = asset()
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/rever/activities/ghrelease.xsh", line 43, in git_archive_asset
    ![git archive -9 --format=tar.gz --prefix=@(folder_name)/ -o @(fname) @(tag)]
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/xonsh/__amalgam__.py", line 20899, in subproc_captured_hiddenobject
    return xonsh.procs.specs.run_subproc(cmds, captured="hiddenobject", envs=envs)
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/xonsh/procs/__amalgam__.py", line 3497, in run_subproc
    command.end()
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/xonsh/procs/__amalgam__.py", line 907, in end
    self._end(tee_output=tee_output)
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/xonsh/procs/__amalgam__.py", line 926, in _end
    self._raise_subproc_error()
  File "/home/ggarrett/anaconda3/envs/tudat-docs/lib/python3.8/site-packages/xonsh/procs/__amalgam__.py", line 1052, in _raise_subproc_error
    raise subprocess.CalledProcessError(rtn, spec.args, output=self.output)
subprocess.CalledProcessError: Command '['git', 'archive', '-9', '--format=tar.gz', '--prefix=tudatpy-0.5.24/', '-o', 'rever/tudatpy-0.5.24.tar.gz', '0.5.24']' returned non-zero exit status 128.
rewinding to 8d64aff80d8f289edc880c335749eca78ac3b156
rjkoch commented 3 years ago

We are working towards a release now. There is a separate issue with a different feature.

The old version of github authentication is now deprecated. github3.py 2.0.0 introduced substantial changes to their API, so >=2.0.0 will be required in the new reverrelease.

rjkoch commented 3 years ago

This should be fixed with latest release (0.5.0) which should be going live on conda-forge soon.

rjkoch commented 3 years ago

The latest version of rever should fix this. closing.