$ mkdir /tmp/home
$ export HOME=/tmp/home
$ sudo apt install dput python3-pip python3-distro-info
$ pip3 install -U setuptools
$ dput
Traceback (most recent call last):
File "/usr/bin/dput", line 33, in <module>
sys.exit(load_entry_point('dput===1.1.0ubuntu2', 'console_scripts', 'execute-dput')())
File "/usr/bin/dput", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/share/dput/dput/dput.py", line 33, in <module>
from .helper import dputhelper
File "/usr/share/dput/dput/helper/dputhelper.py", line 17, in <module>
import pkg_resources
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3327, in <module>
def _initialize_master_working_set():
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3301, in _call_aside
f(*args, **kwargs)
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3339, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 629, in _build_master
ws.require(__requires__)
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 966, in require
needed = self.resolve(parse_requirements(requirements))
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 827, in resolve
dist = self._resolve_dist(
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 852, in _resolve_dist
if dist is None or (dist not in req and replace_conflicting):
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3204, in __contains__
return self.specifier.contains(item, prereleases=True)
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/specifiers.py", line 902, in contains
item = Version(item)
File "/tmp/home/.local/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/version.py", line 197, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '1.1.0ubuntu2'
$
I still think the better answer is "don't mix pip with your system install". But this is at least a test case that satisfies my constraint from above.
Ok, via LP: #2018519, here is a test case.
$ mkdir /tmp/home exit(load_ entry_point( 'dput== =1.1.0ubuntu2' , 'console_scripts', 'execute-dput')()) load_entry_ point .load() python3. 10/importlib/ metadata/ __init_ _.py", line 171, in load module( match.group( 'module' )) python3. 10/importlib/ __init_ _.py", line 126, in import_module _gcd_import( name[level: ], package, level) _bootstrap> ", line 1050, in _gcd_import _bootstrap> ", line 1027, in _find_and_load _bootstrap> ", line 1006, in _find_and_ load_unlocked _bootstrap> ", line 688, in _load_unlocked _bootstrap_ external> ", line 883, in exec_module _bootstrap> ", line 241, in _call_with_ frames_ removed dput/dput/ dput.py" , line 33, in <module> dput/dput/ helper/ dputhelper. py", line 17, in <module> .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 3327, in <module> master_ working_ set(): .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 3301, in _call_aside .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 3339, in _initialize_ master_ working_ set _build_ master( ) .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 629, in _build_master require( __requires_ _) .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 966, in require parse_requireme nts(requirement s)) .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 827, in resolve .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 852, in _resolve_dist conflicting) : .local/ lib/python3. 10/site- packages/ pkg_resources/ __init_ _.py", line 3204, in __contains__ contains( item, prereleases=True) .local/ lib/python3. 10/site- packages/ pkg_resources/ _vendor/ packaging/ specifiers. py", line 902, in contains .local/ lib/python3. 10/site- packages/ pkg_resources/ _vendor/ packaging/ version. py", line 197, in __init__ f"Invalid version: '{version}'") extern. packaging. version. InvalidVersion: Invalid version: '1.1.0ubuntu2'
$ export HOME=/tmp/home
$ sudo apt install dput python3-pip python3-distro-info
$ pip3 install -U setuptools
$ dput
Traceback (most recent call last):
File "/usr/bin/dput", line 33, in <module>
sys.
File "/usr/bin/dput", line 25, in importlib_
return next(matches)
File "/usr/lib/
module = import_
File "/usr/lib/
return _bootstrap.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "<frozen importlib.
File "/usr/share/
from .helper import dputhelper
File "/usr/share/
import pkg_resources
File "/tmp/home/
def _initialize_
File "/tmp/home/
f(*args, **kwargs)
File "/tmp/home/
working_set = WorkingSet.
File "/tmp/home/
ws.
File "/tmp/home/
needed = self.resolve(
File "/tmp/home/
dist = self._resolve_dist(
File "/tmp/home/
if dist is None or (dist not in req and replace_
File "/tmp/home/
return self.specifier.
File "/tmp/home/
item = Version(item)
File "/tmp/home/
raise InvalidVersion(
pkg_resources.
$
I still think the better answer is "don't mix pip with your system install". But this is at least a test case that satisfies my constraint from above.