FS#74833 - [python-setuptools] Editable mode broken since bump from 60.5.0 to 60.6.0

Attached to Project: Arch Linux
Opened by ux (ubitux) - Monday, 23 May 2022, 12:24 GMT
Last edited by Antonio Rojas (arojas) - Sunday, 19 June 2022, 13:57 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
Installing a package with pip install -e <module> fails with:

Defaulting to user installation because normal site-packages is not writeable
Obtaining file:///home/ux/sandbox/python/simplemodule
Installing collected packages: simplemodule
Running setup.py develop for simplemodule
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/ux/sandbox/python/simplemodule/setup.py'"'"'; __file__='"'"'/home/ux/sandbox/python/simplemodule/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /home/ux/sandbox/python/simplemodule/
Complete output (28 lines):
running develop
/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:157: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ux/sandbox/python/simplemodule/setup.py", line 3, in <module>
setup(
File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 155, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 985, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/usr/lib/python3.10/site-packages/setuptools/command/develop.py", line 52, in finalize_options
easy_install.finalize_options(self)
File "/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 276, in finalize_options
self._fix_install_dir_for_user_site()
File "/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 382, in _fix_install_dir_for_user_site
self.create_home_path()
File "/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py", line 1338, in create_home_path
if path.startswith(home) and not os.path.isdir(path):
AttributeError: 'int' object has no attribute 'startswith'
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/ux/sandbox/python/simplemodule/setup.py'"'"'; __file__='"'"'/home/ux/sandbox/python/simplemodule/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.


Steps to reproduce:

% cd /tmp
% mkdir -p simplemodule/simplemodule
% touch simplemodule/simplemodule/__init__.py
% cat <<EOF > simplemodule/simplemodule/cli.py
def main():
print("I am a simple Python module")
EOF
% cat <<EOF > simplemodule/setup.py
from setuptools import setup

setup(
name="simplemodule",
version="0.1",
description="A simple module",
packages=["simplemodule"],
entry_points={
"console_scripts": [
"simplemodule-cli=simplemodule.cli:main",
],
},
)
EOF
% pip install --user --editable simplemodule
This task depends upon

Closed by  Antonio Rojas (arojas)
Sunday, 19 June 2022, 13:57 GMT
Reason for closing:  Fixed
Comment by loqs (loqs) - Tuesday, 24 May 2022, 01:22 GMT
https://github.com/pypa/setuptools/issues/3063 ? If it is that issue was fixed in 60.7.0
Comment by Chih-Hsuan Yen (yan12125) - Thursday, 09 June 2022, 11:58 GMT
testing/python-setuptools is upgraded to 60.8.0 and the issue is gone for me.

Loading...