XeroAPI / xero-python-oauth2-app

python app for demonstrating the xero-python SDK
MIT License
18 stars 30 forks source link

requirements.txt error #13

Closed pguerin3 closed 3 years ago

pguerin3 commented 3 years ago

Same issue as for the xero-python-oauth-starter

$ git clone git@github.com:XeroAPI/xero-python-oauth2-app.git
Cloning into 'xero-python-oauth2-app'...
remote: Enumerating objects: 185, done.
remote: Counting objects: 100% (185/185), done.
remote: Compressing objects: 100% (127/127), done.
remote: Total 185 (delta 101), reused 128 (delta 55), pack-reused 0
Receiving objects: 100% (185/185), 2.80 MiB | 1.21 MiB/s, done.
Resolving deltas: 100% (101/101), done.

Clearly no issues with SSH, but the error is with the requirements.txt file.

$ cd xero-python-oauth2-app
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt

Log of the requirements.txt file is below:

Collecting flask (from -r requirements.txt (line 1))
  Using cached https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl
Collecting Flask-Session from git+https://github.com/SqrtMinusOne/flask-session.git@560d00f1a84a9924d788a4f4e1ef35c5cf94c76d#egg=Flask-Session (from -r requirements.txt (line 5))
  Cloning https://github.com/SqrtMinusOne/flask-session.git (to 560d00f1a84a9924d788a4f4e1ef35c5cf94c76d) to /tmp/pip-build-bgv6rpix/Flask-Session
  Could not find a tag or branch '560d00f1a84a9924d788a4f4e1ef35c5cf94c76d', assuming commit.
Collecting Flask-OAuthlib from git+https://github.com/ageis/flask-oauthlib.git@c5ea3ace957ceeeeab3cfb6556f32685ff292eab#egg=Flask-OAuthlib (from -r requirements.txt (line 8))
  Cloning https://github.com/ageis/flask-oauthlib.git (to c5ea3ace957ceeeeab3cfb6556f32685ff292eab) to /tmp/pip-build-bgv6rpix/Flask-OAuthlib
  Could not find a tag or branch 'c5ea3ace957ceeeeab3cfb6556f32685ff292eab', assuming commit.
fatal: unable to connect to github.com:
github.com[0: 140.82.112.4]: errno=Connection timed out

fatal: clone of 'git://github.com/lepture/flask-sphinx-themes.git' into submodule path '/tmp/pip-build-bgv6rpix/Flask-OAuthlib/docs/_themes' failed
Failed to clone 'docs/_themes'. Retry scheduled
fatal: unable to connect to github.com:
github.com[0: 140.82.114.3]: errno=Connection timed out

fatal: clone of 'git://github.com/lepture/flask-sphinx-themes.git' into submodule path '/tmp/pip-build-bgv6rpix/Flask-OAuthlib/docs/_themes' failed
Failed to clone 'docs/_themes' a second time, aborting
Command "git submodule update --init --recursive -q" failed with error code 1 in /tmp/pip-build-bgv6rpix/Flask-OAuthlib
You are using pip version 9.0.3, however version 20.2.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ 

Note - I am using pip 9.0.3.

The contents of the requirements.txt file is below:

$ cat requirements.txt
flask
# Werkzeug<1.0  # flask-session not compatible
# see https://github.com/fengsp/flask-session/pull/114
# using patched version of flask-session
git+https://github.com/SqrtMinusOne/flask-session.git@560d00f1a84a9924d788a4f4e1ef35c5cf94c76d#egg=Flask-Session
# Werkzeug<1.0  # flask-oauthlib not compatible
# using patched version of flask-oauthlib
git+https://github.com/ageis/flask-oauthlib.git@c5ea3ace957ceeeeab3cfb6556f32685ff292eab#egg=Flask-OAuthlib

# Use development version of xero-python
#git+ssh://git@github.com/xero-github/xero-python.git@020f780b4e2b48cb33746ae19ddab9fdf128e626#egg=xero-python
xero-python==1.1.0(venv) [test@localhost xero-python-oauth2-app]$ 
pguerin3 commented 3 years ago

I have identified the problem. The Github instructions say this:

Paste the text below, substituting in your GitHub email address.
$ ssh-keygen -t ed25519 -C "your_email@example.com"

Note: If you are using a legacy system that doesn't support the Ed25519 algorithm, use:
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

So I had created SSH keys using the Ed25519 algorithm, and I got the issues above. I now recreated the SSH keys using RSA, and the requirements.txt script executes without error.