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

[BUG] AttributeError: pakcage_dir typo breaks editable installs #3498

Closed
agroszer opened this issue Aug 11, 2022 · 10 comments · Fixed by #3497
Closed

[BUG] AttributeError: pakcage_dir typo breaks editable installs #3498

agroszer opened this issue Aug 11, 2022 · 10 comments · Fixed by #3497
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@agroszer
Copy link

agroszer commented Aug 11, 2022

setuptools version

64.0.0

Python version

3.9

OS

ubuntu

Additional environment information

7ae5a69 introduced the typo

Description

Doing the obvious
bin/pip install --upgrade -r "data/versions/requirements.txt"

where requirements.txt has:
-e .

Expected behavior

.

How to Reproduce

.

Output

 Traceback (most recent call last):
        File "/tmp/pip-build-env-msencw5_/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 138, in run
          self._create_wheel_file(bdist_wheel)
        File "/tmp/pip-build-env-msencw5_/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 283, in _create_wheel_file
          self._install_namespaces(unpacked, dist_info.name)
        File "/tmp/pip-build-env-msencw5_/overlay/lib/python3.9/site-packages/setuptools/command/editable_wheel.py", line 171, in _install_namespaces
          src_root = Path(self.project_dir, self.pakcage_dir.get("", ".")).resolve()
        File "/tmp/pip-build-env-msencw5_/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 105, in __getattr__
          raise AttributeError(attr)
      AttributeError: pakcage_dir
@agroszer agroszer added bug Needs Triage Issues that need to be evaluated for severity and status. labels Aug 11, 2022
@abravalheri
Copy link
Contributor

Thank you very much for reporting this @agroszer.

@synchronizing
Copy link

synchronizing commented Aug 11, 2022

Unsure if related, but since this morning all of our packages have began breaking with the following:

distutils.errors.DistutilsSetupError: Error: setup script specifies an absolute path:
      
          /var/folders/r7/ggtlz3qs465bzrr2zjtf1h380000gp/T/tmpforaj_f1.build-temp/signals.egg-info/SOURCES.txt
      
      setup() arguments must *always* be /-separated paths relative to the
      setup.py directory, *never* absolute paths.
      
      error: Support for editable installs via PEP 660 was recently introduced
      in `setuptools`. If you are seeing this error, please report to:
      
      https://github.com/pypa/setuptools/issues
      
      Meanwhile you can try the legacy behavior by setting an
      environment variable and trying to install again:
      
      SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
      [end of output]

Setting SETUPTOOLS_ENABLE_FEATURES="legacy-editable" fixes the issue as suggested, but what happened that suddenly things are breaking? Latest release 1 hour ago seems to be the culprit.

@abravalheri
Copy link
Contributor

abravalheri commented Aug 11, 2022

Hi @synchronizing, thank you for reporting that. It is probably a different problem, could you open a new issue with a reproducer?

Meanwhile we investigate/fix the problem you can try using SETUPTOOLS_ENABLE_FEATURES="legacy-editable" or relying on a non-editable installation.

@synchronizing
Copy link

synchronizing commented Aug 11, 2022

Both the env, and non-editable installations work. The issue started this morning, however, and was not present pre-64.0.0. This did cause a few of our deployments to break suddenly, so the reason I'm here now. Will open new issue, thank you.

@leonixyz
Copy link
Contributor

In my case, it was indeed an editable dep breaking my testing environment that led me to find the typo in #3497

@abravalheri
Copy link
Contributor

Sorry for the inconvenient @leonixyz.
The tests for original behaviour in the develop command were scarce because of the deprecation, so the particular code path ended up untested (it does not help that we have some issues with the coverage report).

Thank you for providing the fix. If that is OK with you, I was planning to wait and see if we can also investigate and fix the second problem reported by @synchronizing quickly before cutting a bug fix release. If the second issue is difficult to solve, I will split them in separated releases.

@synchronizing
Copy link

synchronizing commented Aug 11, 2022

@abravalheri Opened issue #3500. Similar issue opened in #3499, #3501.

mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Aug 11, 2022
The recently released setuptools 64.0.0 release introduced a regression
that prevents editable installs from working (see pypa/setuptools#3498).
This is blocking CI as we use editable installs to build and install
terra for testing. When there is an upstream release fixing this issue
we can remove the pins.
@agroszer
Copy link
Author

@abravalheri looks like a bunch of other issues arose.... please merge and release

@abravalheri
Copy link
Contributor

@agroszer, sorry for the delay. Due to the time the CI takes to run, it is good to group all the fixes together.

Please let me know v64.0.1 solves your problem. I can re-open the ticket if necessary.

Cryoris pushed a commit to Qiskit/qiskit that referenced this issue Aug 12, 2022
* Pin setuptools in CI

The recently released setuptools 64.0.0 release introduced a regression
that prevents editable installs from working (see pypa/setuptools#3498).
This is blocking CI as we use editable installs to build and install
terra for testing. When there is an upstream release fixing this issue
we can remove the pins.

* Remove pip/setuptools/wheel manual install step

* Try venv instead of virtualenv

* Revert "Try venv instead of virtualenv"

This reverts commit 3ada819.

* Revert "Remove pip/setuptools/wheel manual install step"

This reverts commit 831bc6e.

* Pin in constraints.txt too

* Lower version further

* Pin setuptools-rust too

* Set editable install to legacy mode via env var

* Set env variable correctly everywhere we build terra

* Add missing env variable setting for image tests
@agroszer
Copy link
Author

thanks that fixes it

mergify bot pushed a commit to Qiskit/qiskit that referenced this issue Aug 16, 2022
* Pin setuptools in CI

The recently released setuptools 64.0.0 release introduced a regression
that prevents editable installs from working (see pypa/setuptools#3498).
This is blocking CI as we use editable installs to build and install
terra for testing. When there is an upstream release fixing this issue
we can remove the pins.

* Remove pip/setuptools/wheel manual install step

* Try venv instead of virtualenv

* Revert "Try venv instead of virtualenv"

This reverts commit 3ada819.

* Revert "Remove pip/setuptools/wheel manual install step"

This reverts commit 831bc6e.

* Pin in constraints.txt too

* Lower version further

* Pin setuptools-rust too

* Set editable install to legacy mode via env var

* Set env variable correctly everywhere we build terra

* Add missing env variable setting for image tests

(cherry picked from commit 82e38d1)
mergify bot added a commit to Qiskit/qiskit that referenced this issue Aug 16, 2022
* Pin setuptools in CI

The recently released setuptools 64.0.0 release introduced a regression
that prevents editable installs from working (see pypa/setuptools#3498).
This is blocking CI as we use editable installs to build and install
terra for testing. When there is an upstream release fixing this issue
we can remove the pins.

* Remove pip/setuptools/wheel manual install step

* Try venv instead of virtualenv

* Revert "Try venv instead of virtualenv"

This reverts commit 3ada819.

* Revert "Remove pip/setuptools/wheel manual install step"

This reverts commit 831bc6e.

* Pin in constraints.txt too

* Lower version further

* Pin setuptools-rust too

* Set editable install to legacy mode via env var

* Set env variable correctly everywhere we build terra

* Add missing env variable setting for image tests

(cherry picked from commit 82e38d1)

Co-authored-by: Matthew Treinish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants