← Back to issue list

python plugin fails on hashes in requirements.txt

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1748324
Type
issue
State
open
Author
~ipmb
Labels
Created
Updated
Closed

Current evaluation

Python plugin (snapcraft 2.35) fails when requirements.txt contains --hash entries, as pip's --require-hashes mode rejects the file:// directory requirement. Old plugin architecture removed; issue is 8.5 years old with no maintainer activity.

Suggested action: close stale

Reason: The traceback references snapcraft 2.35 and snapcraft/plugins/python.py, but the current repo layout shows no plugins/ directory — the old plugin system was replaced by the parts-based architecture under snapcraft/parts/. The issue is 3126 days old with zero comments, no labels, and no maintainer interaction, and the affected code path no longer exists.

Impact: 15 Quick Win: 9.0 Staleness: 95 Complexity: 40 Confidence: 70 Support Request: 25

Issue body

A Python requirements.txt file with hashes fails with the following error: ``` Can't verify hashes for these file:// requirements because they point to directories: file:///code/parts/web/src In --require-hashes mode, all requirements must have their versions pinned with ==. These do not: setuptools from https://pypi.python.org/packages/43/41/033a273f9a25cb63050a390ee8397acbc7eae2159195d85f06f17e7be45a/setuptools-38.5.1-py2.py3-none-any.whl#md5=908b8b5e50bf429e520b2b5fa1b350e5 (from python-json-logger==0.1.8->-r /code/parts/web/src/requirements.txt (line 10)) Traceback (most recent call last): File "/usr/bin/snapcraft", line 9, in <module> load_entry_point('snapcraft==2.35', 'console_scripts', 'snapcraft')() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 542, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2569, in load_entry_point return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2229, in load return self.resolve() File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2235, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/lib/python3/dist-packages/snapcraft/cli/__main__.py", line 19, in <module> run(prog_name='snapcraft') File "/usr/lib/python3/dist-packages/click/core.py", line 716, in __call__ return self.main(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 696, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1037, in invoke return Command.invoke(self, ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 889, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/__init__.py", line 124, in run ctx.forward(lifecyclecli.commands['snap']) File "/usr/lib/python3/dist-packages/click/core.py", line 552, in forward return self.invoke(cmd, **kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 534, in invoke return callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 140, in snap project_options, directory=directory, output=output) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_packer.py", line 45, in snap execute('prime', project_options) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 80, in execute _Executor(config, project_options).run(step, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 175, in run self._run_step(step, part, part_names) File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 212, in _run_step getattr(part, step)() File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/__init__.py", line 252, in pull self.plugin.pull() File "/usr/lib/python3/dist-packages/snapcraft/plugins/python.py", line 180, in pull self._run_pip(setup, download=True) File "/usr/lib/python3/dist-packages/snapcraft/plugins/python.py", line 321, in _run_pip pip.download(**command) File "/usr/lib/python3/dist-packages/snapcraft/plugins/python.py", line 511, in download self._exec_func(cmd, env=self._env, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/_baseplugin.py", line 202, in run return common.run(cmd, cwd=cwd, **kwargs) File "/usr/lib/python3/dist-packages/snapcraft/internal/common.py", line 63, in run subprocess.check_call(['/bin/sh', f.name] + cmd, **kwargs) File "/usr/lib/python3.5/subprocess.py", line 581, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/bin/sh', '/tmp/tmpl3ev6bh3', '/code/parts/web/install/usr/bin/python3', '-m', 'pip', 'download', '--disable-pip-version-check', '--dest', '/code/parts/web/packages', '--requirement', '/code/parts/web/src/requirements.txt', '.']' returned non-zero exit status 1 ``` --- Example requirements.txt ``` python-json-logger==0.1.8 --hash=sha256:30999d1d742ecf6645991a2ce9273188505e98b713ad63be06aabff47dd1b3c4 --hash=sha256:8205cfe7061715de5cd1b37e3565d5b97d0ac13b30ff3ee612554abb6093d640 ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 15
Quick Win: 9.0
Staleness: 95
Complexity: 40
Confidence: 70
Support Request: 25
close stale Python plugin (snapcraft 2.35) fails when requirements.txt contains --hash entries, as pip's --require-hashes mode rejects the file:// directory requirement. Old plugin architecture removed; issue is 8.5 years old with no maintainer activity.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 40
Confidence: 92
Support Request: 5
close stale Snapcraft Python plugin fails when requirements.txt uses pip --require-hashes. Reported 8+ years ago with zero maintainer interaction. The affected Snapcraft version and plugin are obsolete.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 90
Support Request: 10
close stale Snapcraft's Python plugin fails when requirements.txt uses pip's --require-hashes feature. Unlabelled, no maintainer comments, and over 8 years old.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 45
Confidence: 90
Support Request: 15
close stale Snapcraft's Python plugin fails when processing requirements.txt files containing pip hashes. Reported 8+ years ago with no maintainer response or updates.
qwen3.6-35b-moe-q4
Staleness: 98
Complexity: 25
Confidence: 90
Support Request: 10
close stale Snapcraft Python plugin fails when requirements.txt uses pip hash flags. Issue is 8+ years old, has no comments or labels, and references snapcraft 2.35.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.