Bug 1686810

Summary: AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'
Product: Red Hat Enterprise Linux 8 Reporter: Petr Viktorin (pviktori) <pviktori>
Component: python-setuptoolsAssignee: Python Maintainers <python-maint>
Status: CLOSED UPSTREAM QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: low    
Version: 8.0CC: cstratak, extras-qa, infra-sig, lewk, mhroncok, mkonecny, rbarlow, rkuska
Target Milestone: rcKeywords: Rebase
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1679630
: 1726274 (view as bug list) Environment:
Last Closed: 2019-08-13 13:07:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1679630    
Bug Blocks: 1726274    

Description Petr Viktorin (pviktori) 2019-03-08 11:29:42 UTC
+++ This bug was initially created as a clone of Bug #1679630 +++

Description of problem:
Can't install local package with pip3 install -e
For more information see https://github.com/pypa/setuptools/issues/1694

Version-Release number of selected component (if applicable):
setuptools-40.4.3

How reproducible:
See https://github.com/pypa/setuptools/issues/1694

Actual results:
Obtaining file:///home/vagrant/devel
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  Complete output from command /home/vagrant/.virtualenvs/anitya/bin/python3 /home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp6db90a_q:
  Traceback (most recent call last):
    File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 48, in get_requires_for_build_wheel
      backend = _build_backend()
    File "/home/vagrant/.virtualenvs/anitya/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 39, in _build_backend
      obj = getattr(obj, path_part)
  AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'

Expected results:
The package is installed

Additional info:
According to the https://github.com/pypa/setuptools/issues/1694 the version 40.8.0 of setuptools should solve this.

--- Additional comment from Miro Hrončok on 2019-02-21 17:43:34 CET ---

Can you workaround this by updating both pip and setuptools in your virtual environment?

Anyway, updating to 40.8.0 is technically possible (we have that version in F30), but somebody would need to check if there are no backwards incompatible changes.

--- Additional comment from Michal Konecny on 2019-02-21 18:11:01 CET ---

Yes, I can workaround this when I don't use --system-site-packages flag when creating virtual environment.

But still this is something that could hit plenty of Fedora users.

--- Additional comment from Miro Hrončok on 2019-02-21 18:43:19 CET ---

Can you workaround this by updating both pip and setuptools in your virtual environment even if you use --system-site-packages?

(I'm asking because I want to understand this problem better, I'm not trying to talk myself out of fixing it.)

--- Additional comment from Miro Hrončok on 2019-02-21 18:56:30 CET ---

(Reading the upstream issue, I assume the answer is no.)

This is the most important issue: https://github.com/pypa/pip/issues/6264

Upstream pip is broken, but Fedora users will get it in venv via explicit update or in virtualenv (fetches newest version by default).

We should really update setuptools if it is at least bit possible.

--- Additional comment from Michal Konecny on 2019-02-22 09:12:20 CET ---

It doesn't work if you have newest version of setuptools in virtual environment and using --system-site-packages.

I have setuptools 40.8.0 in virtual environment and still experiencing this issue.

[...]

--- Additional comment from Miro Hrončok on 2019-02-27 01:10:39 CET ---

https://src.fedoraproject.org/rpms/python-setuptools/pull-request/17
https://src.fedoraproject.org/rpms/python-setuptools/pull-request/18

[...]

Comment 5 Charalampos Stratakis 2019-05-07 13:30:08 UTC
This is still low priority

Comment 6 Charalampos Stratakis 2019-05-07 13:30:39 UTC
Correction: Moving it to low priority

Comment 7 Petr Viktorin (pviktori) 2019-08-13 13:07:20 UTC
Upstream is aware of the issue, and we don't have capacity to work on this from our side.
If we get a customer report, let's reopen.

Comment 8 Petr Viktorin (pviktori) 2019-08-13 13:16:24 UTC
*** Bug 1726274 has been marked as a duplicate of this bug. ***