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
Attempt to install awxkit with pip 20.1
Installation succeeds
AttributeError: 'ParsedRequirement' object has no attribute 'req'
猬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://[email protected]/ansible/[email protected]#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.
This installs fine on pip 19.3.1
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.
should be fixed by https://github.com/ansible/awx/pull/6880
I agree, thanks
@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/[email protected]#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 ...
@ryanpetrello thanks for the quick update!
Most helpful comment
This installs fine on pip 19.3.1