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

AttributeError during upgrade to 18.0 #169

Closed
mlissner opened this issue May 20, 2020 · 10 comments
Closed

AttributeError during upgrade to 18.0 #169

mlissner opened this issue May 20, 2020 · 10 comments

Comments

@mlissner
Copy link

@mlissner mlissner commented May 20, 2020

I haven't figured out what's happening here, but it seems to be related to version 18.0. When I upgrade, I get this:

Collecting httplib2
  Downloading httplib2-0.18.0.tar.gz (257 kB)
     |████████████████████████████████| 257 kB 8.4 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /var/www/.virtualenvs/courtlistener/bin/python /var/www/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpUiA7Ve
       cwd: /tmp/pip-install-Ry2SoI/httplib2
  Complete output (10 lines):
  Traceback (most recent call last):
    File "/var/www/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/var/www/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/var/www/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 108, in get_requires_for_build_wheel
      backend = _build_backend()
    File "/var/www/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 99, in _build_backend
      obj = getattr(obj, path_part)
  AttributeError: 'module' object has no attribute '__legacy__'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /var/www/.virtualenvs/courtlistener/bin/python /var/www/.virtualenvs/courtlistener/local/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpUiA7Ve Check the logs for full command output.

I'm on Python 2.7, unfortunately, but that seems OK?

@mlissner
Copy link
Author

@mlissner mlissner commented May 20, 2020

Still haven't figured this out, but pip seems to look for the __legacy__ attribute when you don't have a build system configured...or something:

https://github.com/pypa/pip/blob/cc7494033ad108e80fa126295c4d8d134f21b5b2/docs/html/reference/pip.rst#pep-517-and-518-support

@temoto
Copy link
Member

@temoto temoto commented May 20, 2020

Please try pip install 'setuptools>=40.8.0'

@temoto
Copy link
Member

@temoto temoto commented May 20, 2020

Scratch that, we're going to try another thing in few minutes.

@mlissner
Copy link
Author

@mlissner mlissner commented May 20, 2020

Thank goodness somebody is looking at this. I'm a experienced Python dev, but I'm pretty lost on this one.

@temoto
Copy link
Member

@temoto temoto commented May 20, 2020

@mlissner please try this

pip install https://github.com/httplib2/httplib2/archive/92ec6ab3dc6f97b7d90ca172dd1c6e0bbce8d72f.zip

@mlissner
Copy link
Author

@mlissner mlissner commented May 20, 2020

That's a fix, but I don't know what to make of it. Looks like this is the diff:

--- /home/mlissner/test-py/http2-master/pyproject.toml
+++ /home/mlissner/test-py/httplib2-92ec6ab3dc6f97b7d90ca172dd1c6e0bbce8d72f/pyproject.toml
@@ -1,5 +1,6 @@
 [build-system]
-requires = ["setuptools", "wheel"]
+requires = ["setuptools >= 40.8.0", "wheel"]
+build-backend = "setuptools.build_meta"
 
 [tool.black]
 line-length = 121

We have a pyproject.toml file in this project, but it only has a section for black and nothing else.

@temoto
Copy link
Member

@temoto temoto commented May 20, 2020

You may get better understanding from this helpful comment

Merge/release is going to take some time now.

@mlissner
Copy link
Author

@mlissner mlissner commented May 20, 2020

That's wildly helpful. I looked but hadn't found that issue yet. I'll try to wait for your fix before messing around anymore in our system. Thank you again for jumping on this. It's rare to get such quick help.

@temoto temoto closed this in cb2940a May 20, 2020
@temoto
Copy link
Member

@temoto temoto commented May 20, 2020

@mlissner please try pip install -U httplib2 should be fixed in 0.18.1

@mlissner
Copy link
Author

@mlissner mlissner commented May 20, 2020

Worked like a charm. Thank you, this is amazing.

kraj added a commit to YoeDistro/meta-openembedded that referenced this issue Jun 26, 2020
Upgrade to release 0.18.1:

- explicit build-backend workaround for pip build isolation bug
  "AttributeError: 'module' object has no attribute '__legacy__'"
  on pip install
  httplib2/httplib2#169
- IMPORTANT security vulnerability CWE-93 CRLF injection
  Force %xx quote of space, CR, LF characters in uri.
  https://cwe.mitre.org/data/definitions/93.html

PKG-INFO md5 checksum changed, the license remains the same.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj added a commit to YoeDistro/meta-openembedded that referenced this issue Jun 27, 2020
Upgrade to release 0.18.1:

- explicit build-backend workaround for pip build isolation bug
  "AttributeError: 'module' object has no attribute '__legacy__'"
  on pip install
  httplib2/httplib2#169
- IMPORTANT security vulnerability CWE-93 CRLF injection
  Force %xx quote of space, CR, LF characters in uri.
  https://cwe.mitre.org/data/definitions/93.html

PKG-INFO md5 checksum changed, the license remains the same.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj added a commit to YoeDistro/meta-openembedded that referenced this issue Jun 28, 2020
Upgrade to release 0.18.1:

- explicit build-backend workaround for pip build isolation bug
  "AttributeError: 'module' object has no attribute '__legacy__'"
  on pip install
  httplib2/httplib2#169
- IMPORTANT security vulnerability CWE-93 CRLF injection
  Force %xx quote of space, CR, LF characters in uri.
  https://cwe.mitre.org/data/definitions/93.html

PKG-INFO md5 checksum changed, the license remains the same.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj added a commit to YoeDistro/meta-openembedded that referenced this issue Jun 29, 2020
Upgrade to release 0.18.1:

- explicit build-backend workaround for pip build isolation bug
  "AttributeError: 'module' object has no attribute '__legacy__'"
  on pip install
  httplib2/httplib2#169
- IMPORTANT security vulnerability CWE-93 CRLF injection
  Force %xx quote of space, CR, LF characters in uri.
  https://cwe.mitre.org/data/definitions/93.html

PKG-INFO md5 checksum changed, the license remains the same.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
halstead pushed a commit to openembedded/meta-openembedded that referenced this issue Jun 29, 2020
Upgrade to release 0.18.1:

- explicit build-backend workaround for pip build isolation bug
  "AttributeError: 'module' object has no attribute '__legacy__'"
  on pip install
  httplib2/httplib2#169
- IMPORTANT security vulnerability CWE-93 CRLF injection
  Force %xx quote of space, CR, LF characters in uri.
  https://cwe.mitre.org/data/definitions/93.html

PKG-INFO md5 checksum changed, the license remains the same.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Acked-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants