Overview
Comment:argument pylint change
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5c58c55164ed94fc8142990e770cef5bdd4b2b79165fe28a50596c39d7bec5ef
User & Date: mario on 2022-10-28 07:07:24
Other Links: manifest | tags
Context
2022-10-28
07:08
fix residual theme= in kwargs check-in: 0ea503177a user: mario tags: trunk
07:07
argument pylint change check-in: 5c58c55164 user: mario tags: trunk
07:06
ad PluginMeta dict wrapper for briefer property access check-in: 9427b32486 user: mario tags: trunk
Changes

Modified pluginconf/depends.py from [f49268879d] to [9f3c7d2302].

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
        from compat2and3 import find_executable
    except ImportError:
        find_executable = lambda name: False


# Minimal depends: probing
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
class Check(object):
    """
    Now this definitely requires customization. Each plugin can carry
    a list of (soft-) dependency names.

    \# depends: config, appcore >= 2.0, bin:wkhtmltoimage, python < 3.5

    Here only in-application modules are honored, system references
    ignored. Unknown plugin names are also skipped. A real install
    helper might want to auto-tick them on, etc. This example is just
    meant for probing downloadable plugins.

    The .valid() helper only asserts the api: string, or skips existing







|




|







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
        from compat2and3 import find_executable
    except ImportError:
        find_executable = lambda name: False


# Minimal depends: probing
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
class Check():
    """
    Now this definitely requires customization. Each plugin can carry
    a list of (soft-) dependency names.

    # depends: config, appcore >= 2.0, bin:wkhtmltoimage, python < 3.5

    Here only in-application modules are honored, system references
    ignored. Unknown plugin names are also skipped. A real install
    helper might want to auto-tick them on, etc. This example is just
    meant for probing downloadable plugins.

    The .valid() helper only asserts the api: string, or skips existing
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

    # debugging
    log = logging.getLogger("pluginconf.dependency")

    # ignore bin:… or python:… package in depends
    system_deps = False

    def __init__(self, add={}, core=["st2", "uikit", "config", "action"]):
        """
        Prepare list of known plugins and versions in self.have={}

        Parameters
        ----------
        add : dict
            name to pmd list of existing/core/virtual plugins (can define
            versions or own dependencies)
        core : list
            name list of virtual plugins
        """
        self.have = {
            "python": {"version": sys.version}
        }

        # inject virtual modules
        for name, meta in add.items():
            if isinstance(meta, bool):
                meta = 1 if meta else -1
            if isinstance(meta, tuple):
                meta = ".".join(str(n) for n in meta)
            if isinstance(meta, (int, float, str)):
                meta = {"version": str(meta)}
            self.have[name] = meta







|
















|







74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

    # debugging
    log = logging.getLogger("pluginconf.dependency")

    # ignore bin:… or python:… package in depends
    system_deps = False

    def __init__(self, add=None, core=["st2", "uikit", "config", "action"]):
        """
        Prepare list of known plugins and versions in self.have={}

        Parameters
        ----------
        add : dict
            name to pmd list of existing/core/virtual plugins (can define
            versions or own dependencies)
        core : list
            name list of virtual plugins
        """
        self.have = {
            "python": {"version": sys.version}
        }

        # inject virtual modules
        for name, meta in (add or {}).items():
            if isinstance(meta, bool):
                meta = 1 if meta else -1
            if isinstance(meta, tuple):
                meta = ".".join(str(n) for n in meta)
            if isinstance(meta, (int, float, str)):
                meta = {"version": str(meta)}
            self.have[name] = meta