Skip to content

context.py: illegal import of deb822#73

Open
xypron wants to merge 1 commit intomwhudson:mainfrom
xypron:deb822
Open

context.py: illegal import of deb822#73
xypron wants to merge 1 commit intomwhudson:mainfrom
xypron:deb822

Conversation

@xypron
Copy link
Contributor

@xypron xypron commented Apr 1, 2025

Pylint shows these coding errors:

  livefs_edit/context.py:235:8:
    E0401: Unable to import 'deb822' (import-error)
    C0415: Import outside toplevel (deb822.Deb822)
           (import-outside-toplevel)

'deb822' can be imported from 'debian'.

Fixes: 4d5ff31 ("rewrite get_suite in an excessively fancy way")

Pylint shows these coding errors:

  livefs_edit/context.py:235:8:
    E0401: Unable to import 'deb822' (import-error)
    C0415: Import outside toplevel (deb822.Deb822)
           (import-outside-toplevel)

'deb822' can be imported from 'debian'.

Fixes: 4d5ff31 ("rewrite get_suite in an excessively fancy way")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
@mwhudson
Copy link
Owner

mwhudson commented Apr 3, 2025

The reason for doing it this way was to avoid python3-debian being a requirement for uses that did not need it. I don't know how relevant that is really -- but maybe you could add a try: / except ImportError: around the top level import?

@xypron
Copy link
Contributor Author

xypron commented Apr 3, 2025

The dependency is clearly stated in README.md.
The package python3-debian is available in Focal and all later releases.
Adding a try block would not stop the code from failing when entering get-suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants