Adding nmp inspired package properties to schema
keywords, hoempage, name
@@ -3824,23 +3824,21 @@ def schema_package(cfg, group):
lib = 'lib '
comma = ','
- # the project name becomes the package key
- if group == 'project':
localcfg['name'] = {
- 'switch': "-project_name <str>",
+ 'switch': f"-{group}_name '{lib}<str>'",
'type': 'str',
'lock': 'false',
'require': None,
'defvalue': None,
- 'shorthelp': 'Project name',
- 'example': ["cli: -project_name yac",
- "api: chip.set('project', 'name', 'yac')"],
- 'help': """
- Project name.
+ 'shorthelp': f"{group} name",
+ 'example': [
+ f"cli: -{group}_name yac",
+ f"api: chip.set('{group}','{lib}{comma}'name', 'yac')"],
+ 'help': f"""
+ Name of {group}.
"""
}
-
localcfg['version'] = {
'switch': f"-{group}_version '{lib}<str>'",
'type': 'str',
@@ -3872,6 +3870,37 @@ def schema_package(cfg, group):
"""
}
+ localcfg['keyword'] = {
+ 'switch': f"-{group}_keyword '{lib}<str>'",
+ 'type': 'str',
+ 'lock': 'false',
+ 'require': None,
+ 'defvalue': None,
+ 'shorthelp': f"{group} keyword",
+ 'example': [
+ f"cli: -{group}_keyword yac",
+ f"api: chip.set('{group}','{lib}{comma}'keyword', 'yac')"],
+ 'help': f"""
+ List of keyword(s) used to search for {group}.
+ """
+ }
+
+ localcfg['homepage'] = {
+ 'switch': f"-{group}_homepage '{lib}<str>'",
+ 'type': 'str',
+ 'lock': 'false',
+ 'require': None,
+ 'defvalue': None,
+ 'shorthelp': f"{group} homepage",
+ 'example': [
+ f"cli: -{group}_homepage yac",
+ f"api: chip.set('{group}','{lib}{comma}'homepage', 'yac')"],
+ 'help': f"""
+ Homepage for {group}.
+ """
+ }
+
+
doctypes = ['datasheet', 'specification', 'testplan',
'userguide', 'appnote', 'tutorial',
'reference']
@@ -3951,18 +3980,20 @@ def schema_package(cfg, group):
"""
}
- localcfg['dependency'] = {
- 'switch': f"-{group}_dependency '{lib}(<package>,<version>)'",
- 'type': '[(str,str)]',
+ package = 'default'
+ localcfg['dependency'] = {}
+ localcfg['dependency'][package] = {
+ 'switch': f"-{group}_dependency '{lib}<package> <version>'",
+ 'type': 'str',
'lock': 'false',
'require': None,
'defvalue': [],
- 'shorthelp': f'{group} dependency',
+ 'shorthelp': f'{group} dependency version',
'example': [
- f"cli: -{group}_dependency '{lib}(hello,1.0.0)'",
- f"api: chip.set('{group}',{lib}{comma}'dependency',('hello','1.0.0')"],
+ f"cli: -{group}_dependency '{lib}hello 1.0.0'",
+ f"api: chip.set('{group}',{lib}{comma}'dependency','hello','1.0.0'"],
'help': """
- Version of a named package dependency needed for the project.
+ Package version.
"""
}
