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.
Files changed (33) hide show
  1. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/Makefile +1 -1
  2. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/PKG-INFO +13 -1
  3. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/README.md +12 -0
  4. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/docs/CHANGELOG.md +5 -0
  5. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/__init__.py +1 -1
  6. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/utils.py +5 -1
  7. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.coveragerc +0 -0
  8. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.github/workflows/build.yml +0 -0
  9. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.gitignore +0 -0
  10. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/.pre-commit-config.yaml +0 -0
  11. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/LICENSE +0 -0
  12. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/pyproject.toml +0 -0
  13. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/setup.py +0 -0
  14. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/caster.py +0 -0
  15. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/config.py +0 -0
  16. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/exceptions.py +0 -0
  17. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/__init__.py +0 -0
  18. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/dict.py +0 -0
  19. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/env.py +0 -0
  20. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/ini.py +0 -0
  21. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/json.py +0 -0
  22. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/osenv.py +0 -0
  23. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/toml.py +0 -0
  24. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/loaders/yaml.py +0 -0
  25. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/simpleconf/py.typed +0 -0
  26. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/__init__.py +0 -0
  27. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/fixt_simpleconf.py +0 -0
  28. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_caster.py +0 -0
  29. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_config.py +0 -0
  30. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_loaders.py +0 -0
  31. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tests/test_utils.py +0 -0
  32. {python_simpleconf-0.9.4 → python_simpleconf-0.9.5}/tox.ini +0 -0
  33. {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 2 docs/CHANGELOG.md > docs/CHANGELOG.md.new; \
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.4
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:
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.9.5
4
+
5
+ - fix: fix error for _read_first_lines when file name is too long
6
+ - docs: update README to include installation instructions for loadenv directive
7
+
3
8
  ## 0.9.4
4
9
 
5
10
  - test: skip loadenv directive test on non-Linux platforms
@@ -2,4 +2,4 @@ from .config import Config, ProfileConfig
2
2
 
3
3
  __all__ = ["Config", "ProfileConfig"]
4
4
 
5
- __version__ = "0.9.4"
5
+ __version__ = "0.9.5"
@@ -38,7 +38,11 @@ def _read_first_lines(conf: Any) -> List[str]:
38
38
  return []
39
39
 
40
40
  path = Path(conf)
41
- if not path.exists():
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: