Compare commits

..

No commits in common. "6e4440683aabbd27cc28936855ae070f7e9f2ee3" and "4061e96511112fdbcde755654293cc241e38f12a" have entirely different histories.

152 changed files with 28 additions and 502 deletions

View file

@ -1,11 +1,3 @@
## 0.1.0a12 (2025-10-10)
### Fix
- update test
- translation + tests
- tests for formatter
## 0.1.0a11 (2025-09-29) ## 0.1.0a11 (2025-09-29)
### Feat ### Feat

View file

@ -4,7 +4,7 @@ requires = ["flit_core >=3.8.0,<4"]
[project] [project]
name = "rougail.user_data_environment" name = "rougail.user_data_environment"
version = "0.1.0a12" version = "0.1.0a11"
authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}] authors = [{name = "Emmanuel Garette", email = "gnunux@gnunux.info"}]
readme = "README.md" readme = "README.md"
description = "Rougail user_data environment" description = "Rougail user_data environment"
@ -13,6 +13,9 @@ license = {file = "LICENSE"}
classifiers = [ classifiers = [
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.13",

View file

@ -1 +1 @@
__version__ = "0.1.0a12" __version__ = "0.1.0a11"

View file

@ -22,32 +22,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from .i18n import _
def get_rougail_config( def get_rougail_config(
*, *,
backward_compatibility=True, backward_compatibility=True,
) -> dict: ) -> dict:
options = f""" options = """
environment: environment:
description: {_("Configuration loading environment variables")} description: Define values from the environment
disabled: disabled:
jinja: | jinja: |
{{% if _.step.user_data is propertyerror or 'environment' not in _.step.user_data %}} {% if step.user_data is propertyerror or 'environment' not in step.user_data %}
disabled disabled
{{% endif %}} {% endif %}
default_environment_name: default_environment_name:
description: {_("Name of the default environment prefix")} description: Name of the default environment prefix
default: rougail default: rougail
disabled: disabled:
variable: __.main_namespace variable: main_namespace
when_not: null when_not: null
with_secrets:
description: {_("Environnement variables may contain secrets")}
default: true
""" """
return { return {
"name": "environment", "name": "environment",

View file

@ -45,10 +45,6 @@ class RougailUserDataEnvironment:
self.rougailconfig = rougailconfig self.rougailconfig = rougailconfig
if "environment" not in user_data: if "environment" not in user_data:
raise ExtentionError("environment is not set in step.user_data") raise ExtentionError("environment is not set in step.user_data")
if "environment.with_secrets" in self.rougailconfig:
self.with_secrets = self.rougailconfig["environment.with_secrets"]
else:
self.with_secrets = True
self.errors = [] self.errors = []
self.warnings = [] self.warnings = []
@ -63,7 +59,6 @@ class RougailUserDataEnvironment:
"options": { "options": {
"multi_separator": ",", "multi_separator": ",",
"needs_convert": True, "needs_convert": True,
"allow_secrets_variables": self.with_secrets,
}, },
} }
] ]

View file

@ -1,27 +0,0 @@
"""Internationalisation utilities
Silique (https://www.silique.fr)
Copyright (C) 2025
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from gettext import translation
from pathlib import Path
t = translation(
"rougail_user_data_environment", str(Path(__file__).parent / "locale"), fallback=True
)
_ = t.gettext

View file

@ -1,6 +1,6 @@
{ {
"errors": [], "errors": [],
"warnings": [ "warnings": [
"the value \"test\" is an invalid integer for \"variable_int\", which is not an integer, it will be ignored when loading from environment variable" "the value \"test\" is invalid for \"variable_int\", which is not an integer, it will be ignored when loading from environment variable"
] ]
} }

View file

@ -1,6 +1,6 @@
{ {
"errors": [], "errors": [],
"warnings": [ "warnings": [
"the value \"**********\" is an invalid password for \"secret\", at least 10 characters are required, it will be ignored when loading from environment variable" "the value \"**********\" is invalid for \"secret\", at least 10 characters are required, it will be ignored when loading from environment variable"
] ]
} }

View file

@ -4,5 +4,3 @@ ROUGAIL_VAR3="string1"
ROUGAIL_VAR4="string1" ROUGAIL_VAR4="string1"
ROUGAIL_VAR5="string1" ROUGAIL_VAR5="string1"
ROUGAIL_VAR6="string1" ROUGAIL_VAR6="string1"
ROUGAIL_VAR7="string1"
ROUGAIL_VAR8="string1"

View file

@ -4,5 +4,3 @@ ROUGAIL_VAR3="string1"
ROUGAIL_VAR4="string1" ROUGAIL_VAR4="string1"
ROUGAIL_VAR5="string1" ROUGAIL_VAR5="string1"
ROUGAIL_VAR6="string1" ROUGAIL_VAR6="string1"
ROUGAIL_VAR7="string1"
ROUGAIL_VAR8="string1"

View file

@ -4,7 +4,5 @@
"var3": "string1", "var3": "string1",
"var4": "string1", "var4": "string1",
"var5": "string1", "var5": "string1",
"var6": "string1", "var6": "string1"
"var7": "string1",
"var8": "string1"
} }

View file

@ -4,7 +4,5 @@
"var3": "string1", "var3": "string1",
"var4": "value", "var4": "value",
"var5": "value", "var5": "value",
"var6": "value", "var6": "value"
"var7": "8080",
"var8": "true"
} }

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,3 +0,0 @@
ROUGAIL_CONDITION="string1"
ROUGAIL_VARIABLE1="string1"
ROUGAIL_VARIABLE2="string1"

View file

@ -1,3 +0,0 @@
ROUGAIL_CONDITION="string1"
ROUGAIL_VARIABLE1="string1"
ROUGAIL_VARIABLE2="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL_VARIABLE1="string1"
ROUGAIL_VARIABLE2="string1"

View file

@ -1,4 +0,0 @@
{
"condition": "string1",
"variable1": "string1"
}

View file

@ -1,4 +0,0 @@
{
"condition": "no",
"variable1": "string1"
}

View file

@ -1,8 +1,8 @@
{ {
"errors": [], "errors": [],
"warnings": [ "warnings": [
"variable \"var1\" (a first variable) is hidden, it will be ignored when loading from environment variable",
"variable \"var2\" (a first variable) is hidden, it will be ignored when loading from environment variable", "variable \"var2\" (a first variable) is hidden, it will be ignored when loading from environment variable",
"variable \"var3\" (a second variable) is hidden, it will be ignored when loading from environment variable", "variable \"var3\" (a second variable) is hidden, it will be ignored when loading from environment variable"
"variable \"var4\" (a forth variable) is hidden, it will be ignored when loading from environment variable"
] ]
} }

View file

@ -2,4 +2,3 @@ ROUGAIL_CONDITION="True"
ROUGAIL_VAR1="string1" ROUGAIL_VAR1="string1"
ROUGAIL_VAR2="string1" ROUGAIL_VAR2="string1"
ROUGAIL_VAR3="string1" ROUGAIL_VAR3="string1"
ROUGAIL_VAR4="string1"

View file

@ -2,4 +2,3 @@ ROUGAIL_CONDITION="True"
ROUGAIL_VAR1="string1" ROUGAIL_VAR1="string1"
ROUGAIL_VAR2="string1" ROUGAIL_VAR2="string1"
ROUGAIL_VAR3="string1" ROUGAIL_VAR3="string1"
ROUGAIL_VAR4="string1"

View file

@ -1,6 +1,6 @@
{ {
"condition": true, "condition": true,
"var1": "string1", "var1": null,
"var2": null, "var2": null,
"var3": null, "var3": null,
"var4": null "var4": null

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"variable\" (a variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"variable\" (a variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1 +0,0 @@
ROUGAIL_VARIABLE="string1"

View file

@ -1,3 +0,0 @@
{
"condition": true
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"condition\" (a condition) is hidden, it will be ignored when loading from environment variable"
]
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1 +0,0 @@
ROUGAIL_VARIABLE="string1"

View file

@ -1,4 +0,0 @@
{
"condition": false,
"variable": "string1"
}

View file

@ -1,4 +0,0 @@
{
"condition": false,
"variable": "string1"
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"condition\" (a condition) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1 +0,0 @@
ROUGAIL_VARIABLE="string1"

View file

@ -1,3 +0,0 @@
{
"variable": "string1"
}

View file

@ -1,3 +0,0 @@
{
"variable": "string1"
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"variable\" (a variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1 +0,0 @@
ROUGAIL_VARIABLE="string1"

View file

@ -1,3 +0,0 @@
{
"condition": true
}

View file

@ -1,4 +0,0 @@
{
"condition": false,
"variable": "string1"
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1 +0,0 @@
ROUGAIL_VARIABLE="string1"

View file

@ -1,3 +0,0 @@
{
"condition": true
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"condition\" (a condition) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL_CONDITION="True"
ROUGAIL_VARIABLE="string1"

View file

@ -1 +0,0 @@
ROUGAIL_VARIABLE="string1"

View file

@ -1,3 +0,0 @@
{
"variable": "string1"
}

View file

@ -1,3 +0,0 @@
{
"variable": "string1"
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,2 +0,0 @@
ROUGAIL_MY_FAMILY.DYNAMIC="string1,string2,string3"
ROUGAIL_MY_FAMILY.VAR="True"

View file

@ -1,2 +0,0 @@
ROUGAIL_MY_FAMILY.DYNAMIC="string1,string2,string3"
ROUGAIL_MY_FAMILY.VAR="True"

View file

@ -1,8 +0,0 @@
{
"my_family.dynamic": [
"string1",
"string2",
"string3"
],
"my_family.var": true
}

View file

@ -1,7 +0,0 @@
{
"my_family.dynamic": [
"val1",
"val2"
],
"my_family.var": true
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1,4 +0,0 @@
{
"errors": [],
"warnings": []
}

View file

@ -1 +0,0 @@
ROUGAIL_MY_FAMILY.DEFAULT="True"

View file

@ -1 +0,0 @@
ROUGAIL_MY_FAMILY.DEFAULT="True"

View file

@ -1,3 +0,0 @@
{
"my_family.default": true
}

View file

@ -1,3 +0,0 @@
{
"my_family.default": true
}

View file

@ -4,5 +4,3 @@ ROUGAIL.VAR3="string1"
ROUGAIL.VAR4="string1" ROUGAIL.VAR4="string1"
ROUGAIL.VAR5="string1" ROUGAIL.VAR5="string1"
ROUGAIL.VAR6="string1" ROUGAIL.VAR6="string1"
ROUGAIL.VAR7="string1"
ROUGAIL.VAR8="string1"

View file

@ -4,5 +4,3 @@ ROUGAIL.VAR3="string1"
ROUGAIL.VAR4="string1" ROUGAIL.VAR4="string1"
ROUGAIL.VAR5="string1" ROUGAIL.VAR5="string1"
ROUGAIL.VAR6="string1" ROUGAIL.VAR6="string1"
ROUGAIL.VAR7="string1"
ROUGAIL.VAR8="string1"

View file

@ -4,7 +4,5 @@
"rougail.var3": "string1", "rougail.var3": "string1",
"rougail.var4": "string1", "rougail.var4": "string1",
"rougail.var5": "string1", "rougail.var5": "string1",
"rougail.var6": "string1", "rougail.var6": "string1"
"rougail.var7": "string1",
"rougail.var8": "string1"
} }

View file

@ -4,7 +4,5 @@
"rougail.var3": "string1", "rougail.var3": "string1",
"rougail.var4": "value", "rougail.var4": "value",
"rougail.var5": "value", "rougail.var5": "value",
"rougail.var6": "value", "rougail.var6": "value"
"rougail.var7": "8080",
"rougail.var8": "true"
} }

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"rougail.variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"rougail.variable2\" (a seconde variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,3 +0,0 @@
ROUGAIL.CONDITION="string1"
ROUGAIL.VARIABLE1="string1"
ROUGAIL.VARIABLE2="string1"

View file

@ -1,3 +0,0 @@
ROUGAIL.CONDITION="string1"
ROUGAIL.VARIABLE1="string1"
ROUGAIL.VARIABLE2="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL.VARIABLE1="string1"
ROUGAIL.VARIABLE2="string1"

View file

@ -1,4 +0,0 @@
{
"rougail.condition": "string1",
"rougail.variable1": "string1"
}

View file

@ -1,4 +0,0 @@
{
"rougail.condition": "no",
"rougail.variable1": "string1"
}

View file

@ -1,8 +1,8 @@
{ {
"errors": [], "errors": [],
"warnings": [ "warnings": [
"variable \"rougail.var1\" (a first variable) is hidden, it will be ignored when loading from environment variable",
"variable \"rougail.var2\" (a first variable) is hidden, it will be ignored when loading from environment variable", "variable \"rougail.var2\" (a first variable) is hidden, it will be ignored when loading from environment variable",
"variable \"rougail.var3\" (a second variable) is hidden, it will be ignored when loading from environment variable", "variable \"rougail.var3\" (a second variable) is hidden, it will be ignored when loading from environment variable"
"variable \"rougail.var4\" (a forth variable) is hidden, it will be ignored when loading from environment variable"
] ]
} }

View file

@ -2,4 +2,3 @@ ROUGAIL.CONDITION="True"
ROUGAIL.VAR1="string1" ROUGAIL.VAR1="string1"
ROUGAIL.VAR2="string1" ROUGAIL.VAR2="string1"
ROUGAIL.VAR3="string1" ROUGAIL.VAR3="string1"
ROUGAIL.VAR4="string1"

View file

@ -2,4 +2,3 @@ ROUGAIL.CONDITION="True"
ROUGAIL.VAR1="string1" ROUGAIL.VAR1="string1"
ROUGAIL.VAR2="string1" ROUGAIL.VAR2="string1"
ROUGAIL.VAR3="string1" ROUGAIL.VAR3="string1"
ROUGAIL.VAR4="string1"

View file

@ -1,6 +1,6 @@
{ {
"rougail.condition": true, "rougail.condition": true,
"rougail.var1": "string1", "rougail.var1": null,
"rougail.var2": null, "rougail.var2": null,
"rougail.var3": null, "rougail.var3": null,
"rougail.var4": null "rougail.var4": null

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"rougail.variable\" (a variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,6 +0,0 @@
{
"errors": [],
"warnings": [
"variable \"rougail.variable\" (a variable) is disabled, it will be ignored when loading from environment variable"
]
}

View file

@ -1,2 +0,0 @@
ROUGAIL.CONDITION="True"
ROUGAIL.VARIABLE="string1"

View file

@ -1,2 +0,0 @@
ROUGAIL.CONDITION="True"
ROUGAIL.VARIABLE="string1"

Some files were not shown because too many files have changed in this diff Show more