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

Editable install using setup.py breaks without legacy feature [BUG] #3499

Closed
vogre opened this issue Aug 11, 2022 · 10 comments · Fixed by #3502
Closed

Editable install using setup.py breaks without legacy feature [BUG] #3499

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

Comments

@vogre
Copy link

vogre commented Aug 11, 2022

setuptools version

63.2.0

Python version

Python 3.10

OS

Ubuntu 22.04 LTS

Additional environment information

No response

Description

Running pip install -e . in a repository with a pyproject.toml present, even if pyproject.toml is only used for tool configuration

[tool.black]
line-length=100

Results in the error

      Editable install will be performed using a meta path finder.

      Options like `package-data`, `include/exclude-package-data` or
      `packages.find.exclude/include` may have no effect.

      Traceback (most recent call last):
        File "/tmp/pip-build-env-fl8nfpvg/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 138, in run
          self._create_wheel_file(bdist_wheel)
        File "/tmp/pip-build-env-fl8nfpvg/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 287, in _create_wheel_file
          strategy(wheel_obj, files, mapping)
        File "/tmp/pip-build-env-fl8nfpvg/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 441, in __call__
          namespaces_: Dict[str, List[str]] = dict(chain(
        File "/tmp/pip-build-env-fl8nfpvg/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 604, in _find_namespaces
          for pkg in packages:
      TypeError: 'NoneType' object is not iterable
      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"

exporting SETUPTOOLS_ENABLE_FEATURES="legacy-editable" does behave as expected, as does removing the pyproject.toml file.

Expected behavior

Expected install to ignore pyproject.toml without any build configuration.

How to Reproduce

No specific steps to reproduce, since a similar package installs successfully with the same setuptools version.

The command failing is
pip install -e .

Output

Building editable for my-package (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building editable for my-package (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      running editable_wheel
      creating /tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info
      writing /tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info/requires.txt
      writing top-level names to /tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info/top_level.txt
      writing manifest file '/tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info/SOURCES.txt'
      file my.py (for module my) not found
      reading manifest file '/tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info/SOURCES.txt'
      writing manifest file '/tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package.egg-info/SOURCES.txt'
      creating '/tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package-0.23.1.dist-info'
      creating /tmp/pip-wheel-6iyrnxzp/tmpi0w89_xq/my_package-0.23.1.dist-info/WHEEL
      /tmp/pip-build-env-m2f24vth/overlay/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      running egg_info
      creating /tmp/tmpyhvg_rsh.build-temp/my_package.egg-info
      writing /tmp/tmpyhvg_rsh.build-temp/my_package.egg-info/PKG-INFO
      writing dependency_links to /tmp/tmpyhvg_rsh.build-temp/my_package.egg-info/dependency_links.txt
      writing requirements to /tmp/tmpyhvg_rsh.build-temp/my_package.egg-info/requires.txt
      writing top-level names to /tmp/tmpyhvg_rsh.build-temp/my_package.egg-info/top_level.txt
      writing manifest file '/tmp/tmpyhvg_rsh.build-temp/my_package.egg-info/SOURCES.txt'
      file my.py (for module my) not found
      reading manifest file '/tmp/tmpyhvg_rsh.build-temp/my_package.egg-info/SOURCES.txt'
      writing manifest file '/tmp/tmpyhvg_rsh.build-temp/my_package.egg-info/SOURCES.txt'
      file my.py (for module my) not found
      file my.py (for module my) not found
      Editable install will be performed using a meta path finder.

      Options like `package-data`, `include/exclude-package-data` or
      `packages.find.exclude/include` may have no effect.

      Traceback (most recent call last):
        File "/tmp/pip-build-env-m2f24vth/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 138, in run
          self._create_wheel_file(bdist_wheel)
        File "/tmp/pip-build-env-m2f24vth/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 287, in _create_wheel_file
          strategy(wheel_obj, files, mapping)
        File "/tmp/pip-build-env-m2f24vth/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 441, in __call__
          namespaces_: Dict[str, List[str]] = dict(chain(
        File "/tmp/pip-build-env-m2f24vth/overlay/lib/python3.10/site-packages/setuptools/command/editable_wheel.py", line 604, in _find_namespaces
          for pkg in packages:
      TypeError: 'NoneType' object is not iterable
      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]
@vogre vogre added bug Needs Triage Issues that need to be evaluated for severity and status. labels Aug 11, 2022
@synchronizing
Copy link

synchronizing commented Aug 11, 2022

Reported in #3498. Same issue in #3500.

@synchronizing
Copy link

synchronizing commented Aug 11, 2022

@vogre Does your package make use of pbr?

@vogre
Copy link
Author

vogre commented Aug 11, 2022

@synchronizing -- no, not using pbr, also version lower than 64.0.0 (so no pakcage_dir in trace)

@abravalheri
Copy link
Contributor

Thank you very much for the report @vogre, I will investigate this issue and get back to you as soon as possible.

I also believe that the issue described here may be similar to #3500. Do you think they are separated problems?

@abravalheri
Copy link
Contributor

Hi @vogre, it seems that somehow, your build is indeed using v64 (the editable install was not present in v63.2.0).

pip has been reported to have a virtual environment leak on Ubuntu and Debian in the past (I believe it was fixed in recent versions). Maybe your machine also has the same leak.

Could you share some form of reproducer (for example, containing a
simplified setup.py/setup.cfg)?

@abravalheri
Copy link
Contributor

In #3502, I think I manage to reproduce this particular error.

@abravalheri
Copy link
Contributor

abravalheri commented Aug 11, 2022

@vogre, please checkout v64.0.1.

If it does not work for you, let me know and I will re-open this issue.

@bipalauthomize
Copy link

@abravalheri
I tried upgrading the setuptools version to setuptools 64.0.1, but pip install -e . still only works if pyproject.toml is removed.

@abravalheri
Copy link
Contributor

Hi @bipalauthomize can you create a new issue and share a small/simplified reproducer there?

Please also have a look on this docs section.

@devops-dmdx
Copy link

devops-dmdx commented Jan 19, 2023

Hi @bipalauthomize, regarding this issue, have you figured out something regarding the sole presence of pyproject.toml, even without build configuration? It might be related to the version of pip you're using. We faced the same situation and noticed that starting from pip>=21.3.1, editable install starts by downloading a setuptools version that matches your requirements stored in the build configuration (none actually) and uses it. So in our case, this issue started to raise when setuptools>=64 was released.

In the build configuration, we put:

[build-system]
requires = ["setuptools>=58,<63"]
build-backend = "setuptools.build_meta"

This ensures we get the legacy editable installation without needing the environment variable tweek.

how to replicate?

Given the project's structure:

.:
total 46
drwxr-xr-x 1 UserName 4096    0 Jan 19 08:10 .
drwxr-xr-x 1 UserName 4096    0 Dec 28 11:31 ..
-rw-r--r-- 1 UserName 4096   89 Jan 19 08:10 pyproject.toml
-rw-r--r-- 1 UserName 4096  227 Jan 18 15:36 requirements.txt
-rw-r--r-- 1 UserName 4096  259 Jan 19 07:52 setup.py
drwxr-xr-x 1 UserName 4096    0 Jan 19 07:55 src
drwxr-xr-x 1 UserName 4096    0 Jan 19 07:48 venv

src:
total 24
drwxr-xr-x 1 UserName 4096 0 Jan 19 07:55 .
drwxr-xr-x 1 UserName 4096 0 Jan 19 08:10 ..
drwxr-xr-x 1 UserName 4096 0 Jan 18 15:31 super_project

src/super_project:
total 16
drwxr-xr-x 1 UserName 4096    0 Jan 18 15:31 .
drwxr-xr-x 1 UserName 4096    0 Jan 19 07:55 ..
-rw-r--r-- 1 UserName 4096  772 Jan 18 15:31 __init__.py
-rw-r--r-- 1 UserName 4096 1302 Jan 18 15:25 __main__.py

The isolated environment is based on virtualenv==20.15.1 and Python 3.8:

pip==22.1.2
setuptools==62.6.0
wheel==0.37.1
py -3.8 -VV
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]

Let's spawn a venv:

py -3.8 -m virtualenv --clear --no-download --no-periodic-update --verbose venv
find interpreter for spec PythonSpec(path=C:\Program Files\Python38\python.exe)
proposed PythonInfo(spec=CPython3.8.10.final.0-64, exe=C:\Program Files\Python38\python.exe, platform=win32, version='3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)]', encoding_fs_io=utf-8-utf-8)
create virtual environment via CPython3Windows(dest=C:\Users\UserName\Projects\playgrounds\super-project\venv, clear=True, no_vcs_ignore=False, global=False)
add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\UserName\AppData\Local\pypa\virtualenv)
add activators for Bash, Batch, Fish, Nushell, PowerShell, Python
created virtual environment CPython3.8.10.final.0-64 in 1082ms
  creator CPython3Windows(dest=C:\Users\UserName\Projects\playgrounds\super-project\venv, clear=True, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\UserName\AppData\Local\pypa\virtualenv)
    added seed packages: pip==22.1.2, setuptools==62.6.0, wheel==0.37.1
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

With solely a setup.py, an empty but existing pyproject.toml and an src-layout package:

from setuptools import setup, find_packages

setup(
    name='super-project',
    version='0.1',
    author='Super Company',
    description='Super Project',
    package_dir={'': 'src'},
    packages=find_packages(where='src'),
    python_requires='>=3.8',
)

We clearly see that pip installs build dependencies and collects setuptools>=40.8.0 and wheel:

venv/Scripts/python -m pip list --verbose
Package    Version Location                                                                         Installer
---------- ------- -------------------------------------------------------------------------------- ---------
pip        22.1.2  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip
setuptools 62.6.0  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip
wheel      0.37.1  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip

venv/Scripts/python -m pip install --verbose -e .
Using pip 22.1.2 from C:\Users\UserName\Projects\playgrounds\super-project\venv\lib\site-packages\pip (python 3.8)
Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
Obtaining file:///C:/Users/UserName/Projects/playgrounds/super-project
  Running command pip subprocess to install build dependencies
  Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
  Collecting setuptools>=40.8.0
    Using cached setuptools-66.0.0-py3-none-any.whl (1.3 MB)
  Collecting wheel
    Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
  Installing collected packages: wheel, setuptools
  Successfully installed setuptools-66.0.0 wheel-0.38.4
  Installing build dependencies ... done
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Getting requirements to build editable
  running egg_info
  writing src\super_project.egg-info\PKG-INFO
  writing dependency_links to src\super_project.egg-info\dependency_links.txt
  writing top-level names to src\super_project.egg-info\top_level.txt
  reading manifest file 'src\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'src\super_project.egg-info\SOURCES.txt'
  Getting requirements to build editable ... done
  Running command Preparing editable metadata (pyproject.toml)
  running dist_info
  creating C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project.egg-info
  writing C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project.egg-info\PKG-INFO
  writing dependency_links to C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project.egg-info\dependency_links.txt
  writing top-level names to C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project.egg-info\top_level.txt
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project.egg-info\SOURCES.txt'
  creating 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-wlb2wp3z\super_project-0.1.dist-info'
  Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: super-project
  Running command Building editable for super-project (pyproject.toml)
  running editable_wheel
  creating C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project.egg-info
  writing C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project.egg-info\PKG-INFO
  writing dependency_links to C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project.egg-info\dependency_links.txt
  writing top-level names to C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project.egg-info\top_level.txt
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project.egg-info\SOURCES.txt'
  creating 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project-0.1.dist-info'
  creating C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project-0.1.dist-info\WHEEL
  running build_py

          Editable install will be performed using .pth file to extend `sys.path` with:
          ['src']

  Options like `package-data`, `include/exclude-package-data` or
  `packages.find.exclude/include` may have no effect.

  adding '__editable__.super_project-0.1.pth'
  creating 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-9z9fi6cc\.tmp-mgh2jhem\super_project-0.1-0.editable-py3-none-any.whl' and adding 'C:\Users\US~1\AppData\Local\Temp\tmpdkyq_kclsuper_project-0.1-0.editable-py3-none-any.whl' to it
  adding 'super_project-0.1.dist-info/METADATA'
  adding 'super_project-0.1.dist-info/WHEEL'
  adding 'super_project-0.1.dist-info/top_level.txt'
  adding 'super_project-0.1.dist-info/RECORD'
  Building editable for super-project (pyproject.toml) ... done
  Created wheel for super-project: filename=super_project-0.1-0.editable-py3-none-any.whl size=1300 sha256=0890f9abafd171e9379d0efdf337a92668f223edcd10ef6ba5ff4a30c0aff0b6
  Stored in directory: C:\Users\UserName\AppData\Local\Temp\pip-ephem-wheel-cache-u9a7u08a\wheels\c9\f0\73\eaff4fdd06aa04be14615bd2be80763dca1cd88f5e78110aab
Successfully built super-project
Installing collected packages: super-project
Successfully installed super-project-0.1

Let's uninstall it:

venv/Scripts/python -m pip uninstall super-project
Found existing installation: super-project 0.1
Uninstalling super-project-0.1:
  Would remove:
    c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages\__editable__.super_project-0.1.pth
    c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages\super_project-0.1.dist-info\*
Proceed (Y/n)? Y
  Successfully uninstalled super-project-0.1

Now, we add a very basic build configuration:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

And we re-do the installation:

venv/Scripts/python -m pip list --verbose
Package    Version Location                                                                         Installer
---------- ------- -------------------------------------------------------------------------------- ---------
pip        22.1.2  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip
setuptools 62.6.0  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip
wheel      0.37.1  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip

venv/Scripts/python -m pip install --verbose -e .
Using pip 22.1.2 from C:\Users\UserName\Projects\playgrounds\super-project\venv\lib\site-packages\pip (python 3.8)
Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
Obtaining file:///C:/Users/UserName/Projects/playgrounds/super-project
  Running command pip subprocess to install build dependencies
  Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
  Collecting setuptools
    Using cached setuptools-66.0.0-py3-none-any.whl (1.3 MB)
  Installing collected packages: setuptools
  Successfully installed setuptools-66.0.0
  Installing build dependencies ... done
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Getting requirements to build editable
  running egg_info
  writing src\super_project.egg-info\PKG-INFO
  writing dependency_links to src\super_project.egg-info\dependency_links.txt
  writing top-level names to src\super_project.egg-info\top_level.txt
  reading manifest file 'src\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'src\super_project.egg-info\SOURCES.txt'
  Getting requirements to build editable ... done
  Running command pip subprocess to install backend dependencies
  Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
  Collecting wheel
    Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
  Installing collected packages: wheel
  Successfully installed wheel-0.38.4
  Installing backend dependencies ... done
  Running command Preparing editable metadata (pyproject.toml)
  running dist_info
  creating C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project.egg-info
  writing C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project.egg-info\PKG-INFO
  writing dependency_links to C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project.egg-info\dependency_links.txt
  writing top-level names to C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project.egg-info\top_level.txt
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project.egg-info\SOURCES.txt'
  creating 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-_li29tuq\super_project-0.1.dist-info'
  Preparing editable metadata (pyproject.toml) ... done
Building wheels for collected packages: super-project
  Running command Building editable for super-project (pyproject.toml)
  running editable_wheel
  creating C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project.egg-info
  writing C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project.egg-info\PKG-INFO
  writing dependency_links to C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project.egg-info\dependency_links.txt
  writing top-level names to C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project.egg-info\top_level.txt
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project.egg-info\SOURCES.txt'
  creating 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project-0.1.dist-info'
  creating C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project-0.1.dist-info\WHEEL
  running build_py

          Editable install will be performed using .pth file to extend `sys.path` with:
          ['src']

  Options like `package-data`, `include/exclude-package-data` or
  `packages.find.exclude/include` may have no effect.

  adding '__editable__.super_project-0.1.pth'
  creating 'C:\Users\UserName\AppData\Local\Temp\pip-wheel-m1uus3o1\.tmp-eklyw5hh\super_project-0.1-0.editable-py3-none-any.whl' and adding 'C:\Users\US~1\AppData\Local\Temp\tmpsvhh647gsuper_project-0.1-0.editable-py3-none-any.whl' to it
  adding 'super_project-0.1.dist-info/METADATA'
  adding 'super_project-0.1.dist-info/WHEEL'
  adding 'super_project-0.1.dist-info/top_level.txt'
  adding 'super_project-0.1.dist-info/RECORD'
  Building editable for super-project (pyproject.toml) ... done
  Created wheel for super-project: filename=super_project-0.1-0.editable-py3-none-any.whl size=1300 sha256=68dc8029df3d74d75e1056b49ef0c315ebb8f2950200abdb1ee25dd8ffedc7ac
  Stored in directory: C:\Users\UserName\AppData\Local\Temp\pip-ephem-wheel-cache-lgmeysey\wheels\c9\f0\73\eaff4fdd06aa04be14615bd2be80763dca1cd88f5e78110aab
Successfully built super-project
Installing collected packages: super-project
Successfully installed super-project-0.1

Again, let's uninstall it:

venv/Scripts/python -m pip uninstall super-project
Found existing installation: super-project 0.1
Uninstalling super-project-0.1:
  Would remove:
    c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages\__editable__.super_project-0.1.pth
    c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages\super_project-0.1.dist-info\*
Proceed (Y/n)? Y
  Successfully uninstalled super-project-0.1

And now restrict setuptools' version:

[build-system]
requires = ["setuptools>=58,<63"]
build-backend = "setuptools.build_meta"

Here our legacy-editable install happens with setup.py develop:

venv/Scripts/python -m pip list --verbose
Package    Version Location                                                                         Installer
---------- ------- -------------------------------------------------------------------------------- ---------
pip        22.1.2  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip
setuptools 62.6.0  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip
wheel      0.37.1  c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages pip

venv/Scripts/python -m pip install --verbose -e .
Using pip 22.1.2 from C:\Users\UserName\Projects\playgrounds\super-project\venv\lib\site-packages\pip (python 3.8)
Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
Obtaining file:///C:/Users/UserName/Projects/playgrounds/super-project
  Running command pip subprocess to install build dependencies
  Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
  Collecting setuptools<63,>=58
    Using cached setuptools-62.6.0-py3-none-any.whl (1.2 MB)
  Installing collected packages: setuptools
  Successfully installed setuptools-62.6.0
  Installing build dependencies ... done
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Getting requirements to build wheel
  running egg_info
  writing src\super_project.egg-info\PKG-INFO
  writing dependency_links to src\super_project.egg-info\dependency_links.txt
  writing top-level names to src\super_project.egg-info\top_level.txt
  reading manifest file 'src\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'src\super_project.egg-info\SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command pip subprocess to install backend dependencies
  Looking in indexes: https://gitlab.com/api/v4/groups/diamidex/-/packages/pypi/simple
  Collecting wheel
    Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
  Installing collected packages: wheel
  Successfully installed wheel-0.38.4
  Installing backend dependencies ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project.egg-info
  writing C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project.egg-info\PKG-INFO
  writing dependency_links to C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project.egg-info\dependency_links.txt
  writing top-level names to C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project.egg-info\top_level.txt
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project.egg-info\SOURCES.txt'
  creating 'C:\Users\UserName\AppData\Local\Temp\pip-modern-metadata-psbfe3bh\super_project-0.1.dist-info'
  Preparing metadata (pyproject.toml) ... done
Installing collected packages: super-project
  Running setup.py develop for super-project
    Running command python setup.py develop
    running develop
    running egg_info
    writing src\super_project.egg-info\PKG-INFO
    writing dependency_links to src\super_project.egg-info\dependency_links.txt
    writing top-level names to src\super_project.egg-info\top_level.txt
    reading manifest file 'src\super_project.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'src\super_project.egg-info\SOURCES.txt'
    running build_ext
    Creating c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages\super-project.egg-link (link to src)
    Adding super-project 0.1 to easy-install.pth file

    Installed c:\users\username\projects\playgrounds\super-project\src
    C:\Users\UserName\AppData\Local\Temp\pip-build-env-2j0febx5\overlay\Lib\site-packages\setuptools\command\easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings. Warn(
    C:\Users\UserName\AppData\Local\Temp\pip-build-env-2j0febx5\overlay\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
Successfully installed super-project-0.1

When it gets uninstalled, files removed are a bit different:

venv/Scripts/python -m pip uninstall super-project
Found existing installation: super-project 0.1
Uninstalling super-project-0.1:
  Would remove:
    c:\users\username\projects\playgrounds\super-project\venv\lib\site-packages\super-project.egg-link
Proceed (Y/n)? Y
  Successfully uninstalled super-project-0.1

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.

5 participants