Closed ReimarBauer closed 2 months ago
- "application/x-menuinst": ["*.menuinst"]
+ "application/x-menuinst": "*.menuinst"
I think this is the change you need. Maybe this should be a list in general, but for your use case this should work with the current schema.
Now it shows ['platforms']['properties']['**osx**']
, but I am still on linux. I would expect it ignores that section.
Packaging mss-alpha-py311_1000
number of files: 8
Validating Menu/*.json files
WARNING: 'Menu/mss_menu.json' is not a valid menuinst JSON document!
Traceback (most recent call last):
File "/home/user/Miniforge/lib/python3.11/site-packages/conda_build/post.py", line 1776, in check_menuinst_json
validator.validate(json.loads(text))
File "/home/user/Miniforge/lib/python3.11/site-packages/jsonschema/validators.py", line 438, in validate
raise error
jsonschema.exceptions.ValidationError: [{'public.filename-extension': ['menuinst']}] is not of type 'object'
Failed validating 'type' in schema['properties']['menu_items']['items']['properties']['platforms']['properties']['osx']['properties']['UTExportedTypeDeclarations']['items']['properties']['UTTypeTagSpecification']:
{'additionalProperties': {'items': {'type': 'string'}, 'type': 'array'},
'title': 'Uttypetagspecification',
'type': 'object'}
On instance['menu_items'][0]['platforms']['osx']['UTExportedTypeDeclarations'][0]['UTTypeTagSpecification']:
[{'public.filename-extension': ['menuinst']}]
Fixing permissions
Packaged license file/s.
INFO :: Time taken to mark (prefix)
when I remove the osx and windows section also the failure is gone
Packaging mss
Packaging mss-alpha-py311_1000
number of files: 8
Validating Menu/*.json files
'Menu/mss_menu.json' is a valid menuinst JSON document
Fixing permissions
Packaged license file/s.
Removing all other OS's it builds now.
{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://schemas.conda.io/menuinst-1.schema.json",
"menu_name": "Mission Support System",
"menu_items": [
{
"name": "MSUI",
"description": "Mission Support System UI",
"activate": true,
"icon": "{{ MENU_DIR }}/msui.{{ ICON_EXT }}",
"command": ["{{ PREFIX }}/bin/msui.py"],
"platforms": {
"linux": {
"Categories": ["Science", "Education"],
"Keywords": ["documentation", "information"],
"StartupNotify": true,
"MimeType": ["application/x-menuinst"],
"glob_patterns": {
"application/x-menuinst": "*.menuinst"
}
}
}
}
]
}
The validation happens for the whole JSON document. You can have a single JSON for all OSs in your noarch package, or if you prefer it this way, have a per-arch package with a dedicated JSON.
"UTTypeTagSpecification": [
{
"public.filename-extension": ["menuinst"]
}
should be a plain dict:
"UTTypeTagSpecification": {
"public.filename-extension": ["menuinst"]
}
I realized now the docs are out of date. Source of truth for now should be this test file. I'll update the docs. Sorry for the trouble!
https://github.com/conda/menuinst/pull/190 should point to the right examples now.
this helped, thx.
https://github.com/conda/menuinst/pull/190 is merged, so closing here. Thanks for the report!
Checklist
What happened?
I setup a menu.json
Using conda build . I am able to build a wheel Building wheel for mss (setup.py): finished with status 'done'
But with the menu entries something is wrong
also it always shows a Warning
my tests also fail
Conda Info
Conda Config