Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The requires_python attribute is optional. This attribute allows the extension to specify the versions of Python it can work with.   A The requires_python value The syntax and semantics are a subset of PEP 440 version specifiers. Its value consists of one or more version specifier clauses delimited by commas. A specifier clause consists of a comparison operator and a version number. if not specified, a default value of >=2.7 will be used.  Valid comparison operators are as follows:

OperatorMeaning
==Equal to
!=Not equal to
<Less than to
<=Less than or equal to
>Greater than

The Python Application implementing the Universal Extension must be packaged in a zip file, containing both an extension.py and an extension.yml.

The extension.yml is the YAML metadata configuration file, as shown below.

---
extension:
  name: extension1
  version: "0.1.0"
  api_level: "1.4.0"
  requires_python: ">=3.6"
  python_extra_paths: "${extension_zip}/lib:${extension_zip}/test/lib"
  zip_safe: true
owner:
  name: John Doe
  organization: Stonebranch, Inc.
comments: |
  These comments will appear in the Controller in the Universal Template 'Extension Comments' field.
  The 'Extension Comments' field can be viewed from the Meta Data section, the List, or the Show Details.

The extension name and api_level are required, while the extension requires_python (default “>=2.6”) and python_extra_paths are optional.

Note

For requires_python, you can use wildcards to select certain Python versions.

For example, the following configurations are supported:

  • requires_python: "==2.7*"
  • requires_python: "!=3.9.1*"
  • requires_python: "!=3*"

The owner name and organization are optional.

From the Universal Template form, the zip will be uploaded by clicking the add [+] icon (tooltip Upload Extension Archive) next to the Extension field, and persisted in the Universal Controller database as a byte[] (BLOB).

To download an already attached Extension Archive, click the link [∞] icon (tooltip Download Extension Archive).

To remove an already attached Extension Archive, click the remove [-] icon (tooltip Delete Extension Archive).

...

>=Greater than or equal to

A single version specifier consists of one of the above operators, followed by a version which must use one of these formats.

Major
Minor
PatchNote
Number



Equivalent to Number.0.0
Number.Number

Equivalent to Number.Number.0
Number.Number.Number
Number.*


Number*


Equivalent to Number.*
Number.Number.*
Number.Number*
Equivalent to Number.Number.*

The wildcard * is used in place of the minor number to mean that any version with a matching major number matches the specifier; or in place of the patch number to mean that any version with a matching major and minor number matches the specifier.

For example:

!=2*,!=3.9.*No 2 version, and no 3.9 version<2,>=3,<3.9,>=4Less than 2.0.0, and greater or equal to 3.0.0, and less than 3.9.0 and greater or equal to 4.0.0!=2*,!=3.*No 2 version, and no 3 version
==2.7.*,>=3.5Any 2.7 version, and greater than or equal to 3.5.0>=2.7.0,<=2.8Greater than or equal to 2.7.0, and less than or equal to 2.8.0==3.11.2Equal to 3.11.2
>=3.6Greater than or equal to 3.6.0==2.8.*Any 2.8 version>3.6.*Greater than any 3.6 version

The comparison algorithm is as follows: given Python versions A and B,

  1. If A.major > B.major, A > B
  2. If A.major < B.major, A < B

  3. If either A.minor or B.minor is a wildcard, A == B

  4. If A.minor > B.minor, A > B

  5. If A.minor < B.minor, A < B

  6. If either A.patch or B.patch is a wildcard, A == B

  7. If A.patch > B.patch, A > B

  8. If A.patch < B.patch, A < B

  9. A == B

python_extra_paths

The python_extra_paths attribute is optional.  This attribute provides a means for the extension developer to specify additional paths that will be included in the Python runtime environment in which the extension runs. Since it is impossible for the extension developer to know the path to the deployed extension at runtime, a special token is provided that will resolve to the deployed extension path at runtime: ${extension_zip}.

At runtime, ${extension_zip} will be replaced with the file system path to the deployed extension.  For example, if an extension archive included a directory for test modules:

Code Block
├── extension.py
├── extension.yml
└── test
    └── test1.py
    └── test2.py
    └── test3.py


The following python_extra_paths value would setup pathing in the runtime environment allowing the extension code to access the test package:

python_extra_paths: ${extension_zip}/test

zip_safe

The zip_safe attribute is optional.  It specifies whether the extension should be run directly from the zip archive or extracted to the file system in a private cache and run from there.  The default value is true.

Info

This attribute was introduced in Universal Extension API level 1.4.0. In order for zip_safe: false to have any impact, the extension must specify a Universal Extension API level >= 1.4.0 via the api_level attribute in extension.yml.


Info

If an extension requires "dependency packages" (introduced in Universal Extension API 1.4.0), the extension must specify zip_safe: false.

owner

This section pertains to the owner of the extension (the extension developer or developer's organization).

name

The name attribute is optional.  Specifies the Universal Extension owner's name.  This field is displayed in the Metadata section of an extensions Universal Template in the Universal Controller.  It is for informational purposes only.

organization

The organization attribute is optional.  Specifies the Universal Extension developer's organization.  This field is displayed in the Metadata section of an extensions Universal Template in the Universal Controller.  It is for informational purposes only.

comments

The comments section is optional. This attribute allows the extension developer to provide information about the extension. This field is displayed in the Metadata section of an extensions Universal Template in the Universal Controller.  It is for informational purposes only.