Bug 1679630 - AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'
Summary: AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-setuptools
Version: 29
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1686810 1726274
TreeView+ depends on / blocked
 
Reported: 2019-02-21 15:43 UTC by Michal Konecny
Modified: 2019-07-02 13:15 UTC (History)
7 users (show)

Fixed In Version: python-setuptools-40.8.0-1.fc29 python-setuptools-40.8.0-1.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1686810 (view as bug list)
Environment:
Last Closed: 2019-03-11 22:41:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pypa pip issues 6264 0 None open Virtualenv with --system-site-packages breaks pip's build isolation 2020-12-15 13:35:40 UTC

Description Michal Konecny 2019-02-21 15:43:51 UTC
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.

Comment 1 Miro Hrončok 2019-02-21 16:43:34 UTC
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.

Comment 2 Michal Konecny 2019-02-21 17:11:01 UTC
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.

Comment 3 Miro Hrončok 2019-02-21 17:43:19 UTC
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.)

Comment 4 Miro Hrončok 2019-02-21 17:56:30 UTC
(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.

Comment 5 Michal Konecny 2019-02-22 08:12:20 UTC
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.

Comment 6 Miro Hrončok 2019-02-22 15:34:49 UTC
That's what I thought. Thanks for clarifying.

Comment 7 Miro Hrončok 2019-02-27 00:00:15 UTC
We have 39.2.0 in F29 and F28.

I'm reading the changes in https://setuptools.readthedocs.io/en/latest/history.html that happened since.

 - Drop support for Python 3.3 -> we have 3.3 on F28, but it bundles it's own wheel. ✔️
 - Deprecated upload and register commands -> not removed yet. ✔️ 
 - Officially deprecated the requires parameter in setup() -> not removed yet. ✔️ 
 - Resource paths are passed to pkg_resources.resource_string and similar no longer accept paths that traverse parents -> results in DeprecationWarning only. ✔️ 

I think we are OK. Will prep PRs.

Comment 8 Miro Hrončok 2019-02-27 00:02:02 UTC
> We have 39.2.0 in F29 and F28.

Correction. We have 40.4.3 in F29 and 39.2.0 in F28.

Comment 10 Fedora Update System 2019-03-01 12:33:34 UTC
python-setuptools-40.8.0-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-0bf6b7eaf9

Comment 11 Fedora Update System 2019-03-01 12:34:16 UTC
python-setuptools-40.8.0-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2019-80802d12fa

Comment 12 Fedora Update System 2019-03-02 00:24:52 UTC
python-setuptools-40.8.0-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-80802d12fa

Comment 13 Fedora Update System 2019-03-02 00:58:37 UTC
python-setuptools-40.8.0-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-0bf6b7eaf9

Comment 14 Miro Hrončok 2019-03-03 09:59:40 UTC
Can you please verify the update fixes this problem?

Comment 15 Michal Konecny 2019-03-04 09:17:00 UTC
Tested on F29 and it fixed the issue for me.

Comment 16 Michal Konecny 2019-03-04 09:41:16 UTC
Tested on F28 and it works for me.

Comment 17 Fedora Update System 2019-03-11 22:41:24 UTC
python-setuptools-40.8.0-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2019-03-17 07:20:20 UTC
python-setuptools-40.8.0-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.