[Python-checkins] peps: Tweak name rules for export groups and extensions
nick.coghlan
python-checkins at python.org
Sat Aug 10 23:17:03 CEST 2013
http://hg.python.org/peps/rev/f9e60037fe47
changeset: 5049:f9e60037fe47
user: Nick Coghlan <ncoghlan at gmail.com>
date: Sat Aug 10 17:16:46 2013 -0400
summary:
Tweak name rules for export groups and extensions
files:
pep-0426.txt | 18 +++++++++++++++---
pep-0426/pydist-schema.json | 16 ++++++++++++++--
2 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/pep-0426.txt b/pep-0426.txt
--- a/pep-0426.txt
+++ b/pep-0426.txt
@@ -259,6 +259,10 @@
and the qualified name of the object relative to the containing module or
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
-------------------------------------------
@@ -1591,7 +1595,7 @@
Example::
"commands": {
- "wrap_console": [{"wrapwithpython": "chair.run_cli"}],
+ "wrap_console": [{"wrapwithpython": "chair:run_cli"}],
"wrap_gui": [{"wrapwithpythonw": "chair:run_gui"}],
"prebuilt": ["notawrapper"]
}
@@ -1601,7 +1605,7 @@
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
the distribution.
@@ -1624,6 +1628,14 @@
distribution to determine whether or not an export is relevant without
needing to import every exporting module.
+Example::
+
+ "exports": {
+ "nose.plugins.0.10": {
+ "chairtest": "chair:NosePlugin"
+ }
+ }
+
Install hooks
=============
@@ -1738,7 +1750,7 @@
===================
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::
"extensions" : {
diff --git a/pep-0426/pydist-schema.json b/pep-0426/pydist-schema.json
--- a/pep-0426/pydist-schema.json
+++ b/pep-0426/pydist-schema.json
@@ -191,7 +191,8 @@
},
"extensions": {
"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": {
"type": "object",
"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",
"patternProperties": {
".": {
@@ -284,6 +285,13 @@
},
"additionalProperties": false
},
+ "extensions": {
+ "type": "object",
+ "patternProperties": {
+ "^[A-Za-z][0-9A-Za-z_]*([.][0-9A-Za-z_]*)*$": {}
+ },
+ "additionalProperties": false
+ },
"command_map": {
"type": "object",
"patternProperties": {
@@ -324,6 +332,10 @@
"qualified_name" : {
"type": "string",
"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]*)*$"
}
}
}
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list