python-simpleconf 0.9.4__tar.gz → 0.9.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/Makefile +1 -1
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/PKG-INFO +13 -1
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/README.md +12 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/docs/CHANGELOG.md +5 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/__init__.py +1 -1
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/utils.py +5 -1
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.coveragerc +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.github/workflows/build.yml +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.gitignore +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.pre-commit-config.yaml +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/LICENSE +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/pyproject.toml +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/setup.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/caster.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/config.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/exceptions.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/__init__.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/dict.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/env.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/ini.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/json.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/osenv.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/toml.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/yaml.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/py.typed +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/__init__.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/fixt_simpleconf.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_caster.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_config.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_loaders.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_utils.py +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tox.ini +0 -0
- {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/uv.lock +0 -0
|
@@ -22,7 +22,7 @@ version:
|
|
|
22
22
|
fi; \
|
|
23
23
|
if [ -n "$$COMMITS" ]; then \
|
|
24
24
|
printf "\n## %s\n\n%s\n\n" "$$NEW_VERSION" "$$COMMITS" | cat - <(tail -n +3 docs/CHANGELOG.md) > docs/CHANGELOG.md.tmp; \
|
|
25
|
-
head -n
|
|
25
|
+
head -n 1 docs/CHANGELOG.md > docs/CHANGELOG.md.new; \
|
|
26
26
|
cat docs/CHANGELOG.md.tmp >> docs/CHANGELOG.md.new; \
|
|
27
27
|
mv docs/CHANGELOG.md.new docs/CHANGELOG.md; \
|
|
28
28
|
rm -f docs/CHANGELOG.md.tmp; \
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-simpleconf
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.5
|
|
4
4
|
Summary: Simple configuration management with python.
|
|
5
5
|
Project-URL: Homepage, https://github.com/pwwang/simpleconf
|
|
6
6
|
Project-URL: Repository, https://github.com/pwwang/simpleconf
|
|
@@ -404,6 +404,18 @@ conf = Config.load('config.yaml')
|
|
|
404
404
|
|
|
405
405
|
#### Loadenv directive
|
|
406
406
|
|
|
407
|
+
You will need `python-dotenv` installed to use the `loadenv` directive. You can install it with:
|
|
408
|
+
|
|
409
|
+
```shell
|
|
410
|
+
pip install python-simpleconf[toml,env]
|
|
411
|
+
```
|
|
412
|
+
if you only need TOML and dotenv support, or
|
|
413
|
+
|
|
414
|
+
```shell
|
|
415
|
+
pip install python-simpleconf[all]
|
|
416
|
+
```
|
|
417
|
+
if you want all supported formats.
|
|
418
|
+
|
|
407
419
|
You can also embed a `# simpleconf-loadenv` directive in the first few lines of a configuration file to load environment variables from a `.env` file. This allows you to reference environment variables directly in your config values using `$env:VAR` syntax, and makes them available as `env` in Jinja2/Liquid templates via `{{ env.VAR }}` or `{{ env["VAR"] }}`.
|
|
408
420
|
|
|
409
421
|
The directive format is:
|
|
@@ -367,6 +367,18 @@ conf = Config.load('config.yaml')
|
|
|
367
367
|
|
|
368
368
|
#### Loadenv directive
|
|
369
369
|
|
|
370
|
+
You will need `python-dotenv` installed to use the `loadenv` directive. You can install it with:
|
|
371
|
+
|
|
372
|
+
```shell
|
|
373
|
+
pip install python-simpleconf[toml,env]
|
|
374
|
+
```
|
|
375
|
+
if you only need TOML and dotenv support, or
|
|
376
|
+
|
|
377
|
+
```shell
|
|
378
|
+
pip install python-simpleconf[all]
|
|
379
|
+
```
|
|
380
|
+
if you want all supported formats.
|
|
381
|
+
|
|
370
382
|
You can also embed a `# simpleconf-loadenv` directive in the first few lines of a configuration file to load environment variables from a `.env` file. This allows you to reference environment variables directly in your config values using `$env:VAR` syntax, and makes them available as `env` in Jinja2/Liquid templates via `{{ env.VAR }}` or `{{ env["VAR"] }}`.
|
|
371
383
|
|
|
372
384
|
The directive format is:
|
|
@@ -38,7 +38,11 @@ def _read_first_lines(conf: Any) -> List[str]:
|
|
|
38
38
|
return []
|
|
39
39
|
|
|
40
40
|
path = Path(conf)
|
|
41
|
-
|
|
41
|
+
try:
|
|
42
|
+
if not path.exists():
|
|
43
|
+
return []
|
|
44
|
+
except Exception: # pragma: no cover
|
|
45
|
+
# e.g. OSError: Filename too long
|
|
42
46
|
return []
|
|
43
47
|
|
|
44
48
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|