pydist-schema.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. {
  2. "id": "http://www.python.org/dev/peps/pep-0426/",
  3. "$schema": "http://json-schema.org/draft-04/schema#",
  4. "title": "Metadata for Python Software Packages 2.0",
  5. "type": "object",
  6. "properties": {
  7. "metadata_version": {
  8. "description": "Version of the file format",
  9. "type": "string",
  10. "pattern": "^(\\d+(\\.\\d+)*)$"
  11. },
  12. "generator": {
  13. "description": "Name and version of the program that produced this file.",
  14. "type": "string",
  15. "pattern": "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])( \\(.*\\))?$"
  16. },
  17. "name": {
  18. "description": "The name of the distribution.",
  19. "type": "string",
  20. "$ref": "#/definitions/distribution_name"
  21. },
  22. "version": {
  23. "description": "The distribution's public version identifier",
  24. "type": "string",
  25. "pattern": "^(\\d+(\\.\\d+)*)((a|b|c|rc)(\\d+))?(\\.(post)(\\d+))?(\\.(dev)(\\d+))?$"
  26. },
  27. "source_label": {
  28. "description": "A constrained identifying text string",
  29. "type": "string",
  30. "pattern": "^[0-9a-z_.-+]+$"
  31. },
  32. "source_url": {
  33. "description": "A string containing a full URL where the source for this specific version of the distribution can be downloaded.",
  34. "type": "string",
  35. "format": "uri"
  36. },
  37. "summary": {
  38. "description": "A one-line summary of what the distribution does.",
  39. "type": "string"
  40. },
  41. "extras": {
  42. "description": "A list of optional sets of dependencies that may be used to define conditional dependencies in \"may_require\" and similar fields.",
  43. "type": "array",
  44. "items": {
  45. "type": "string",
  46. "$ref": "#/definitions/extra_name"
  47. }
  48. },
  49. "meta_requires": {
  50. "description": "A list of subdistributions made available through this metadistribution.",
  51. "type": "array",
  52. "$ref": "#/definitions/dependencies"
  53. },
  54. "run_requires": {
  55. "description": "A list of other distributions needed to run this distribution.",
  56. "type": "array",
  57. "$ref": "#/definitions/dependencies"
  58. },
  59. "test_requires": {
  60. "description": "A list of other distributions needed when this distribution is tested.",
  61. "type": "array",
  62. "$ref": "#/definitions/dependencies"
  63. },
  64. "build_requires": {
  65. "description": "A list of other distributions needed when this distribution is built.",
  66. "type": "array",
  67. "$ref": "#/definitions/dependencies"
  68. },
  69. "dev_requires": {
  70. "description": "A list of other distributions needed when this distribution is developed.",
  71. "type": "array",
  72. "$ref": "#/definitions/dependencies"
  73. },
  74. "provides": {
  75. "description": "A list of strings naming additional dependency requirements that are satisfied by installing this distribution. These strings must be of the form Name or Name (Version)",
  76. "type": "array",
  77. "items": {
  78. "type": "string",
  79. "$ref": "#/definitions/provides_declaration"
  80. }
  81. },
  82. "modules": {
  83. "description": "A list of modules and/or packages available for import after installing this distribution.",
  84. "type": "array",
  85. "items": {
  86. "type": "string",
  87. "$ref": "#/definitions/qualified_name"
  88. }
  89. },
  90. "namespaces": {
  91. "description": "A list of namespace packages this distribution contributes to",
  92. "type": "array",
  93. "items": {
  94. "type": "string",
  95. "$ref": "#/definitions/qualified_name"
  96. }
  97. },
  98. "obsoleted_by": {
  99. "description": "A string that indicates that this project is no longer being developed. The named project provides a substitute or replacement.",
  100. "type": "string",
  101. "$ref": "#/definitions/requirement"
  102. },
  103. "supports_environments": {
  104. "description": "A list of strings specifying the environments that the distribution explicitly supports.",
  105. "type": "array",
  106. "items": {
  107. "type": "string",
  108. "$ref": "#/definitions/environment_marker"
  109. }
  110. },
  111. "install_hooks": {
  112. "description": "The install_hooks field is used to define various operations that may be invoked on a distribution in a platform independent manner.",
  113. "type": "object",
  114. "properties": {
  115. "postinstall": {
  116. "type": "string",
  117. "$ref": "#/definitions/export_specifier"
  118. },
  119. "preuninstall": {
  120. "type": "string",
  121. "$ref": "#/definitions/export_specifier"
  122. }
  123. }
  124. },
  125. "extensions": {
  126. "description": "Extensions to the metadata may be present in a mapping under the 'extensions' key.",
  127. "type": "object",
  128. "$ref": "#/definitions/extensions"
  129. }
  130. },
  131. "required": ["metadata_version", "name", "version", "summary"],
  132. "additionalProperties": false,
  133. "definitions": {
  134. "contact": {
  135. "type": "object",
  136. "properties": {
  137. "name": {
  138. "type": "string"
  139. },
  140. "email": {
  141. "type": "string"
  142. },
  143. "url": {
  144. "type": "string"
  145. },
  146. "role": {
  147. "type": "string"
  148. }
  149. },
  150. "required": ["name"],
  151. "additionalProperties": false
  152. },
  153. "dependencies": {
  154. "type": "array",
  155. "items": {
  156. "type": "object",
  157. "$ref": "#/definitions/dependency"
  158. }
  159. },
  160. "dependency": {
  161. "type": "object",
  162. "properties": {
  163. "extra": {
  164. "type": "string",
  165. "$ref": "#/definitions/extra_name"
  166. },
  167. "environment": {
  168. "type": "string",
  169. "$ref": "#/definitions/environment_marker"
  170. },
  171. "requires": {
  172. "type": "array",
  173. "items": {
  174. "type": "string",
  175. "$ref": "#/definitions/requirement"
  176. }
  177. }
  178. },
  179. "required": ["requires"],
  180. "additionalProperties": false
  181. },
  182. "extensions": {
  183. "type": "object",
  184. "patternProperties": {
  185. "^[A-Za-z][0-9A-Za-z_]*([.][0-9A-Za-z_]*)*$": {}
  186. },
  187. "properties": {
  188. "python.details" : {
  189. "description": "More information regarding the distribution.",
  190. "type": "object",
  191. "properties": {
  192. "document_names": {
  193. "description": "Names of supporting metadata documents",
  194. "type": "object",
  195. "properties": {
  196. "description": {
  197. "type": "string",
  198. "$ref": "#/definitions/document_name"
  199. },
  200. "changelog": {
  201. "type": "string",
  202. "$ref": "#/definitions/document_name"
  203. },
  204. "license": {
  205. "type": "string",
  206. "$ref": "#/definitions/document_name"
  207. }
  208. },
  209. "additionalProperties": false
  210. },
  211. "keywords": {
  212. "description": "A list of additional keywords to be used to assist searching for the distribution in a larger catalog.",
  213. "type": "array",
  214. "items": {
  215. "type": "string"
  216. }
  217. },
  218. "license": {
  219. "description": "A string indicating the license covering the distribution.",
  220. "type": "string"
  221. },
  222. "classifiers": {
  223. "description": "A list of strings, with each giving a single classification value for the distribution.",
  224. "type": "array",
  225. "items": {
  226. "type": "string"
  227. }
  228. }
  229. }
  230. },
  231. "python.project" : {
  232. "description": "More information regarding the creation and maintenance of the distribution.",
  233. "$ref": "#/definitions/project_or_integrator"
  234. },
  235. "python.integrator" : {
  236. "description": "More information regarding the downstream redistributor of the distribution.",
  237. "$ref": "#/definitions/project_or_integrator"
  238. },
  239. "python.commands" : {
  240. "description": "Command line interfaces provided by this distribution",
  241. "type": "object",
  242. "$ref": "#/definitions/commands"
  243. },
  244. "python.exports" : {
  245. "description": "Other exported interfaces provided by this distribution",
  246. "type": "object",
  247. "$ref": "#/definitions/exports"
  248. }
  249. },
  250. "additionalProperties": false
  251. },
  252. "commands": {
  253. "type": "object",
  254. "properties": {
  255. "wrap_console": {
  256. "type": "object",
  257. "$ref": "#/definitions/command_map"
  258. },
  259. "wrap_gui": {
  260. "type": "object",
  261. "$ref": "#/definitions/command_map"
  262. },
  263. "prebuilt": {
  264. "type": "array",
  265. "items": {
  266. "type": "string",
  267. "$ref": "#/definitions/relative_path"
  268. }
  269. }
  270. },
  271. "additionalProperties": false
  272. },
  273. "exports": {
  274. "type": "object",
  275. "patternProperties": {
  276. "^[A-Za-z][0-9A-Za-z_]*([.][0-9A-Za-z_]*)*$": {
  277. "type": "object",
  278. "patternProperties": {
  279. ".": {
  280. "type": "string",
  281. "$ref": "#/definitions/export_specifier"
  282. }
  283. },
  284. "additionalProperties": false
  285. }
  286. },
  287. "additionalProperties": false
  288. },
  289. "command_map": {
  290. "type": "object",
  291. "patternProperties": {
  292. "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?$": {
  293. "type": "string",
  294. "$ref": "#/definitions/export_specifier"
  295. }
  296. },
  297. "additionalProperties": false
  298. },
  299. "project_or_integrator" : {
  300. "type": "object",
  301. "properties" : {
  302. "contacts": {
  303. "description": "A list of contributor entries giving the recommended contact points for getting more information about the project.",
  304. "type": "array",
  305. "items": {
  306. "type": "object",
  307. "$ref": "#/definitions/contact"
  308. }
  309. },
  310. "contributors": {
  311. "description": "A list of contributor entries for other contributors not already listed as current project points of contact.",
  312. "type": "array",
  313. "items": {
  314. "type": "object",
  315. "$ref": "#/definitions/contact"
  316. }
  317. },
  318. "project_urls": {
  319. "description": "A mapping of arbitrary text labels to additional URLs relevant to the project.",
  320. "type": "object"
  321. }
  322. }
  323. },
  324. "distribution_name": {
  325. "type": "string",
  326. "pattern": "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?$"
  327. },
  328. "requirement": {
  329. "type": "string"
  330. },
  331. "provides_declaration": {
  332. "type": "string"
  333. },
  334. "environment_marker": {
  335. "type": "string"
  336. },
  337. "document_name": {
  338. "type": "string"
  339. },
  340. "extra_name" : {
  341. "type": "string",
  342. "pattern": "^[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?$"
  343. },
  344. "relative_path" : {
  345. "type": "string"
  346. },
  347. "export_specifier": {
  348. "type": "string",
  349. "pattern": "^([A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*)(:[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*)?(\\[[0-9A-Za-z]([0-9A-Za-z_.-]*[0-9A-Za-z])?\\])?$"
  350. },
  351. "qualified_name" : {
  352. "type": "string",
  353. "pattern": "^[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_][A-Za-z_0-9]*)*$"
  354. },
  355. "prefixed_name" : {
  356. "type": "string",
  357. "pattern": "^[A-Za-z_][A-Za-z_0-9]*([.][A-Za-z_0-9]*)*$"
  358. }
  359. }
  360. }