Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
172
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
55742394
Commit
55742394
authored
1 year ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
Factor out generating a human-readable comment when missing a Python module.
parent
7998aa03
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
diffoscope/comparators/fsimage.py
+2
-6
2 additions, 6 deletions
diffoscope/comparators/fsimage.py
diffoscope/tools.py
+7
-0
7 additions, 0 deletions
diffoscope/tools.py
with
9 additions
and
6 deletions
diffoscope/comparators/fsimage.py
+
2
−
6
View file @
55742394
...
...
@@ -24,7 +24,7 @@ import os.path
from
diffoscope.difference
import
Difference
from
diffoscope.tools
import
python_module_missing
from
diffoscope.profiling
import
profile
from
diffoscope.tools
import
get_
package_provider
from
diffoscope.tools
import
get_
comment_for_missing_python_module
from
.utils.file
import
File
from
.utils.archive
import
Archive
...
...
@@ -129,9 +129,5 @@ class FsImageFile(File):
)
)
if
not
guestfs
:
pkg
=
get_package_provider
(
"
guestfs
"
)
infix
=
f
"
from the
'
{
pkg
}
'
package
"
if
pkg
else
"
"
self
.
add_comment
(
f
"
Installing the
'
guestfs
'
Python module
{
infix
}
may produce a better output.
"
)
self
.
add_comment
(
get_comment_for_missing_python_module
(
"
guestfs
"
))
return
differences
This diff is collapsed.
Click to expand it.
diffoscope/tools.py
+
7
−
0
View file @
55742394
...
...
@@ -191,4 +191,11 @@ def python_module_missing(name):
python_module_missing
.
modules
.
add
(
name
)
def
get_comment_for_missing_python_module
(
name
):
pkg
=
get_package_provider
(
name
)
infix
=
f
"
from the
'
{
pkg
}
'
package
"
if
pkg
else
"
"
return
f
"
Installing the
'
{
name
}
'
Python module
{
infix
}
may produce a better output.
"
python_module_missing
.
modules
=
set
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment