http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/23d6ba76/apache-ariatosca-0.1.1/extensions/aria_extension_tosca/simple_v1_0/types.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/extensions/aria_extension_tosca/simple_v1_0/types.py b/apache-ariatosca-0.1.1/extensions/aria_extension_tosca/simple_v1_0/types.py deleted file mode 100644 index 570b89f..0000000 --- a/apache-ariatosca-0.1.1/extensions/aria_extension_tosca/simple_v1_0/types.py +++ /dev/null @@ -1,868 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from aria.utils.collections import FrozenDict, FrozenList -from aria.utils.caching import cachedmethod -from aria.parser import implements_specification -from aria.parser.presentation import (has_fields, allow_unknown_fields, primitive_field, - primitive_list_field, object_field, object_dict_field, - object_list_field, object_sequenced_list_field, - object_dict_unknown_fields, field_getter, field_validator, - list_type_validator, derived_from_validator, - get_parent_presentation) - -from .assignments import ArtifactAssignment -from .data_types import Version -from .definitions import (PropertyDefinition, AttributeDefinition, InterfaceDefinition, - RequirementDefinition, CapabilityDefinition, OperationDefinition) -from .misc import (Description, ConstraintClause) -from .modeling.artifacts import get_inherited_artifact_definitions -from .modeling.capabilities import (get_inherited_valid_source_types, - get_inherited_capability_definitions) -from .modeling.data_types import (get_data_type, get_inherited_constraints, coerce_data_type_value, - validate_data_type_name) -from .modeling.interfaces import (get_inherited_interface_definitions, get_inherited_operations) -from .modeling.policies import get_inherited_targets -from .modeling.parameters import get_inherited_parameter_definitions -from .modeling.requirements import get_inherited_requirement_definitions -from .presentation.extensible import ExtensiblePresentation -from .presentation.field_getters import data_type_class_getter -from .presentation.field_validators import (data_type_derived_from_validator, - data_type_constraints_validator, - data_type_properties_validator, - list_node_type_or_group_type_validator) -from .presentation.types import convert_shorthand_to_full_type_name - -@has_fields -@implements_specification('3.6.3', 'tosca-simple-1.0') -class ArtifactType(ExtensiblePresentation): - """ - An Artifact Type is a reusable entity that defines the type of one or more files that are used - to define implementation or deployment artifacts that are referenced by nodes or relationships - on their operations. - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_ARTIFACT_TYPE>`__ - """ - - @field_validator(derived_from_validator(convert_shorthand_to_full_type_name, 'artifact_types')) - @primitive_field(str) - def derived_from(self): - """ - An optional parent Artifact Type name the Artifact Type derives from. - - :type: :obj:`basestring` - """ - - @field_getter(data_type_class_getter(Version)) - @primitive_field() - def version(self): - """ - An optional version for the Artifact Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - An optional description for the Artifact Type. - - :type: :class:`Description` - """ - - @primitive_field(str) - def mime_type(self): - """ - The required mime type property for the Artifact Type. - - :type: :obj:`basestring` - """ - - @primitive_list_field(str) - def file_ext(self): - """ - The required file extension property for the Artifact Type. - - :type: [:obj:`basestring`] - """ - - @object_dict_field(PropertyDefinition) - def properties(self): - """ - An optional list of property definitions for the Artifact Type. - - :type: {:obj:`basestring`: :class:`PropertyDefinition`} - """ - - @cachedmethod - def _get_parent(self, context): - return get_parent_presentation(context, self, convert_shorthand_to_full_type_name, - 'artifact_types') - - @cachedmethod - def _get_properties(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'properties')) - - def _validate(self, context): - super(ArtifactType, self)._validate(context) - self._get_properties(context) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'mime_type', - 'file_ext', - 'properties')) - -@has_fields -@implements_specification('3.6.5', 'tosca-simple-1.0') -class DataType(ExtensiblePresentation): - """ - A Data Type definition defines the schema for new named datatypes in TOSCA. - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_DATA_TYPE>`__ - """ - - @field_validator(data_type_derived_from_validator) - @primitive_field(str) - def derived_from(self): - """ - The optional key used when a datatype is derived from an existing TOSCA Data Type. - - :type: :obj:`basestring` - """ - - @object_field(Version) - def version(self): - """ - An optional version for the Data Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - The optional description for the Data Type. - - :type: :class:`Description` - """ - - @field_validator(data_type_constraints_validator) - @object_list_field(ConstraintClause) - def constraints(self): - """ - The optional list of sequenced constraint clauses for the Data Type. - - :type: list of (str, :class:`ConstraintClause`) - """ - - @field_validator(data_type_properties_validator) - @object_dict_field(PropertyDefinition) - def properties(self): - """ - The optional list property definitions that comprise the schema for a complex Data Type in - TOSCA. - - :type: {:obj:`basestring`: :class:`PropertyDefinition`} - """ - - @cachedmethod - def _get_parent(self, context): - return get_data_type(context, self, 'derived_from', allow_none=True) - - @cachedmethod - def _get_primitive_ancestor(self, context): - parent = self._get_parent(context) - if parent is not None: - if not isinstance(parent, DataType): - return parent - else: - return parent._get_primitive_ancestor(context) # pylint: disable=no-member - return None - - @cachedmethod - def _get_properties(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'properties')) - - @cachedmethod - def _get_constraints(self, context): - return get_inherited_constraints(context, self) - - def _validate(self, context): - super(DataType, self)._validate(context) - validate_data_type_name(context, self) - self._get_properties(context) - - def _coerce_value(self, context, presentation, entry_schema, constraints, value, aspect): - return coerce_data_type_value(context, presentation, self, entry_schema, constraints, value, - aspect) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'constraints', - 'properties')) - -@has_fields -@implements_specification('3.6.6', 'tosca-simple-1.0') -class CapabilityType(ExtensiblePresentation): - """ - A Capability Type is a reusable entity that describes a kind of capability that a Node Type can - declare to expose. Requirements (implicit or explicit) that are declared as part of one node can - be matched to (i.e., fulfilled by) the Capabilities declared by another node. - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_CAPABILITY_TYPE>`__ - """ - - @field_validator(derived_from_validator(convert_shorthand_to_full_type_name, - 'capability_types')) - @primitive_field(str) - def derived_from(self): - """ - An optional parent capability type name this new Capability Type derives from. - - :type: :obj:`basestring` - """ - - @object_field(Version) - def version(self): - """ - An optional version for the Capability Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - An optional description for the Capability Type. - - :type: :class:`Description` - """ - - @object_dict_field(PropertyDefinition) - def properties(self): - """ - An optional list of property definitions for the Capability Type. - - ARIA NOTE: The spec says 'list', but the examples are all of dicts. - - :type: {:obj:`basestring`: :class:`PropertyDefinition`} - """ - - @object_dict_field(AttributeDefinition) - def attributes(self): - """ - An optional list of attribute definitions for the Capability Type. - - :type: {:obj:`basestring`: :class:`AttributeDefinition`} - """ - - @field_validator(list_type_validator('node type', convert_shorthand_to_full_type_name, - 'node_types')) - @primitive_list_field(str) - def valid_source_types(self): - """ - An optional list of one or more valid names of Node Types that are supported as valid - sources of any relationship established to the declared Capability Type. - - :type: [:obj:`basestring`] - """ - - @cachedmethod - def _get_parent(self, context): - return get_parent_presentation(context, self, convert_shorthand_to_full_type_name, - 'capability_types') - - @cachedmethod - def _is_descendant(self, context, the_type): - if the_type is None: - return False - elif the_type._name == self._name: - return True - return self._is_descendant(context, the_type._get_parent(context)) - - @cachedmethod - def _get_properties(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'properties')) - - @cachedmethod - def _get_valid_source_types(self, context): - return get_inherited_valid_source_types(context, self) - - def _validate(self, context): - super(CapabilityType, self)._validate(context) - self._get_properties(context) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'valid_source_types', - 'properties', - 'attributes')) - -@allow_unknown_fields -@has_fields -@implements_specification('3.6.4', 'tosca-simple-1.0') -class InterfaceType(ExtensiblePresentation): - """ - An Interface Type is a reusable entity that describes a set of operations that can be used to - interact with or manage a node or relationship in a TOSCA topology. - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_INTERFACE_TYPE>`__ - """ - - @field_validator(derived_from_validator(convert_shorthand_to_full_type_name, 'interface_types')) - @primitive_field(str) - def derived_from(self): - """ - An optional parent Interface Type name this new Interface Type derives from. - - :type: :obj:`basestring` - """ - - @object_field(Version) - def version(self): - """ - An optional version for the Interface Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - An optional description for the Interface Type. - - :type: :class:`Description` - """ - - @object_dict_field(PropertyDefinition) - def inputs(self): - """ - The optional list of input parameter definitions. - - :type: {:obj:`basestring`: :class:`PropertyDefinition`} - """ - - @object_dict_unknown_fields(OperationDefinition) - def operations(self): - """ - :type: {:obj:`basestring`: :class:`OperationDefinition`} - """ - - @cachedmethod - def _get_parent(self, context): - return get_parent_presentation(context, self, convert_shorthand_to_full_type_name, - 'interface_types') - - @cachedmethod - def _get_inputs(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'inputs')) - - @cachedmethod - def _get_operations(self, context): - return FrozenDict(get_inherited_operations(context, self)) - - def _validate(self, context): - super(InterfaceType, self)._validate(context) - self._get_inputs(context) - for operation in self.operations.itervalues(): # pylint: disable=no-member - operation._validate(context) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'inputs', - 'operations')) - -@has_fields -@implements_specification('3.6.9', 'tosca-simple-1.0') -class RelationshipType(ExtensiblePresentation): - """ - A Relationship Type is a reusable entity that defines the type of one or more relationships - between Node Types or Node Templates. - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_RELATIONSHIP_TYPE>`__ - """ - - @field_validator(derived_from_validator(convert_shorthand_to_full_type_name, - 'relationship_types')) - @primitive_field(str) - def derived_from(self): - """ - An optional parent Relationship Type name the Relationship Type derives from. - - :type: :obj:`basestring` - """ - - @object_field(Version) - def version(self): - """ - An optional version for the Relationship Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - An optional description for the Relationship Type. - - :type: :class:`Description` - """ - - @object_dict_field(PropertyDefinition) - def properties(self): - """ - An optional list of property definitions for the Relationship Type. - - :type: {:obj:`basestring`: :class:`PropertyDefinition`} - """ - - @object_dict_field(AttributeDefinition) - def attributes(self): - """ - An optional list of attribute definitions for the Relationship Type. - - :type: {:obj:`basestring`: :class:`AttributeDefinition`} - """ - - @object_dict_field(InterfaceDefinition) - def interfaces(self): - """ - An optional list of interface definitions interfaces supported by the Relationship Type. - - :type: {:obj:`basestring`: :class:`InterfaceDefinition`} - """ - - @field_validator(list_type_validator('capability type', convert_shorthand_to_full_type_name, - 'capability_types')) - @primitive_list_field(str) - def valid_target_types(self): - """ - An optional list of one or more names of Capability Types that are valid targets for this - relationship. - - :type: [:obj:`basestring`] - """ - - @cachedmethod - def _get_parent(self, context): - return get_parent_presentation(context, self, convert_shorthand_to_full_type_name, - 'relationship_types') - - @cachedmethod - def _is_descendant(self, context, the_type): - if the_type is None: - return False - elif the_type._name == self._name: - return True - return self._is_descendant(context, the_type._get_parent(context)) - - @cachedmethod - def _get_properties(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'properties')) - - @cachedmethod - def _get_attributes(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'attributes')) - - @cachedmethod - def _get_interfaces(self, context): - return FrozenDict(get_inherited_interface_definitions(context, self, 'relationship type')) - - def _validate(self, context): - super(RelationshipType, self)._validate(context) - self._get_properties(context) - self._get_attributes(context) - self._get_interfaces(context) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'valid_target_types', - 'properties', - 'attributes', - 'interfaces')) - -@has_fields -@implements_specification('3.6.8', 'tosca-simple-1.0') -class NodeType(ExtensiblePresentation): - """ - A Node Type is a reusable entity that defines the type of one or more Node Templates. As such, a - Node Type defines the structure of observable properties via a Properties Definition, the - Requirements and Capabilities of the node as well as its supported interfaces. - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_NODE_TYPE>`__ - """ - - @field_validator(derived_from_validator(convert_shorthand_to_full_type_name, 'node_types')) - @primitive_field(str) - def derived_from(self): - """ - An optional parent Node Type name this new Node Type derives from. - - :type: :obj:`basestring` - """ - - @object_field(Version) - def version(self): - """ - An optional version for the Node Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - An optional description for the Node Type. - - :type: :class:`Description` - """ - - @object_dict_field(PropertyDefinition) - def properties(self): - """ - An optional list of property definitions for the Node Type. - - :type: {:obj:`basestring`: :class:`PropertyDefinition`} - """ - - @object_dict_field(AttributeDefinition) - def attributes(self): - """ - An optional list of attribute definitions for the Node Type. - - :type: {:obj:`basestring`: :class:`AttributeDefinition`} - """ - - @object_sequenced_list_field(RequirementDefinition) - def requirements(self): - """ - An optional sequenced list of requirement definitions for the Node Type. - - ARIA NOTE: The spec seems wrong to make this a sequenced list. It seems that when you have - more than one requirement of the same name, behavior is undefined. The idea is to use the - "occurrences" field if you need to limit the number of requirement assignments. - - :type: list of (str, :class:`RequirementDefinition`) - """ - - @object_dict_field(CapabilityDefinition) - def capabilities(self): - """ - An optional list of capability definitions for the Node Type. - - :type: list of :class:`CapabilityDefinition` - """ - - @object_dict_field(InterfaceDefinition) - def interfaces(self): - """ - An optional list of interface definitions supported by the Node Type. - - :type: {:obj:`basestring`: :class:`InterfaceDefinition`} - """ - - @object_dict_field(ArtifactAssignment) - def artifacts(self): - """ - An optional list of named artifact definitions for the Node Type. - - :type: {:obj:`basestring`: :class:`ArtifactAssignment`} - """ - - @cachedmethod - def _get_parent(self, context): - return get_parent_presentation(context, self, convert_shorthand_to_full_type_name, - 'node_types') - - @cachedmethod - def _is_descendant(self, context, the_type): - if the_type is None: - return False - elif the_type._name == self._name: - return True - return self._is_descendant(context, the_type._get_parent(context)) - - @cachedmethod - def _get_properties(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'properties')) - - @cachedmethod - def _get_attributes(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'attributes')) - - @cachedmethod - def _get_requirements(self, context): - return FrozenList(get_inherited_requirement_definitions(context, self)) - - @cachedmethod - def _get_capabilities(self, context): - return FrozenDict(get_inherited_capability_definitions(context, self)) - - @cachedmethod - def _get_interfaces(self, context): - return FrozenDict(get_inherited_interface_definitions(context, self, 'node type')) - - @cachedmethod - def _get_artifacts(self, context): - return FrozenDict(get_inherited_artifact_definitions(context, self)) - - def _validate(self, context): - super(NodeType, self)._validate(context) - self._get_properties(context) - self._get_attributes(context) - self._get_requirements(context) - self._get_capabilities(context) - self._get_interfaces(context) - self._get_artifacts(context) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'properties', - 'attributes', - 'interfaces', - 'artifacts', - 'requirements', - 'capabilities')) - -@has_fields -@implements_specification('3.6.10', 'tosca-simple-1.0') -class GroupType(ExtensiblePresentation): - """ - A Group Type defines logical grouping types for nodes, typically for different management - purposes. Groups can effectively be viewed as logical nodes that are not part of the physical - deployment topology of an application, yet can have capabilities and the ability to attach - policies and interfaces that can be applied (depending on the group type) to its member nodes. - - Conceptually, group definitions allow the creation of logical "membership" relationships to - nodes in a service template that are not a part of the application's explicit requirement - dependencies in the topology template (i.e. those required to actually get the application - deployed and running). Instead, such logical membership allows for the introduction of things - such as group management and uniform application of policies (i.e., requirements that are also - not bound to the application itself) to the group's members. - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_GROUP_TYPE>`__ - """ - - @field_validator(derived_from_validator(convert_shorthand_to_full_type_name, 'group_types')) - @primitive_field(str) - def derived_from(self): - """ - An optional parent Group Type name the Group Type derives from. - - :type: :obj:`basestring` - """ - - @object_field(Version) - def version(self): - """ - An optional version for the Group Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - The optional description for the Group Type. - - :type: :class:`Description` - """ - - @object_dict_field(PropertyDefinition) - def properties(self): - """ - An optional list of property definitions for the Group Type. - - :type: {:obj:`basestring`: :class:`PropertyDefinition`} - """ - - @field_validator(list_type_validator('node type', convert_shorthand_to_full_type_name, - 'node_types')) - @primitive_list_field(str) - def members(self): - """ - An optional list of one or more names of Node Types that are valid (allowed) as members of - the Group Type. - - Note: This can be viewed by TOSCA Orchestrators as an implied relationship from the listed - members nodes to the group, but one that does not have operational lifecycle considerations. - For example, if we were to name this as an explicit Relationship Type we might call this - "MemberOf" (group). - - :type: [:obj:`basestring`] - """ - - @object_dict_field(InterfaceDefinition) - def interfaces(self): - """ - An optional list of interface definitions supported by the Group Type. - - :type: {:obj:`basestring`: :class:`InterfaceDefinition`} - """ - - @cachedmethod - def _get_parent(self, context): - return get_parent_presentation(context, self, convert_shorthand_to_full_type_name, - 'group_types') - - @cachedmethod - def _is_descendant(self, context, the_type): - if the_type is None: - return False - elif the_type._name == self._name: - return True - return self._is_descendant(context, the_type._get_parent(context)) - - @cachedmethod - def _get_properties(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'properties')) - - @cachedmethod - def _get_interfaces(self, context): - return FrozenDict(get_inherited_interface_definitions(context, self, 'group type')) - - def _validate(self, context): - super(GroupType, self)._validate(context) - self._get_properties(context) - self._get_interfaces(context) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'members', - 'properties', - 'interfaces')) - -@has_fields -@implements_specification('3.6.11', 'tosca-simple-1.0') -class PolicyType(ExtensiblePresentation): - """ - A Policy Type defines a type of requirement that affects or governs an application or service's - topology at some stage of its lifecycle, but is not explicitly part of the topology itself - (i.e., it does not prevent the application or service from being deployed or run if it did not - exist). - - See the `TOSCA Simple Profile v1.0 cos01 specification <http://docs.oasis-open.org/tosca - /TOSCA-Simple-Profile-YAML/v1.0/cos01/TOSCA-Simple-Profile-YAML-v1.0-cos01.html - #DEFN_ENTITY_POLICY_TYPE>`__ - """ - - @field_validator(derived_from_validator(convert_shorthand_to_full_type_name, 'policy_types')) - @primitive_field(str) - def derived_from(self): - """ - An optional parent Policy Type name the Policy Type derives from. - - :type: :obj:`basestring` - """ - - @object_field(Version) - def version(self): - """ - An optional version for the Policy Type definition. - - :type: :class:`Version` - """ - - @object_field(Description) - def description(self): - """ - The optional description for the Policy Type. - - :type: :class:`Description` - """ - - @object_dict_field(PropertyDefinition) - def properties(self): - """ - An optional list of property definitions for the Policy Type. - - :type: :class:`PropertyDefinition` - """ - - @field_validator(list_node_type_or_group_type_validator) - @primitive_list_field(str) - def targets(self): - """ - An optional list of valid Node Types or Group Types the Policy Type can be applied to. - - Note: This can be viewed by TOSCA Orchestrators as an implied relationship to the target - nodes, but one that does not have operational lifecycle considerations. For example, if we - were to name this as an explicit Relationship Type we might call this "AppliesTo" (node or - group). - - :type: [:obj:`basestring`] - """ - - @cachedmethod - def _get_parent(self, context): - return get_parent_presentation(context, self, convert_shorthand_to_full_type_name, - 'policy_types') - - @cachedmethod - def _get_properties(self, context): - return FrozenDict(get_inherited_parameter_definitions(context, self, 'properties')) - - @cachedmethod - def _get_targets(self, context): - node_types, group_types = get_inherited_targets(context, self) - return FrozenList(node_types), FrozenList(group_types) - - def _validate(self, context): - super(PolicyType, self)._validate(context) - self._get_properties(context) - - def _dump(self, context): - self._dump_content(context, ( - 'description', - 'version', - 'derived_from', - 'targets', - 'properties'))
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/23d6ba76/apache-ariatosca-0.1.1/requirements.in ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/requirements.in b/apache-ariatosca-0.1.1/requirements.in deleted file mode 100644 index 723ed51..0000000 --- a/apache-ariatosca-0.1.1/requirements.in +++ /dev/null @@ -1,39 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# In order to create the requirements.txt file, execute -# pip-compile --output-file requirements.txt requirements.in (pip-tools package is needed). - -requests>=2.3.0, <2.14.0 -networkx>=1.9, <1.10 # version 1.10 dropped support of python 2.6 -retrying>=1.3.0, <1.4.0 -blinker>1.3, <1.5 -jsonpickle>0.9.0, <=0.9.4 -ruamel.yaml>=0.11.12, <0.12.0 # version 0.12.0 dropped support of python 2.6 -Jinja2>=2.8, <2.9 -shortuuid>=0.5, <0.6 -CacheControl[filecache]>=0.11.0, <0.13 -clint>=0.5.0, <0.6 -SQLAlchemy>=1.1.0, <1.2 # version 1.2 dropped support of python 2.6 -wagon==0.6.0 -bottle>=0.12.0, <0.13 -setuptools>=35.0.0, <36.0.0 -click>=6.0, < 7.0 -colorama>=0.3.7, <=0.3.9 -PrettyTable>=0.7,<0.8 -click_didyoumean==0.0.3 -backports.shutil_get_terminal_size==1.0.0 -logutils==0.3.4.1 -psutil>=5.2.2, < 6.0.0 -importlib ; python_version < '2.7' -ordereddict ; python_version < '2.7' -total-ordering ; python_version < '2.7' # only one version on pypi http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/23d6ba76/apache-ariatosca-0.1.1/requirements.txt ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/requirements.txt b/apache-ariatosca-0.1.1/requirements.txt deleted file mode 100644 index 7ee1008..0000000 --- a/apache-ariatosca-0.1.1/requirements.txt +++ /dev/null @@ -1,43 +0,0 @@ -# -# This file is autogenerated by pip-compile -# To update, run: -# -# pip-compile --output-file requirements.txt requirements.in -# -appdirs==1.4.3 # via setuptools -args==0.1.0 # via clint -backports.shutil_get_terminal_size==1.0.0 -blinker==1.4 -bottle==0.12.13 -cachecontrol[filecache]==0.12.1 -click==6.7 -click_didyoumean==0.0.3 -clint==0.5.1 -colorama==0.3.9 -decorator==4.0.11 # via networkx -importlib==1.0.4 ; python_version < "2.7" -jinja2==2.8.1 -jsonpickle==0.9.4 -lockfile==0.12.2 # via cachecontrol -logutils==0.3.4.1 -markupsafe==1.0 # via jinja2 -msgpack-python==0.4.8 # via cachecontrol -networkx==1.9.1 -ordereddict==1.1 ; python_version < "2.7" -packaging==16.8 # via setuptools -prettytable==0.7.2 -psutil==5.2.2 -pyparsing==2.2.0 # via packaging -requests==2.13.0 -retrying==1.3.3 -ruamel.ordereddict==0.4.9 # via ruamel.yaml -ruamel.yaml==0.11.15 -shortuuid==0.5.0 -six==1.10.0 # via packaging, retrying, setuptools -sqlalchemy==1.1.6 -total-ordering==0.1.0 ; python_version < "2.7" -wagon==0.6.0 -wheel==0.29.0 # via wagon - -# The following packages are considered to be unsafe in a requirements file: -setuptools==35.0.2 http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/23d6ba76/apache-ariatosca-0.1.1/setup.cfg ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/setup.cfg b/apache-ariatosca-0.1.1/setup.cfg deleted file mode 100644 index 8bfd5a1..0000000 --- a/apache-ariatosca-0.1.1/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 - http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/23d6ba76/apache-ariatosca-0.1.1/setup.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/setup.py b/apache-ariatosca-0.1.1/setup.py deleted file mode 100644 index 8e95c19..0000000 --- a/apache-ariatosca-0.1.1/setup.py +++ /dev/null @@ -1,173 +0,0 @@ -#!/usr/bin/env python -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import sys - -from setuptools import setup, find_packages -from setuptools.command.install import install -from setuptools.command.develop import develop - - -_PACKAGE_NAME = 'apache-ariatosca' -_PYTHON_SUPPORTED_VERSIONS = [(2, 6), (2, 7)] -_EXTENSION_DIR = 'extensions' -_EXTENSION_NAMES = [ - 'aria_extension_tosca' -] - -if (sys.version_info[0], sys.version_info[1]) not in _PYTHON_SUPPORTED_VERSIONS: - raise NotImplementedError( - '{0} Package support Python version 2.6 & 2.7 Only'.format( - _PACKAGE_NAME)) - -root_dir = os.path.dirname(__file__) - -with open(os.path.join(root_dir, 'VERSION')) as version_file: - __version__ = version_file.read().strip() - incubating_version = '{0}-incubating'.format(__version__) - -with open(os.path.join(root_dir, 'README.rst')) as readme: - long_description = readme.read() - -install_requires = [] - -ssh_requires = [ - 'Fabric>=1.13.0, <1.14', -] -win_ssh_requires = [ - # Fabric depends on the pypiwin32 on Windows, but doesn't install it - 'pypiwin32==219' -] - -extras_require = { - 'ssh': ssh_requires, - 'ssh:sys_platform=="win32"': win_ssh_requires -} - -with open(os.path.join(root_dir, 'requirements.in')) as requirements: - for requirement in requirements.readlines(): - requirement = requirement.split('#')[0].strip() # get rid of comments or trailing comments - if not requirement: - continue # skip empty and comment lines - - # dependencies which use environment markers have to go in as conditional dependencies - # under "extra_require" rather than "install_requires", or otherwise the environment - # markers get ignored when installing from wheel. See more here: - # https://wheel.readthedocs.io/en/latest/index.html#defining-conditional-dependencies - # https://hynek.me/articles/conditional-python-dependencies/ - if ';' in requirement: - package, condition = requirement.split(';') - cond_name = ':{0}'.format(condition.strip()) - extras_require.setdefault(cond_name, []) - extras_require[cond_name].append(package.strip()) - else: - install_requires.append(requirement) - - -console_scripts = ['aria = aria.cli.main:main'] - - -def _generate_user_options(command): - return command.user_options + [ - ('skip-ctx', None, 'Install with or without the ctx (Defaults to False)') - ] - - -def _generate_boolean_options(command): - return command.boolean_options + ['skip-ctx'] - - -def _initialize_options(custom_cmd): - custom_cmd.command.initialize_options(custom_cmd) - custom_cmd.skip_ctx = False - - -def _run(custom_cmd): - if custom_cmd.skip_ctx is False: - console_scripts.append('ctx = aria.orchestrator.execution_plugin.ctx_proxy.client:main') - custom_cmd.command.run(custom_cmd) - - -class InstallCommand(install): - command = install - - user_options = _generate_user_options(install) - boolean_options = _generate_boolean_options(install) - initialize_options = _initialize_options - run = _run - - -class DevelopCommand(develop): - command = develop - - user_options = _generate_user_options(develop) - boolean_options = _generate_boolean_options(develop) - initialize_options = _initialize_options - run = _run - -setup( - name=_PACKAGE_NAME, - version=__version__, - description='ARIA', - long_description=long_description, - license='Apache License 2.0', - author='ARIA', - author_email='[email protected]', - url='http://ariatosca.incubator.apache.org/', - download_url=( - 'https://dist.apache.org/repos/dist/release/incubator/ariatosca/' + incubating_version), - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Console', - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: System :: Networking', - 'Topic :: System :: Systems Administration'], - packages=find_packages(include=['aria*']) + - find_packages(where=_EXTENSION_DIR, - include=['{0}*'.format(name) for name in _EXTENSION_NAMES]), - package_dir=dict((name, '{0}/{1}'.format(_EXTENSION_DIR, name)) for name in _EXTENSION_NAMES), - package_data={ - 'aria': [ - 'cli/config/config_template.yaml' - ], - 'aria_extension_tosca': [ - 'profiles/tosca-simple-1.0/**', - 'profiles/tosca-simple-nfv-1.0/**', - 'profiles/aria-1.0/**' - ] - }, - platforms=['any'], - zip_safe=False, - install_requires=install_requires, - extras_require=extras_require, - entry_points={ - 'console_scripts': console_scripts - }, - cmdclass={ - 'install': InstallCommand, # used in pip install ... - 'develop': DevelopCommand # used in pip install -e ... - } -) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/23d6ba76/build_site.sh ---------------------------------------------------------------------- diff --git a/build_site.sh b/build_site.sh index 68ae104..b6835c3 100755 --- a/build_site.sh +++ b/build_site.sh @@ -17,12 +17,13 @@ ARIAVERSION=0.1.1 DISTPATH=https://dist.apache.org/repos/dist/dev/incubator/ariatosca/$ARIAVERSION-incubating/sdist/apache-ariatosca-$ARIAVERSION.tar.gz DISTFILE=apache-ariatosca-$ARIAVERSION.tar.gz -# Copy docs +# Copy docs into _site wget -P $WORKDIR $DISTPATH tar -C $WORKDIR -xzf $WORKDIR/$DISTFILE apache-ariatosca-$ARIAVERSION/docs mkdir -p $WORKDIR/_site/docs -mv $WORKDIR/apache-ariatosca-$ARIAVERSION/docs $WORKDIR/_site/docs +mv $WORKDIR/apache-ariatosca-$ARIAVERSION/docs $WORKDIR/_site/ rm -f $WORKDIR/$DISTFILE +rm -Rf $WORKDIR/apache-ariatosca-$ARIAVERSION # Push git checkout asf-site
