Bug#1003252: AttributeError: install_layout

2022-03-31 Thread devel
Hello,

thank you for fixing this issue for Python 3.10!

Do you think, that this issue is relevant enough for being fixed in Bullseye?
(as hinted by the bug submitter)

Thank you for your time!

Cheers,
Lars



Bug#1003252: AttributeError: install_layout

2022-03-20 Thread Stefano Rivera
Control: reassign -1 python3.10
Control: fixed -1 python3.10/3.10.2-6
Control: found -1 python3.10/3.10.2-3
Control: close -1

This is resolved by the addition of _distutils_system_mod in Python
3.10.

python3.9 hasn't been fixed yet, but it'll be replaced by 3.10, soon.

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272



Bug#1003252: AttributeError: install_layout

2022-01-06 Thread Tomas Janousek
Package: python3-setuptools
Version: 58.2.0-1
Severity: normal
X-Debbugs-CC: debian-pyt...@lists.debian.org

Since setuptools 60+ is out with SETUPTOOLS_USE_DISTUTILS defaulting to 
"local", pip install --editable in --system-site-packages venvs fails:

$ docker run --rm -it debian:sid
# apt update
# apt install git python3-setuptools python3-pip python3-venv
# cd /tmp
# git clone https://github.com/platformdirs/platformdirs
# cd platformdirs
# python3 -m venv --system-site-packages --without-pip .venv
# .venv/bin/python -m pip install -e .
Obtaining file:///tmp/platformdirs
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Installing collected packages: platformdirs
  Running setup.py develop for platformdirs
ERROR: Command errored out with exit status 1:
 command: /tmp/platformdirs/.venv/bin/python -c 'import sys, 
setuptools, tokenize; sys.argv[0] = '"'"'/tmp/platformdirs/setup.py'"'"'; 
__file__='"'"'/tmp/platformdirs/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
 cwd: /tmp/platformdirs/
Complete output (30 lines):
running develop
Traceback (most recent call last):
  File "", line 1, in 
  File "/tmp/platformdirs/setup.py", line 5, in 
setup()
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 
153, in setup
return distutils.core.setup(**attrs)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", 
line 148, in setup
dist.run_commands()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", 
line 967, in run_commands
self.run_command(cmd)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", 
line 985, in run_command
cmd_obj.ensure_finalized()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", 
line 107, in ensure_finalized
self.finalize_options()
  File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", 
line 52, in finalize_options
easy_install.finalize_options(self)
  File 
"/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 293, 
in finalize_options
self.set_undefined_options(
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", 
line 287, in set_undefined_options
src_cmd_obj.ensure_finalized()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", 
line 107, in ensure_finalized
self.finalize_options()
  File 
"/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 17, in 
finalize_options

self.set_undefined_options('install',('install_layout','install_layout'))
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", 
line 290, in set_undefined_options
setattr(self, dst_option, getattr(src_cmd_obj, src_option))
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", 
line 103, in __getattr__
raise AttributeError(attr)
AttributeError: install_layout

ERROR: Command errored out with exit status 1: 
/tmp/platformdirs/.venv/bin/python -c 'import sys, setuptools, tokenize; 
sys.argv[0] = '"'"'/tmp/platformdirs/setup.py'"'"'; 
__file__='"'"'/tmp/platformdirs/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 Check the logs for full command output.

This happens even though setuptools 60 isn't in Debian yet, because pip 
downloads latest setuptools for pep517 installs that require setuptools 
in the build-system section of pyproject.yaml, but then fails to 
actually use that version fully (this is a bug in pip: 
https://github.com/pypa/pip/issues/6264).

I'll explain what's going on in detail further down, but first I'll 
present a simpler reproducer that illustrates why this might be a bug in 
Debian's setuptools packaging as well:

$ docker run --rm -it debian:sid
# apt update
# apt install git python3-setuptools python3-pip
# cd /tmp
# git clone https://github.com/platformdirs/platformdirs
# cd platformdirs
# SETUPTOOLS_USE_DISTUTILS=local python3 setup.py install
running install
Traceback (most recent call last):
  …
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 
103, in __getattr__
raise AttributeError(attr)
AttributeError: install_layout

Here we are explicitly using Debian's setuptools package, just telling it 
to use the embed