← Back to issue list

Warn when python plugin is used for non-setuptools project

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1804682
Type
issue
State
open
Author
~merlijn-sebrechts
Labels
—
Created
Updated
Closed
—

Current evaluation

Requests a clear diagnostic for bare or unsupported Python projects; the reported single-script case fails late with FileNotFoundError, but current behavior needs triage.

Suggested action: needs triage

Reason: The body provides a historical single-script reproducer and a late FileNotFoundError, while the current unit test confirms that installation occurs only when setup.py or pyproject.toml exists. No labels, comments, maintainer assessment, or resolving change are present, and the report must be revalidated against the current craft-parts-backed implementation.

Evaluated by: mr-cal-bot

Impact: 38 Quick Win: 15 Complexity: 42 Confidence: 86 Actionability: 66

Issue body

The Python plugin doesn't seem to work for non-setuptools projects, but it isn't clear why it is failing if that's the case. I encountered this issue and it seems I'm not the only one: https://forum.snapcraft.io/t/building-a-python-snap-package/6766 snapcraft should detect cases where this plugin is used on non-setuptools projects and give a clear warning or error message that explains it's being misused. This is the warning I receive when I try to create a snap package of a single python script file using the `python` plugin: Priming testapp 'grade' property not specified: defaulting to 'stable' Sorry, an error occurred in Snapcraft: Traceback (most recent call last): File "/snap/snapcraft/1871/bin/snapcraft", line 11, in <module> load_entry_point('snapcraft==2.43.1', 'console_scripts', 'snapcraft')() File "/snap/snapcraft/1871/lib/python3.5/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/snap/snapcraft/1871/lib/python3.5/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/snap/snapcraft/1871/lib/python3.5/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/snap/snapcraft/1871/lib/python3.5/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/snap/snapcraft/1871/lib/python3.5/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 136, in snap project = _execute(steps.PRIME, parts=[], **kwargs) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 35, in _execute lifecycle.execute(step, project_config, parts) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute executor.run(step, part_names) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 196, in run self._create_meta(step, processed_part_names) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 359, in _create_meta self.config.validator.schema, File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 109, in create_snap_packaging packaging.write_snap_yaml() File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 312, in write_snap_yaml snap_yaml = self._compose_snap_yaml() File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 468, in _compose_snap_yaml snap_yaml["apps"] = self._wrap_apps(self._config_data["apps"]) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 567, in _wrap_apps self._wrap_app(app, apps[app]) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 575, in _wrap_app app[k] = self._wrap_exe(app[k], "{}-{}".format(k, name)) File "/snap/snapcraft/1871/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 546, in _wrap_exe with open(exepath, "rb") as exefile: FileNotFoundError: [Errno 2] No such file or directory: '/root/build_testapp/prime/./testapp' We would appreciate it if you created a bug report at

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 38
Quick Win: 15
Complexity: 42
Confidence: 86
Actionability: 66
needs triage Requests a clear diagnostic for bare or unsupported Python projects; the reported single-script case fails late with FileNotFoundError, but current behavior needs triage.
stealth/space-bunny-alpha
Impact: 32
Quick Win: 13
Complexity: 45
Confidence: 84
Actionability: 72
needs triage Single-file projects using the Python plugin fail with an unclear FileNotFoundError; the report has no maintainer triage, labels, comments, or identified resolution.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 20
Complexity: 30
Confidence: 60
Actionability: 70
needs triage Python plugin lacks validation for non-setuptools projects, causing unclear FileNotFoundError. Issue open with no maintainer response or labels after 2863 days.
qwen/qwen3.8-27b
Impact: 5
Quick Win: 4
Staleness: 95
Complexity: 30
Confidence: 75
Support Request: 20
close stale Request to add a clear warning/error when snapcraft's python plugin is used on non-setuptools projects. References snapcraft 2.43.1; the old plugin architecture has been fully replaced in modern snapcraft.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 90
Support Request: 10
close stale Feature request to add validation and clear error messages when the Snapcraft Python plugin is used with non-setuptools projects. Issue is over 7 years old with no activity.
qwen/qwen3.6-35b-a3b
Staleness: 100
Complexity: 20
Confidence: 95
Support Request: 10
close stale Feature request to add validation and clear error messages when the Python plugin is used for non-setuptools projects. Issue is extremely old (7+ years) with no activity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 25
Confidence: 85
Support Request: 15
close stale Request to add validation and clear error messages when the Snapcraft Python plugin is used with non-setuptools projects. Issue is 7.5 years old with no maintainer interaction or labels.

Update history

Date Change
created

Related work

  • Related To: snapcraft#4044 (confidence 90%)

    Added Snapcraft's current Python plugin wrapper, whose behavior is now largely provided by craft-parts.

Related issues

No related issues found above the similarity threshold.