WIP: Expand the developer documentation #27
6 changed files with 29 additions and 25 deletions
11
CHANGELOG.md
11
CHANGELOG.md
|
|
@ -1,3 +1,14 @@
|
||||||
|
## 1.2.0a62 (2026-02-11)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- structural data in a string
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- structurals data in extra could be a simple file
|
||||||
|
- allow define an addition variable in a type
|
||||||
|
|
||||||
## 1.2.0a61 (2026-02-06)
|
## 1.2.0a61 (2026-02-06)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a61"
|
version = "1.2.0a62"
|
||||||
|
|
||||||
[tool.commitizen]
|
[tool.commitizen]
|
||||||
name = "cz_conventional_commits"
|
name = "cz_conventional_commits"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail-base"
|
name = "rougail-base"
|
||||||
version = "1.2.0a61"
|
version = "1.2.0a62"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
description = "A consistency handling system that was initially designed in the configuration management"
|
description = "A consistency handling system that was initially designed in the configuration management"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "rougail"
|
name = "rougail"
|
||||||
version = "1.2.0a61"
|
version = "1.2.0a62"
|
||||||
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
|
||||||
description = "A consistency handling system that was initially designed in the configuration management"
|
description = "A consistency handling system that was initially designed in the configuration management"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
|
|
@ -18,7 +18,7 @@ classifiers = [
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ruamel.yaml ~= 0.18.6",
|
"ruamel.yaml ~= 0.18.6",
|
||||||
"pydantic ~= 2.9.2",
|
"pydantic ~= 2.9.2",
|
||||||
"rougail-base == 1.2.0a61",
|
"rougail-base == 1.2.0a62",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.flit.sdist]
|
[tool.flit.sdist]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
__version__ = "1.2.0a61"
|
__version__ = "1.2.0a62"
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ class VariableParam(Param):
|
||||||
variable: str
|
variable: str
|
||||||
propertyerror: bool = True
|
propertyerror: bool = True
|
||||||
whole: bool = False
|
whole: bool = False
|
||||||
dynamic: bool = True
|
# dynamic: bool = True
|
||||||
optional: bool = False
|
optional: bool = False
|
||||||
|
|
||||||
def to_param(
|
def to_param(
|
||||||
|
|
@ -254,6 +254,7 @@ class Calculation(BaseModel):
|
||||||
default_values: Any = None
|
default_values: Any = None
|
||||||
namespace: Optional[str]
|
namespace: Optional[str]
|
||||||
warnings: Optional[bool] = None
|
warnings: Optional[bool] = None
|
||||||
|
description: Optional[StrictStr] = None
|
||||||
xmlfiles: List[str]
|
xmlfiles: List[str]
|
||||||
|
|
||||||
model_config = ConfigDict(extra="forbid")
|
model_config = ConfigDict(extra="forbid")
|
||||||
|
|
@ -298,7 +299,6 @@ class JinjaCalculation(Calculation):
|
||||||
jinja: StrictStr
|
jinja: StrictStr
|
||||||
params: Optional[List[Param]] = None
|
params: Optional[List[Param]] = None
|
||||||
return_type: BASETYPE = None
|
return_type: BASETYPE = None
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
|
|
||||||
def _jinja_to_function(
|
def _jinja_to_function(
|
||||||
self,
|
self,
|
||||||
|
|
@ -719,7 +719,6 @@ class _VariableCalculation(Calculation):
|
||||||
|
|
||||||
class VariableCalculation(_VariableCalculation):
|
class VariableCalculation(_VariableCalculation):
|
||||||
attribute_name: Literal["default", "choices", "dynamic"]
|
attribute_name: Literal["default", "choices", "dynamic"]
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
default: Any = undefined
|
default: Any = undefined
|
||||||
|
|
||||||
def to_function(
|
def to_function(
|
||||||
|
|
@ -778,7 +777,6 @@ class VariablePropertyCalculation(_VariableCalculation):
|
||||||
propertyerror: Union[Literal["transitive"], bool] = True
|
propertyerror: Union[Literal["transitive"], bool] = True
|
||||||
when: Any = undefined
|
when: Any = undefined
|
||||||
when_not: Any = undefined
|
when_not: Any = undefined
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
default: bool = False
|
default: bool = False
|
||||||
|
|
||||||
def to_function(
|
def to_function(
|
||||||
|
|
@ -870,7 +868,6 @@ class InformationCalculation(Calculation):
|
||||||
attribute_name: Literal["default", "choice", "dynamic"]
|
attribute_name: Literal["default", "choice", "dynamic"]
|
||||||
information: StrictStr
|
information: StrictStr
|
||||||
variable: Optional[StrictStr]
|
variable: Optional[StrictStr]
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
|
|
||||||
def to_function(
|
def to_function(
|
||||||
self,
|
self,
|
||||||
|
|
@ -928,7 +925,6 @@ class _IdentifierCalculation(Calculation):
|
||||||
|
|
||||||
class IdentifierCalculation(_IdentifierCalculation):
|
class IdentifierCalculation(_IdentifierCalculation):
|
||||||
attribute_name: Literal["default", "choice", "dynamic"]
|
attribute_name: Literal["default", "choice", "dynamic"]
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
|
|
||||||
def to_function(
|
def to_function(
|
||||||
self,
|
self,
|
||||||
|
|
@ -948,7 +944,6 @@ class IdentifierPropertyCalculation(_IdentifierCalculation):
|
||||||
attribute_name: Literal[*PROPERTY_ATTRIBUTE]
|
attribute_name: Literal[*PROPERTY_ATTRIBUTE]
|
||||||
when: Any = undefined
|
when: Any = undefined
|
||||||
when_not: Any = undefined
|
when_not: Any = undefined
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
|
|
||||||
def to_function(
|
def to_function(
|
||||||
self,
|
self,
|
||||||
|
|
@ -991,7 +986,6 @@ class IdentifierPropertyCalculation(_IdentifierCalculation):
|
||||||
|
|
||||||
class IndexCalculation(Calculation):
|
class IndexCalculation(Calculation):
|
||||||
attribute_name: Literal["default", "choice", "dynamic"]
|
attribute_name: Literal["default", "choice", "dynamic"]
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
|
|
||||||
def to_function(
|
def to_function(
|
||||||
self,
|
self,
|
||||||
|
|
@ -1011,7 +1005,6 @@ class IndexCalculation(Calculation):
|
||||||
|
|
||||||
class NamespaceCalculation(Calculation):
|
class NamespaceCalculation(Calculation):
|
||||||
attribute_name: Literal["default", "secret_manager"]
|
attribute_name: Literal["default", "secret_manager"]
|
||||||
description: Optional[StrictStr] = None
|
|
||||||
|
|
||||||
def to_function(
|
def to_function(
|
||||||
self,
|
self,
|
||||||
|
|
@ -1048,19 +1041,19 @@ SECRET_BASETYPE_CALC = Union[StrictStr, JinjaCalculation]
|
||||||
class Family(BaseModel):
|
class Family(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
# informations
|
# informations
|
||||||
description: Optional[str] = None
|
description: Optional[StrictStr] = None
|
||||||
help: Optional[str] = None
|
help: Optional[StrictStr] = None
|
||||||
mode: Optional[str] = None
|
mode: Optional[StrictStr] = None
|
||||||
# validation
|
# validation
|
||||||
type: Literal["family", "leadership", "dynamic"] = "family"
|
type: Literal["family", "leadership", "dynamic"] = "family"
|
||||||
# properties
|
# properties
|
||||||
hidden: Union[bool, Calculation] = False
|
hidden: Union[bool, Calculation] = False
|
||||||
disabled: Union[bool, Calculation] = False
|
disabled: Union[bool, Calculation] = False
|
||||||
# others
|
# others
|
||||||
namespace: Optional[str]
|
namespace: Optional[StrictStr]
|
||||||
path: str
|
path: StrictStr
|
||||||
version: str
|
version: StrictStr
|
||||||
xmlfiles: List[str] = []
|
xmlfiles: List[StrictStr] = []
|
||||||
|
|
||||||
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
model_config = ConfigDict(extra="forbid", arbitrary_types_allowed=True)
|
||||||
|
|
||||||
|
|
@ -1074,9 +1067,9 @@ class Dynamic(Family):
|
||||||
class Variable(BaseModel):
|
class Variable(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
# user informations
|
# user informations
|
||||||
description: Optional[str] = None
|
description: Optional[StrictStr] = None
|
||||||
help: Optional[str] = None
|
help: Optional[StrictStr] = None
|
||||||
mode: Optional[str] = None
|
mode: Optional[StrictStr] = None
|
||||||
tags: Optional[list] = None
|
tags: Optional[list] = None
|
||||||
examples: Optional[list] = None
|
examples: Optional[list] = None
|
||||||
test: Optional[list] = None
|
test: Optional[list] = None
|
||||||
|
|
@ -1084,7 +1077,7 @@ class Variable(BaseModel):
|
||||||
## type will be set dynamically in `annotator/value.py`, default is None
|
## type will be set dynamically in `annotator/value.py`, default is None
|
||||||
type: str = None
|
type: str = None
|
||||||
params: Optional[List[Param]] = None
|
params: Optional[List[Param]] = None
|
||||||
regexp: Optional[str] = None
|
regexp: Optional[StrictStr] = None
|
||||||
choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None
|
choices: Optional[Union[List[BASETYPE_CALC], Calculation]] = None
|
||||||
multi: Optional[bool] = None
|
multi: Optional[bool] = None
|
||||||
validators: Optional[List[Calculation]] = None
|
validators: Optional[List[Calculation]] = None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue