Tweak name rules for export groups and extensions

This commit is contained in:
Nick Coghlan 2013-08-10 17:16:46 -04:00
parent 1f417b8a9e
commit 2dd26998ec
2 changed files with 29 additions and 5 deletions

View File

@ -259,6 +259,10 @@ of the qualified name of the containing module or package, a colon (``:``)
and the qualified name of the object relative to the containing module or and the qualified name of the object relative to the containing module or
package. package.
A "prefixed name" starts with a qualified name, but is not necessarily a
qualified name - it may contain additional dot separated segments which are
not valid identifiers.
Integration and deployment of distributions Integration and deployment of distributions
------------------------------------------- -------------------------------------------
@ -1591,7 +1595,7 @@ previously installed, distribution.
Example:: Example::
"commands": { "commands": {
"wrap_console": [{"wrapwithpython": "chair.run_cli"}], "wrap_console": [{"wrapwithpython": "chair:run_cli"}],
"wrap_gui": [{"wrapwithpythonw": "chair:run_gui"}], "wrap_gui": [{"wrapwithpythonw": "chair:run_gui"}],
"prebuilt": ["notawrapper"] "prebuilt": ["notawrapper"]
} }
@ -1601,7 +1605,7 @@ Example::
Exports Exports
------- -------
The ``exports`` field is a mapping containing qualified names as keys. Each The ``exports`` field is a mapping containing prefixed names as keys. Each
key identifies an export group containing one or more exports published by key identifies an export group containing one or more exports published by
the distribution. the distribution.
@ -1624,6 +1628,14 @@ appropriate definition for the export name format can allow the importing
distribution to determine whether or not an export is relevant without distribution to determine whether or not an export is relevant without
needing to import every exporting module. needing to import every exporting module.
Example::
"exports": {
"nose.plugins.0.10": {
"chairtest": "chair:NosePlugin"
}
}
Install hooks Install hooks
============= =============
@ -1738,7 +1750,7 @@ Metadata Extensions
=================== ===================
Extensions to the metadata may be present in a mapping under the Extensions to the metadata may be present in a mapping under the
'extensions' key. The keys must be valid qualified names, while 'extensions' key. The keys must be valid prefixed names, while
the values may be any type natively supported in JSON:: the values may be any type natively supported in JSON::
"extensions" : { "extensions" : {

View File

@ -191,7 +191,8 @@
}, },
"extensions": { "extensions": {
"description": "Extensions to the metadata may be present in a mapping under the 'extensions' key.", "description": "Extensions to the metadata may be present in a mapping under the 'extensions' key.",
"type": "object" "type": "object",
"$ref": "#/definitions/extensions"
} }
}, },
@ -271,7 +272,7 @@
"exports": { "exports": {
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[A-Za-z]([0-9A-Za-z_])*([.][A-Za-z]([0-9A-Za-z_])*)*$": { "^[A-Za-z][0-9A-Za-z_]*([.][0-9A-Za-z_]*)*$": {
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
".": { ".": {
@ -284,6 +285,13 @@
}, },
"additionalProperties": false "additionalProperties": false
}, },
"extensions": {
"type": "object",
"patternProperties": {
"^[A-Za-z][0-9A-Za-z_]*([.][0-9A-Za-z_]*)*$": {}
},
"additionalProperties": false
},
"command_map": { "command_map": {
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
@ -324,6 +332,10 @@
"qualified_name" : { "qualified_name" : {
"type": "string", "type": "string",
"pattern": "^[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*$" "pattern": "^[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*$"
},
"prefixed_name" : {
"type": "string",
"pattern": "^[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_0-9]*)*$"
} }
} }
} }