hdmf-dev / hdmf-schema-language

The specification language for HDMF
https://hdmf-schema-language.readthedocs.io
Other
0 stars 2 forks source link

Add 'version' key for included namespaces #11

Open rly opened 3 years ago

rly commented 3 years ago

As new versions of schema A are released, schema A may no longer be compatible with schema B that includes schema A. Older versions of schema A may also not be compatible with schema B that includes schema A.

For example, if the hdmf-common schema has a type X but changes it in a compatibility breaking way from version 2 to version 3, then my extension will break if hdmf-common schema version 3 is loaded. It should be restricted to versions <3.

If the hdmf-common schema introduces a new type X in version 1.4 and my extension schema depends on that new type, then my extension will break if hdmf-common schema version 1.3 is loaded. It should be restricted to versions >=1.4.

These should be combinable and support >, >=, ==, !=, <, and <=, just like in pip requirements specs and conda requirements specs. See https://www.python.org/dev/peps/pep-0440/ and https://www.python.org/dev/peps/pep-0508/

This would be the value for a key "version" under namespaces[i] > schema[i] alongside "namespace" and "data_types", like the following:

namespaces:
- author:
  - ...
  contact:
  - ...
  doc: ...
  name: ndx-my-ext
  schema:
  - namespace: core
    version: >=2,<3
    neurodata_types:
    - NWBDataInterface
    - DynamicTable
    - VectorData
    - VectorIndex
  - source: ndx-my-ext.extensions.yaml
  version: 0.2.0