Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install awxkit as a requirement with pip 20.1 #6870

Closed
JacobCallahan opened this issue Apr 28, 2020 · 6 comments
Closed

Unable to install awxkit as a requirement with pip 20.1 #6870

JacobCallahan opened this issue Apr 28, 2020 · 6 comments

Comments

@JacobCallahan
Copy link

ISSUE TYPE
  • Bug Report
SUMMARY

While attempting to install my project in Fedora 32, and an updated pip 20.1, I see an attribute error during installation.
tl;dr: pip now returns a ParsedRequirement object on this line which does not have a req attribute.
https://github.com/pypa/pip/blob/master/src/pip/_internal/req/req_file.py#L80

ENVIRONMENT
  • AWX version: 9.3.0 - 11.1.0
  • AWX install method: pip - python 3.8.2
  • Ansible version: N/A
  • Operating System: Fedora 32
  • Web Browser: N/A
STEPS TO REPRODUCE

Attempt to install awxkit with pip 20.1

EXPECTED RESULTS

Installation succeeds

ACTUAL RESULTS

AttributeError: 'ParsedRequirement' object has no attribute 'req'

ADDITIONAL INFORMATION
⬢[jake@toolbox broker]$ python --version
Python 3.8.2
⬢[jake@toolbox broker]$ pip --version
pip 20.1 from /home/jake/.local/lib/python3.8/site-packages/pip (python 3.8)
⬢[jake@toolbox broker]$ 
⬢[jake@toolbox broker]$ pip install .
Defaulting to user installation because normal site-packages is not writeable
Processing /home/jake/Programming/broker
Collecting awxkit@ git+ssh://git@github.com/ansible/awx@9.3.0#egg=awxkit&subdirectory=awxkit
  Cloning ssh://****@github.com/ansible/awx (to revision 9.3.0) to /tmp/pip-install-0svyav4l/awxkit
  Running command git clone -q 'ssh://****@github.com/ansible/awx' /tmp/pip-install-0svyav4l/awxkit
  Running command git checkout -q 686ef7f9e474bbb5a461677cfeeb705dc2c8db7c
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0svyav4l/awxkit/awxkit/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0svyav4l/awxkit/awxkit/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-9_95o6_j
         cwd: /tmp/pip-install-0svyav4l/awxkit/awxkit
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-0svyav4l/awxkit/awxkit/setup.py", line 10, in <module>
        requirements = [str(r.req) for r in parse_requirements('requirements.txt', session=False)]
      File "/tmp/pip-install-0svyav4l/awxkit/awxkit/setup.py", line 10, in <listcomp>
        requirements = [str(r.req) for r in parse_requirements('requirements.txt', session=False)]
    AttributeError: 'ParsedRequirement' object has no attribute 'req'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
@JacobCallahan
Copy link
Author

This installs fine on pip 19.3.1

@ryanpetrello
Copy link
Contributor

I'm able to reproduce this:

pip3 install "git+https://github.com/ansible/awx/#egg=awxkit&subdirectory=awxkit"
Looking in links: file:///home/ryanpetrello/.pip/wheelhouse
Collecting awxkit
  Cloning https://github.com/ansible/awx/ to /tmp/pip-install-ampk7xlx/awxkit
  Running command git clone -q https://github.com/ansible/awx/ /tmp/pip-install-ampk7xlx/awxkit
    ERROR: Command errored out with exit status 1:
     command: /home/ryanpetrello/venvs/tmp-6f76486630e93c1/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ampk7xlx/awxkit/awxkit/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ampk7xlx/awxkit/awxkit/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-iyh_xdbp
         cwd: /tmp/pip-install-ampk7xlx/awxkit/awxkit
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ampk7xlx/awxkit/awxkit/setup.py", line 10, in <module>
        requirements = [str(r.req) for r in parse_requirements('requirements.txt', session=False)]
      File "/tmp/pip-install-ampk7xlx/awxkit/awxkit/setup.py", line 10, in <listcomp>
        requirements = [str(r.req) for r in parse_requirements('requirements.txt', session=False)]
    AttributeError: 'ParsedRequirement' object has no attribute 'req'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```

@kdelee
Copy link
Member

kdelee commented Apr 29, 2020

should be fixed by #6880

@JacobCallahan
Copy link
Author

I agree, thanks

@ryanpetrello
Copy link
Contributor

ryanpetrello commented Apr 29, 2020

@JacobCallahan

This should be resolved in the latest version of AWX, 11.2.0 (just published):

~ pip3 --version
pip 20.1 from /home/ryanpetrello/venvs/tmp-8df5d0f625f96c1/lib/python3.7/site-packages/pip (python 3.7)
~/venvs/tmp-8df5d0f625f96c1 pip3 install "git+https://github.com/ansible/awx.git@11.2.0#egg=awxkit&subdirectory=awxkit"
Looking in links: file:///home/ryanpetrello/.pip/wheelhouse
Collecting awxkit
  Cloning https://github.com/ansible/awx.git (to revision 11.2.0) to /tmp/pip-install-k43xrz0_/awxkit
  Running command git clone -q https://github.com/ansible/awx.git /tmp/pip-install-k43xrz0_/awxkit
  Running command git checkout -q b83feebc41522aee5f6b13556f26e0508a0fc851
Processing /home/ryanpetrello/.cache/pip/wheels/a7/c1/ea/cf5bd31012e735dc1dfea3131a2d5eae7978b251083d6247bd/PyYAML-5.3.1-cp37-cp37m-linux_x86_64.whl
Collecting requests
  Using cached requests-2.23.0-py2.py3-none-any.whl (58 kB)
Collecting chardet<4,>=3.0.2
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Using cached urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
Collecting idna<3,>=2.5
  Using cached idna-2.9-py2.py3-none-any.whl (58 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2020.4.5.1-py2.py3-none-any.whl (157 kB)
Building wheels for collected packages: awxkit
  Building wheel for awxkit (setup.py) ... done
  Created wheel for awxkit: filename=awxkit-11.2.0-py3-none-any.whl size=104456 sha256=59a53aaaeddec0a9dcd3d533ef2790daa793a606331fb49352e095cf8d49565b
  Stored in directory: /tmp/pip-ephem-wheel-cache-nbuv2mm6/wheels/d8/81/3d/c703db0f49cd41fa4ea49c4f036c2a48a47f8ee5d20d5c9f04
Successfully built awxkit
Installing collected packages: PyYAML, chardet, urllib3, idna, certifi, requests, awxkit
Successfully installed PyYAML-5.3.1 awxkit-11.2.0 certifi-2020.4.5.1 chardet-3.0.4 idna-2.9 requests-2.23.0 urllib3-1.25.9
~/venvs/tmp-8df5d0f625f96c1 awx --version
11.2.0
~/venvs/tmp-8df5d0f625f96c1 awx -h
usage: awx [--help] [--version] [--conf.host https://example.awx.org]
           [--conf.token TEXT] [--conf.username TEXT] [--conf.password TEXT]
           [-k] [-f {json,yaml,jq,human}] [--filter TEXT]
           [--conf.color BOOLEAN] [-v]
           resource ...

@JacobCallahan
Copy link
Author

@ryanpetrello thanks for the quick update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants