--- Begin Message ---
Package: release.debian.org
Severity: normal
X-Debbugs-Cc: pyyaml-env-...@packages.debian.org
Control: affects -1 + src:pyyaml-env-tag
User: release.debian....@packages.debian.org
Usertags: unblock
Please unblock package pyyaml-env-tag
[ Reason ]
pyyaml-env-tag is marked as key package so it needs besides the
successful autopkgtests an unblock ack by the RT.
[ Impact ]
There are no fundamental changes in the usptream source within the
Python library itself, even it version did get bumped from 0.1 to 1.1.
Users would not by able to use the latest modifications done to the
source. Or could not use other packages that might require a version
higher than 1.0 over the lifetime of the Trixie release, e.g. by
backported packages.
Main change in upstream version 1.0 was an added function
add_env_tag() as an higher level way to modify the loader.
[ Tests ]
The package comes with a setup for autopkgtests which did succesful
passed in the passed but also with the current version 1.1-1.
[ Risks ]
The risks are going nearly zero as the code changes in the library are
very small.
[ Checklist ]
[x] all changes are documented in the d/changelog
[x] I reviewed all changes and I approve them
[x] attach debdiff against the package in testing
(Truncated about the irrelevant changes in the upstream folder
.github which don't have any effect while package build.)
[ Other info ]
Upstream did not provide tagged releases on GitHub at time this library
did get packaged for Debian but did develop the library since then, thus
it looks like from a first POV as a major change did happen to this
library since the version that is currently in testing.
The main changes upstream did are so far:
* Moved the buld system from setuptool to hatchling
* The test file di get moved into a new folder tests/
* Added some GitHub workflow files
unblock pyyaml-env-tag/1.1-1
diff -Nru pyyaml-env-tag-0.1/debian/changelog
pyyaml-env-tag-1.1/debian/changelog
--- pyyaml-env-tag-0.1/debian/changelog 2022-02-27 08:51:31.000000000 +0200
+++ pyyaml-env-tag-1.1/debian/changelog 2025-05-25 10:36:13.000000000 +0200
@@ -1,3 +1,22 @@
+pyyaml-env-tag (1.1-1) unstable; urgency=medium
+
+ * [94c7771] d/watch: Add compression and ignore PGP signature
+ * [7998fd6] New upstream version 1.1
+ * [b679293] d/control: Bump Standards-Version to 4.7.2
+ No further changes needed.
+ * [a684c26] d/control: Switch build system flit to setuptools
+ * [a71d5c1] d/rules: Drop variable PYBUILD_SYSTEM
+ It's already set to this value due usage of dh-sequencer-python3.
+ * [98ba423] d/rules: Drop --with option in default target
+ Also not needed due using dh-sequencer-python3.
+ * [9653272] d/*: Running wrap-and-sort -ast
+ * [3301ae8] d/rules: Adjust dh_auto_test setting of test file
+ Upstream moved the used Python test script, we need to adopt this.
+ * [c5c28ef] autopkgtest: Adjust smoke script due upstream changes
+ * [5c98fdc] d/copyright: Update year and content data
+
+ -- Carsten Schoenert <c.schoen...@t-online.de> Sun, 25 May 2025 10:36:13
+0200
+
pyyaml-env-tag (0.1-3) unstable; urgency=medium
* [834b0c5] d/control: Add python3-yaml to B-D
diff -Nru pyyaml-env-tag-0.1/debian/control pyyaml-env-tag-1.1/debian/control
--- pyyaml-env-tag-0.1/debian/control 2022-02-27 08:51:31.000000000 +0200
+++ pyyaml-env-tag-1.1/debian/control 2025-05-25 10:36:13.000000000 +0200
@@ -6,15 +6,13 @@
Priority: optional
Build-Depends:
debhelper-compat (= 13),
- python3-all,
-Build-Depends-Indep:
- dh-python,
- flit,
+ dh-sequence-python3,
pybuild-plugin-pyproject,
- python3-poetry,
+ python3-all,
+ python3-setuptools,
python3-yaml,
Rules-Requires-Root: no
-Standards-Version: 4.6.0
+Standards-Version: 4.7.2
Vcs-Browser: https://salsa.debian.org/python-team/packages/pyyamel-env-tag
Vcs-Git: https://salsa.debian.org/python-team/packages/pyyamel-env-tag.git
Homepage: https://github.com/waylan/pyyaml-env-tag
diff -Nru pyyaml-env-tag-0.1/debian/copyright
pyyaml-env-tag-1.1/debian/copyright
--- pyyaml-env-tag-0.1/debian/copyright 2022-02-27 08:51:31.000000000 +0200
+++ pyyaml-env-tag-1.1/debian/copyright 2025-05-25 10:36:13.000000000 +0200
@@ -8,15 +8,9 @@
License: MIT
Files: debian/*
-Copyright: 2022, Carsten Schoenert <c.schoen...@t-online.de>
+Copyright: 2022-2025, Carsten Schoenert <c.schoen...@t-online.de>
License: MIT
-Files: debian/tests/test_yaml_env_tag.py
-Copyright: Waylan Limberg <waylan.limb...@icloud.com>
-License: MIT
-Comment: This file is was taken from the upstream source to get the tests
- usable within autopkgtest.
-
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -30,7 +24,7 @@
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
diff -Nru pyyaml-env-tag-0.1/debian/rules pyyaml-env-tag-1.1/debian/rules
--- pyyaml-env-tag-0.1/debian/rules 2022-02-27 08:51:31.000000000 +0200
+++ pyyaml-env-tag-1.1/debian/rules 2025-05-25 10:36:13.000000000 +0200
@@ -4,12 +4,11 @@
#export DH_VERBOSE = 1
export PYBUILD_NAME=yaml_env_tag
-export PYBUILD_SYSTEM=pyproject
%:
- dh $@ --with python3 --buildsystem=pybuild
+ dh $@ --buildsystem=pybuild
override_dh_auto_test:
dh_auto_test -- --system=custom --test-args='cd {build_dir} && \
python3 --version && \
- python3 $(CURDIR)/test_yaml_env_tag.py'
+ python3 $(CURDIR)/tests/test_yaml_env_tag.py'
diff -Nru pyyaml-env-tag-0.1/debian/tests/control
pyyaml-env-tag-1.1/debian/tests/control
--- pyyaml-env-tag-0.1/debian/tests/control 2022-02-27 08:51:31.000000000
+0200
+++ pyyaml-env-tag-1.1/debian/tests/control 2025-05-25 10:36:13.000000000
+0200
@@ -1,5 +1,7 @@
-Tests: smoke
+Tests:
+ smoke,
Depends:
python3-all,
@,
-Restrictions: allow-stderr
+Restrictions:
+ allow-stderr,
diff -Nru pyyaml-env-tag-0.1/debian/tests/smoke
pyyaml-env-tag-1.1/debian/tests/smoke
--- pyyaml-env-tag-0.1/debian/tests/smoke 2022-02-27 08:51:31.000000000
+0200
+++ pyyaml-env-tag-1.1/debian/tests/smoke 2025-05-25 10:36:13.000000000
+0200
@@ -1,7 +1,7 @@
#!/bin/sh
set -e -u
-cp -a test_yaml_env_tag.py "${AUTOPKGTEST_TMP}"
+cp -a tests/test_yaml_env_tag.py "${AUTOPKGTEST_TMP}"
for py3vers in $(py3versions -s); do
echo
diff -Nru pyyaml-env-tag-0.1/debian/tests/test_yaml_env_tag.py
pyyaml-env-tag-1.1/debian/tests/test_yaml_env_tag.py
--- pyyaml-env-tag-0.1/debian/tests/test_yaml_env_tag.py 2022-02-27
08:51:31.000000000 +0200
+++ pyyaml-env-tag-1.1/debian/tests/test_yaml_env_tag.py 1970-01-01
02:00:00.000000000 +0200
@@ -1,331 +0,0 @@
-import os
-import yaml
-import datetime
-import unittest
-from unittest import mock
-from yaml_env_tag import construct_env_tag
-
-def mockenv(**kwargs):
- ''' Decorator to mock os.environ with provided variables. '''
- return mock.patch.dict(os.environ, kwargs)
-
-
-class TestYamlEnvTag(unittest.TestCase):
-
- def assertYamlLoad(self, data, expected, loader=yaml.Loader):
- loader.add_constructor('!ENV', construct_env_tag)
- self.assertEqual(expected, yaml.load(data, Loader=loader))
-
- @mockenv(VAR='foo')
- def test_scalar(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'foo'
- )
-
- def test_scalar_undefined(self):
- self.assertYamlLoad(
- '!ENV VAR',
- None
- )
-
- @mockenv(VAR='foo')
- def test_safe_loader(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'foo',
- yaml.SafeLoader
- )
-
- @mockenv(VAR='foo')
- def test_scalar_in_squence(self):
- self.assertYamlLoad(
- '- !ENV VAR',
- ['foo']
- )
-
- @mockenv(VAR='foo')
- def test_scalar_in_mapping(self):
- self.assertYamlLoad(
- 'key: !ENV VAR',
- {'key': 'foo'}
- )
-
- @mockenv(VAR='foo')
- def test_sequence_1(self):
- self.assertYamlLoad(
- '!ENV [VAR]',
- 'foo'
- )
-
- def test_sequence_1_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR]',
- None
- )
-
- @mockenv(VAR='foo')
- def test_sequence_2(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- 'foo'
- )
-
- def test_sequence_2_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- 'default'
- )
-
- @mockenv(VAR1='foo', VAR2='bar')
- def test_sequence_3(self):
- self.assertYamlLoad(
- '!ENV [VAR1, VAR2, default]',
- 'foo'
- )
-
- @mockenv(VAR2='bar')
- def test_sequence_3_1_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR1, VAR2, default]',
- 'bar'
- )
-
- def test_sequence_3_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR1, VAR2, default]',
- 'default'
- )
-
- def test_default_type_null(self):
- self.assertYamlLoad(
- '!ENV [VAR, null]',
- None
- )
-
- def test_default_type_tilde(self):
- self.assertYamlLoad(
- '!ENV [VAR, ~]',
- None
- )
-
- def test_default_type_bool_false(self):
- self.assertYamlLoad(
- '!ENV [VAR, false]',
- False
- )
-
- def test_default_type_bool_true(self):
- self.assertYamlLoad(
- '!ENV [VAR, true]',
- True
- )
-
- def test_default_type_str(self):
- self.assertYamlLoad(
- '!ENV [VAR, "a string"]',
- 'a string'
- )
-
- def test_default_type_int(self):
- self.assertYamlLoad(
- '!ENV [VAR, 42]',
- 42
- )
-
- def test_default_type_float(self):
- self.assertYamlLoad(
- '!ENV [VAR, 3.14]',
- 3.14
- )
-
- def test_default_type_date(self):
- self.assertYamlLoad(
- '!ENV [VAR, 2020-11-11]',
- datetime.date(2020, 11, 11)
- )
-
- def test_default_type_sequence(self):
- self.assertYamlLoad(
- '!ENV [VAR, [foo, bar]]',
- ['foo', 'bar']
- )
-
- def test_default_type_mapping(self):
- self.assertYamlLoad(
- '!ENV [VAR, foo: bar]',
- {'foo': 'bar'}
- )
-
- @mockenv(VAR='null')
- def test_env_value_type_null(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- None
- )
-
- @mockenv(VAR='~')
- def test_env_value_type_tilde(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- None
- )
-
- @mockenv(VAR='false')
- def test_env_value_type_bool_false(self):
- self.assertYamlLoad(
- '!ENV VAR',
- False
- )
-
- @mockenv(VAR='true')
- def test_env_value_type_bool_true(self):
- self.assertYamlLoad(
- '!ENV VAR',
- True
- )
-
- @mockenv(VAR='a string')
- def test_env_value_type_str(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'a string'
- )
-
- @mockenv(VAR='42')
- def test_env_value_type_int(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 42
- )
-
- @mockenv(VAR='3.14')
- def test_env_value_type_float(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 3.14
- )
-
- @mockenv(VAR='2020-11-11')
- def test_env_value_type_date(self):
- self.assertYamlLoad(
- '!ENV VAR',
- datetime.date(2020, 11, 11)
- )
-
- @mockenv(VAR='[foo, bar]')
- def test_env_value_type_sequence(self):
- self.assertYamlLoad(
- '!ENV VAR',
- '[foo, bar]'
- )
-
- @mockenv(VAR='foo: bar')
- def test_env_value_type_mapping(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'foo: bar'
- )
-
- @mockenv(UPPERCASE='foo')
- def test_env_name_uppercase(self):
- self.assertYamlLoad(
- '!ENV UPPERCASE',
- 'foo'
- )
-
- @mockenv(lowercase='foo')
- def test_env_name_lowercase(self):
- self.assertYamlLoad(
- '!ENV lowercase',
- 'foo'
- )
-
- @mockenv(CamelCase='foo')
- def test_env_name_CamelCase(self):
- self.assertYamlLoad(
- '!ENV CamelCase',
- 'foo'
- )
-
- @mockenv(snake_case='foo')
- def test_env_name_snake_case(self):
- self.assertYamlLoad(
- '!ENV snake_case',
- 'foo'
- )
-
- # WARNING! The Environment Variable names in the following tests are
- # probably a bad idea in use. In fact, it may not even be possable to
- # set them in most OSs. We are testing that they don't get converted
- # to native Python types, ensuring expected results in edge cases.
-
- @mockenv(null='foo')
- def test_env_name_null(self):
- self.assertYamlLoad(
- '!ENV null',
- 'foo'
- )
-
- @mockenv(**{'~': 'foo'})
- def test_env_name_tilde(self):
- self.assertYamlLoad(
- '!ENV ~',
- 'foo'
- )
-
- @mockenv(**{'true': 'foo'})
- def test_env_name_true(self):
- self.assertYamlLoad(
- '!ENV true',
- 'foo'
- )
-
- @mockenv(**{'false': 'foo'})
- def test_env_name_false(self):
- self.assertYamlLoad(
- '!ENV false',
- 'foo'
- )
-
- @mockenv(**{'42': 'foo'})
- def test_env_name_int(self):
- self.assertYamlLoad(
- '!ENV 42',
- 'foo'
- )
-
- @mockenv(**{'3.14': 'foo'})
- def test_env_name_float(self):
- self.assertYamlLoad(
- '!ENV 3.14',
- 'foo'
- )
-
- @mockenv(**{'2020-11-11': 'foo'})
- def test_env_name_date(self):
- self.assertYamlLoad(
- '!ENV 2020-11-11',
- 'foo'
- )
-
- def test_env_name_sequance(self):
- yaml.Loader.add_constructor('!ENV', construct_env_tag)
- self.assertRaises(
- yaml.constructor.ConstructorError,
- yaml.load,
- '!ENV [[foo]]',
- Loader=yaml.Loader
- )
-
- def test_env_name_mapping(self):
- yaml.Loader.add_constructor('!ENV', construct_env_tag)
- self.assertRaises(
- yaml.constructor.ConstructorError,
- yaml.load,
- '!ENV {key: value}',
- Loader=yaml.Loader
- )
-
-if __name__ == '__main__':
- unittest.main()
diff -Nru pyyaml-env-tag-0.1/debian/watch pyyaml-env-tag-1.1/debian/watch
--- pyyaml-env-tag-0.1/debian/watch 2022-02-27 08:51:31.000000000 +0200
+++ pyyaml-env-tag-1.1/debian/watch 2025-05-25 10:36:13.000000000 +0200
@@ -3,6 +3,8 @@
version=4
opts="mode=git, \
+ compression=gz, \
+ pgpmode=none, \
uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\.?\d*)$/$1~$2/, \
dversionmangle=s/\+ds(\.?\d+)?$//" \
https://github.com/waylan/pyyaml-env-tag.git \
diff -Nru pyyaml-env-tag-0.1/PKG-INFO pyyaml-env-tag-1.1/PKG-INFO
--- pyyaml-env-tag-0.1/PKG-INFO 1970-01-01 02:00:00.000000000 +0200
+++ pyyaml-env-tag-1.1/PKG-INFO 1970-01-01 02:00:00.000000000 +0200
@@ -1,7 +0,0 @@
-Metadata-Version: 1.1
-Name: pyyaml_env_tag
-Version: 0.1
-Summary: A custom YAML tag for referencing environment variables in YAML
files.
-Home-page: https://github.com/waylan/pyyaml-env-tag
-Author: Waylan Limberg
-Author-email: waylan.limb...@icloud.com
diff -Nru pyyaml-env-tag-0.1/pyproject.toml pyyaml-env-tag-1.1/pyproject.toml
--- pyyaml-env-tag-0.1/pyproject.toml 2020-11-12 04:17:40.000000000 +0200
+++ pyyaml-env-tag-1.1/pyproject.toml 2025-05-13 17:22:05.000000000 +0200
@@ -1,26 +1,38 @@
[build-system]
-requires = ["flit_core >=2,<4"]
-build-backend = "flit_core.buildapi"
+requires = ['setuptools>=77.0']
+build-backend = 'setuptools.build_meta'
-[tool.flit.metadata]
-dist-name = "pyyaml_env_tag"
-module = "yaml_env_tag"
-author = "Waylan Limberg"
-author-email = "waylan.limb...@icloud.com"
-home-page = "https://github.com/waylan/pyyaml-env-tag"
-description-file = "README.md"
-requires-python = ">=3.6"
-requires = ["pyyaml"]
+[project]
+name = 'pyyaml_env_tag'
+dynamic = ['version']
+description = 'A custom YAML tag for referencing environment variables in YAML
files.'
+readme = {file = 'README.md', content-type='text/markdown'}
+authors = [{name = 'Waylan Limberg', email = 'waylan.limb...@icloud.com'}]
+requires-python = '>=3.9'
+dependencies = ['pyyaml']
+license = 'MIT'
+license-files = ['LICENSE']
classifiers = [
- 'License :: OSI Approved :: MIT License',
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
+ 'Programming Language :: Python :: 3.11',
+ 'Programming Language :: Python :: 3.12',
+ 'Programming Language :: Python :: 3.13',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Markup',
]
+
+[project.urls]
+Homepage = 'https://github.com/waylan/pyyaml-env-tag'
+Repository = 'https://github.com/waylan/pyyaml-env-tag'
+'Bug Tracker' = 'https://github.com/waylan/pyyaml-env-tag/issues'
+
+[tool.setuptools]
+py-modules = ['yaml_env_tag']
+
+[tool.setuptools.dynamic]
+version = {attr = 'yaml_env_tag.__version__'}
diff -Nru pyyaml-env-tag-0.1/README.md pyyaml-env-tag-1.1/README.md
--- pyyaml-env-tag-0.1/README.md 2020-11-12 04:00:50.000000000 +0200
+++ pyyaml-env-tag-1.1/README.md 2025-05-13 17:22:05.000000000 +0200
@@ -2,30 +2,52 @@
A custom YAML tag for referencing environment variables in YAML files.
+[![PyPI Version][pypi-image]][pypi-link]
+[![Build Status][GHAction-image]][GHAction-link]
+[![Coverage Status][codecov-image]][codecov-link]
+
+[pypi-image]: https://img.shields.io/pypi/v/pyyaml-env-tag.svg
+[pypi-link]: https://pypi.org/project/pyyaml-env-tag/
+[GHAction-image]:
https://github.com/waylan/pyyaml-env-tag/workflows/CI/badge.svg?branch=master&event=push
+[GHAction-link]:
https://github.com/waylan/pyyaml-env-tag/actions?query=event%3Apush+branch%3Amaster
+[codecov-image]:
https://codecov.io/github/waylan/pyyaml-env-tag/coverage.svg?branch=master
+[codecov-link]: https://codecov.io/github/waylan/pyyaml-env-tag?branch=master
+
## Installation
-Install `PyYAML` and the `pyyaml_env_tag` package with pip:
+Install the `pyyaml_env_tag` package with pip:
```bash
-pip install pyyaml pyyaml_env_tag
+pip install pyyaml_env_tag
```
### Enabling the tag
-To enable the tag, import and add the `construct_env_tag` constructor to your
YAML
-loader of choice.
+To enable the tag, pass your loader of choice into the `add_env_tag` function,
which will
+return the loader with the construstor added to it.
```python
import yaml
-from yaml_env_tag import construct_env_tag
+from yaml_env_tag import add_env_tag
-yaml.Loader.add_constructor('!ENV', construct_env_tag)
+myLoader = add_env_tag(yaml.Loader)
```
Then you may use the loader as per usual. For example:
```python
-yaml.load(data, Loader=yaml.Loader)
+yaml.load(data, Loader=myLoader)
+```
+
+The `add_env_tag` is a high level helper function. If you need lower level
access, you may
+add the constructor (`yaml_env_tag.construct_env_tag`) to the loader directly
using the
+`add_constructor` method of the loader. Note that this requires that the tag
(`!ENV`) be
+defined as well.
+
+```python
+from yaml_env_tag import construct_env_tag
+
+Loader.add_constructor('!ENV', construct_env_tag)
```
## Using the tag
@@ -111,6 +133,14 @@
## Changelog
-### Version 0.1 (released 2020-11-11)
+### [1.1] - 2025-05-13
+
+- Ensure tests get included with distribution (#9).
+
+### [1.0] - 2025-05-09
+
+- Add the `add_env_tag` helper function as a higher level way of modifying the
loader.
+
+### [0.1] - 2020-11-11
The initial release.
diff -Nru pyyaml-env-tag-0.1/setup.py pyyaml-env-tag-1.1/setup.py
--- pyyaml-env-tag-0.1/setup.py 1970-01-01 02:00:00.000000000 +0200
+++ pyyaml-env-tag-1.1/setup.py 1970-01-01 02:00:00.000000000 +0200
@@ -1,18 +0,0 @@
-#!/usr/bin/env python
-# setup.py generated by flit for tools that don't yet use PEP 517
-
-from distutils.core import setup
-
-install_requires = \
-['pyyaml']
-
-setup(name='pyyaml_env_tag',
- version='0.1',
- description='A custom YAML tag for referencing environment variables in
YAML files. ',
- author='Waylan Limberg',
- author_email='waylan.limb...@icloud.com',
- url='https://github.com/waylan/pyyaml-env-tag',
- py_modules=['yaml_env_tag'],
- install_requires=install_requires,
- python_requires='>=3.6',
- )
diff -Nru pyyaml-env-tag-0.1/tests/test_yaml_env_tag.py
pyyaml-env-tag-1.1/tests/test_yaml_env_tag.py
--- pyyaml-env-tag-0.1/tests/test_yaml_env_tag.py 1970-01-01
02:00:00.000000000 +0200
+++ pyyaml-env-tag-1.1/tests/test_yaml_env_tag.py 2025-05-13
17:22:05.000000000 +0200
@@ -0,0 +1,330 @@
+import os
+import yaml
+import datetime
+import unittest
+from unittest import mock
+from yaml_env_tag import add_env_tag
+
+
+def mockenv(**kwargs):
+ ''' Decorator to mock os.environ with provided variables. '''
+ return mock.patch.dict(os.environ, kwargs)
+
+
+class TestYamlEnvTag(unittest.TestCase):
+
+ def assertYamlLoad(self, data, expected, loader=yaml.Loader):
+ self.assertEqual(expected, yaml.load(data, Loader=add_env_tag(loader)))
+
+ @mockenv(VAR='foo')
+ def test_scalar(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ 'foo'
+ )
+
+ def test_scalar_undefined(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ None
+ )
+
+ @mockenv(VAR='foo')
+ def test_safe_loader(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ 'foo',
+ yaml.SafeLoader
+ )
+
+ @mockenv(VAR='foo')
+ def test_scalar_in_squence(self):
+ self.assertYamlLoad(
+ '- !ENV VAR',
+ ['foo']
+ )
+
+ @mockenv(VAR='foo')
+ def test_scalar_in_mapping(self):
+ self.assertYamlLoad(
+ 'key: !ENV VAR',
+ {'key': 'foo'}
+ )
+
+ @mockenv(VAR='foo')
+ def test_sequence_1(self):
+ self.assertYamlLoad(
+ '!ENV [VAR]',
+ 'foo'
+ )
+
+ def test_sequence_1_undefined(self):
+ self.assertYamlLoad(
+ '!ENV [VAR]',
+ None
+ )
+
+ @mockenv(VAR='foo')
+ def test_sequence_2(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, default]',
+ 'foo'
+ )
+
+ def test_sequence_2_undefined(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, default]',
+ 'default'
+ )
+
+ @mockenv(VAR1='foo', VAR2='bar')
+ def test_sequence_3(self):
+ self.assertYamlLoad(
+ '!ENV [VAR1, VAR2, default]',
+ 'foo'
+ )
+
+ @mockenv(VAR2='bar')
+ def test_sequence_3_1_undefined(self):
+ self.assertYamlLoad(
+ '!ENV [VAR1, VAR2, default]',
+ 'bar'
+ )
+
+ def test_sequence_3_undefined(self):
+ self.assertYamlLoad(
+ '!ENV [VAR1, VAR2, default]',
+ 'default'
+ )
+
+ def test_default_type_null(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, null]',
+ None
+ )
+
+ def test_default_type_tilde(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, ~]',
+ None
+ )
+
+ def test_default_type_bool_false(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, false]',
+ False
+ )
+
+ def test_default_type_bool_true(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, true]',
+ True
+ )
+
+ def test_default_type_str(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, "a string"]',
+ 'a string'
+ )
+
+ def test_default_type_int(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, 42]',
+ 42
+ )
+
+ def test_default_type_float(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, 3.14]',
+ 3.14
+ )
+
+ def test_default_type_date(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, 2020-11-11]',
+ datetime.date(2020, 11, 11)
+ )
+
+ def test_default_type_sequence(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, [foo, bar]]',
+ ['foo', 'bar']
+ )
+
+ def test_default_type_mapping(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, foo: bar]',
+ {'foo': 'bar'}
+ )
+
+ @mockenv(VAR='null')
+ def test_env_value_type_null(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, default]',
+ None
+ )
+
+ @mockenv(VAR='~')
+ def test_env_value_type_tilde(self):
+ self.assertYamlLoad(
+ '!ENV [VAR, default]',
+ None
+ )
+
+ @mockenv(VAR='false')
+ def test_env_value_type_bool_false(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ False
+ )
+
+ @mockenv(VAR='true')
+ def test_env_value_type_bool_true(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ True
+ )
+
+ @mockenv(VAR='a string')
+ def test_env_value_type_str(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ 'a string'
+ )
+
+ @mockenv(VAR='42')
+ def test_env_value_type_int(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ 42
+ )
+
+ @mockenv(VAR='3.14')
+ def test_env_value_type_float(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ 3.14
+ )
+
+ @mockenv(VAR='2020-11-11')
+ def test_env_value_type_date(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ datetime.date(2020, 11, 11)
+ )
+
+ @mockenv(VAR='[foo, bar]')
+ def test_env_value_type_sequence(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ '[foo, bar]'
+ )
+
+ @mockenv(VAR='foo: bar')
+ def test_env_value_type_mapping(self):
+ self.assertYamlLoad(
+ '!ENV VAR',
+ 'foo: bar'
+ )
+
+ @mockenv(UPPERCASE='foo')
+ def test_env_name_uppercase(self):
+ self.assertYamlLoad(
+ '!ENV UPPERCASE',
+ 'foo'
+ )
+
+ @mockenv(lowercase='foo')
+ def test_env_name_lowercase(self):
+ self.assertYamlLoad(
+ '!ENV lowercase',
+ 'foo'
+ )
+
+ @mockenv(CamelCase='foo')
+ def test_env_name_CamelCase(self):
+ self.assertYamlLoad(
+ '!ENV CamelCase',
+ 'foo'
+ )
+
+ @mockenv(snake_case='foo')
+ def test_env_name_snake_case(self):
+ self.assertYamlLoad(
+ '!ENV snake_case',
+ 'foo'
+ )
+
+ # WARNING! The Environment Variable names in the following tests are
+ # probably a bad idea in use. In fact, it may not even be possable to
+ # set them in most OSs. We are testing that they don't get converted
+ # to native Python types, ensuring expected results in edge cases.
+
+ @mockenv(null='foo')
+ def test_env_name_null(self):
+ self.assertYamlLoad(
+ '!ENV null',
+ 'foo'
+ )
+
+ @mockenv(**{'~': 'foo'})
+ def test_env_name_tilde(self):
+ self.assertYamlLoad(
+ '!ENV ~',
+ 'foo'
+ )
+
+ @mockenv(**{'true': 'foo'})
+ def test_env_name_true(self):
+ self.assertYamlLoad(
+ '!ENV true',
+ 'foo'
+ )
+
+ @mockenv(**{'false': 'foo'})
+ def test_env_name_false(self):
+ self.assertYamlLoad(
+ '!ENV false',
+ 'foo'
+ )
+
+ @mockenv(**{'42': 'foo'})
+ def test_env_name_int(self):
+ self.assertYamlLoad(
+ '!ENV 42',
+ 'foo'
+ )
+
+ @mockenv(**{'3.14': 'foo'})
+ def test_env_name_float(self):
+ self.assertYamlLoad(
+ '!ENV 3.14',
+ 'foo'
+ )
+
+ @mockenv(**{'2020-11-11': 'foo'})
+ def test_env_name_date(self):
+ self.assertYamlLoad(
+ '!ENV 2020-11-11',
+ 'foo'
+ )
+
+ def test_env_name_sequance(self):
+ self.assertRaises(
+ yaml.constructor.ConstructorError,
+ yaml.load,
+ '!ENV [[foo]]',
+ Loader=add_env_tag(yaml.Loader)
+ )
+
+ def test_env_name_mapping(self):
+ self.assertRaises(
+ yaml.constructor.ConstructorError,
+ yaml.load,
+ '!ENV {key: value}',
+ Loader=add_env_tag(yaml.Loader)
+ )
+
+
+if __name__ == '__main__':
+ unittest.main()
diff -Nru pyyaml-env-tag-0.1/test_yaml_env_tag.py
pyyaml-env-tag-1.1/test_yaml_env_tag.py
--- pyyaml-env-tag-0.1/test_yaml_env_tag.py 2020-11-12 04:31:00.000000000
+0200
+++ pyyaml-env-tag-1.1/test_yaml_env_tag.py 1970-01-01 02:00:00.000000000
+0200
@@ -1,331 +0,0 @@
-import os
-import yaml
-import datetime
-import unittest
-from unittest import mock
-from yaml_env_tag import construct_env_tag
-
-def mockenv(**kwargs):
- ''' Decorator to mock os.environ with provided variables. '''
- return mock.patch.dict(os.environ, kwargs)
-
-
-class TestYamlEnvTag(unittest.TestCase):
-
- def assertYamlLoad(self, data, expected, loader=yaml.Loader):
- loader.add_constructor('!ENV', construct_env_tag)
- self.assertEqual(expected, yaml.load(data, Loader=loader))
-
- @mockenv(VAR='foo')
- def test_scalar(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'foo'
- )
-
- def test_scalar_undefined(self):
- self.assertYamlLoad(
- '!ENV VAR',
- None
- )
-
- @mockenv(VAR='foo')
- def test_safe_loader(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'foo',
- yaml.SafeLoader
- )
-
- @mockenv(VAR='foo')
- def test_scalar_in_squence(self):
- self.assertYamlLoad(
- '- !ENV VAR',
- ['foo']
- )
-
- @mockenv(VAR='foo')
- def test_scalar_in_mapping(self):
- self.assertYamlLoad(
- 'key: !ENV VAR',
- {'key': 'foo'}
- )
-
- @mockenv(VAR='foo')
- def test_sequence_1(self):
- self.assertYamlLoad(
- '!ENV [VAR]',
- 'foo'
- )
-
- def test_sequence_1_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR]',
- None
- )
-
- @mockenv(VAR='foo')
- def test_sequence_2(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- 'foo'
- )
-
- def test_sequence_2_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- 'default'
- )
-
- @mockenv(VAR1='foo', VAR2='bar')
- def test_sequence_3(self):
- self.assertYamlLoad(
- '!ENV [VAR1, VAR2, default]',
- 'foo'
- )
-
- @mockenv(VAR2='bar')
- def test_sequence_3_1_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR1, VAR2, default]',
- 'bar'
- )
-
- def test_sequence_3_undefined(self):
- self.assertYamlLoad(
- '!ENV [VAR1, VAR2, default]',
- 'default'
- )
-
- def test_default_type_null(self):
- self.assertYamlLoad(
- '!ENV [VAR, null]',
- None
- )
-
- def test_default_type_tilde(self):
- self.assertYamlLoad(
- '!ENV [VAR, ~]',
- None
- )
-
- def test_default_type_bool_false(self):
- self.assertYamlLoad(
- '!ENV [VAR, false]',
- False
- )
-
- def test_default_type_bool_true(self):
- self.assertYamlLoad(
- '!ENV [VAR, true]',
- True
- )
-
- def test_default_type_str(self):
- self.assertYamlLoad(
- '!ENV [VAR, "a string"]',
- 'a string'
- )
-
- def test_default_type_int(self):
- self.assertYamlLoad(
- '!ENV [VAR, 42]',
- 42
- )
-
- def test_default_type_float(self):
- self.assertYamlLoad(
- '!ENV [VAR, 3.14]',
- 3.14
- )
-
- def test_default_type_date(self):
- self.assertYamlLoad(
- '!ENV [VAR, 2020-11-11]',
- datetime.date(2020, 11, 11)
- )
-
- def test_default_type_sequence(self):
- self.assertYamlLoad(
- '!ENV [VAR, [foo, bar]]',
- ['foo', 'bar']
- )
-
- def test_default_type_mapping(self):
- self.assertYamlLoad(
- '!ENV [VAR, foo: bar]',
- {'foo': 'bar'}
- )
-
- @mockenv(VAR='null')
- def test_env_value_type_null(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- None
- )
-
- @mockenv(VAR='~')
- def test_env_value_type_tilde(self):
- self.assertYamlLoad(
- '!ENV [VAR, default]',
- None
- )
-
- @mockenv(VAR='false')
- def test_env_value_type_bool_false(self):
- self.assertYamlLoad(
- '!ENV VAR',
- False
- )
-
- @mockenv(VAR='true')
- def test_env_value_type_bool_true(self):
- self.assertYamlLoad(
- '!ENV VAR',
- True
- )
-
- @mockenv(VAR='a string')
- def test_env_value_type_str(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'a string'
- )
-
- @mockenv(VAR='42')
- def test_env_value_type_int(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 42
- )
-
- @mockenv(VAR='3.14')
- def test_env_value_type_float(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 3.14
- )
-
- @mockenv(VAR='2020-11-11')
- def test_env_value_type_date(self):
- self.assertYamlLoad(
- '!ENV VAR',
- datetime.date(2020, 11, 11)
- )
-
- @mockenv(VAR='[foo, bar]')
- def test_env_value_type_sequence(self):
- self.assertYamlLoad(
- '!ENV VAR',
- '[foo, bar]'
- )
-
- @mockenv(VAR='foo: bar')
- def test_env_value_type_mapping(self):
- self.assertYamlLoad(
- '!ENV VAR',
- 'foo: bar'
- )
-
- @mockenv(UPPERCASE='foo')
- def test_env_name_uppercase(self):
- self.assertYamlLoad(
- '!ENV UPPERCASE',
- 'foo'
- )
-
- @mockenv(lowercase='foo')
- def test_env_name_lowercase(self):
- self.assertYamlLoad(
- '!ENV lowercase',
- 'foo'
- )
-
- @mockenv(CamelCase='foo')
- def test_env_name_CamelCase(self):
- self.assertYamlLoad(
- '!ENV CamelCase',
- 'foo'
- )
-
- @mockenv(snake_case='foo')
- def test_env_name_snake_case(self):
- self.assertYamlLoad(
- '!ENV snake_case',
- 'foo'
- )
-
- # WARNING! The Environment Variable names in the following tests are
- # probably a bad idea in use. In fact, it may not even be possable to
- # set them in most OSs. We are testing that they don't get converted
- # to native Python types, ensuring expected results in edge cases.
-
- @mockenv(null='foo')
- def test_env_name_null(self):
- self.assertYamlLoad(
- '!ENV null',
- 'foo'
- )
-
- @mockenv(**{'~': 'foo'})
- def test_env_name_tilde(self):
- self.assertYamlLoad(
- '!ENV ~',
- 'foo'
- )
-
- @mockenv(**{'true': 'foo'})
- def test_env_name_true(self):
- self.assertYamlLoad(
- '!ENV true',
- 'foo'
- )
-
- @mockenv(**{'false': 'foo'})
- def test_env_name_false(self):
- self.assertYamlLoad(
- '!ENV false',
- 'foo'
- )
-
- @mockenv(**{'42': 'foo'})
- def test_env_name_int(self):
- self.assertYamlLoad(
- '!ENV 42',
- 'foo'
- )
-
- @mockenv(**{'3.14': 'foo'})
- def test_env_name_float(self):
- self.assertYamlLoad(
- '!ENV 3.14',
- 'foo'
- )
-
- @mockenv(**{'2020-11-11': 'foo'})
- def test_env_name_date(self):
- self.assertYamlLoad(
- '!ENV 2020-11-11',
- 'foo'
- )
-
- def test_env_name_sequance(self):
- yaml.Loader.add_constructor('!ENV', construct_env_tag)
- self.assertRaises(
- yaml.constructor.ConstructorError,
- yaml.load,
- '!ENV [[foo]]',
- Loader=yaml.Loader
- )
-
- def test_env_name_mapping(self):
- yaml.Loader.add_constructor('!ENV', construct_env_tag)
- self.assertRaises(
- yaml.constructor.ConstructorError,
- yaml.load,
- '!ENV {key: value}',
- Loader=yaml.Loader
- )
-
-if __name__ == '__main__':
- unittest.main()
diff -Nru pyyaml-env-tag-0.1/uv.lock pyyaml-env-tag-1.1/uv.lock
--- pyyaml-env-tag-0.1/uv.lock 1970-01-01 02:00:00.000000000 +0200
+++ pyyaml-env-tag-1.1/uv.lock 2025-05-13 17:22:05.000000000 +0200
@@ -0,0 +1,66 @@
+version = 1
+revision = 1
+requires-python = ">=3.9"
+
+[[package]]
+name = "pyyaml"
+version = "6.0.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url =
"https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz",
hash =
"sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size
= 130631 }
+wheels = [
+ { url =
"https://files.pythonhosted.org/packages/9b/95/a3fac87cb7158e231b5a6012e438c647e1a87f09f8e0d123acec8ab8bf71/PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl",
hash =
"sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086", size
= 184199 },
+ { url =
"https://files.pythonhosted.org/packages/c7/7a/68bd47624dab8fd4afbfd3c48e3b79efe09098ae941de5b58abcbadff5cb/PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl",
hash =
"sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf", size
= 171758 },
+ { url =
"https://files.pythonhosted.org/packages/49/ee/14c54df452143b9ee9f0f29074d7ca5516a36edb0b4cc40c3f280131656f/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237", size
= 718463 },
+ { url =
"https://files.pythonhosted.org/packages/4d/61/de363a97476e766574650d742205be468921a7b532aa2499fcd886b62530/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl",
hash =
"sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b", size
= 719280 },
+ { url =
"https://files.pythonhosted.org/packages/6b/4e/1523cb902fd98355e2e9ea5e5eb237cbc5f3ad5f3075fa65087aa0ecb669/PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed", size
= 751239 },
+ { url =
"https://files.pythonhosted.org/packages/b7/33/5504b3a9a4464893c32f118a9cc045190a91637b119a9c881da1cf6b7a72/PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl",
hash =
"sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180", size
= 695802 },
+ { url =
"https://files.pythonhosted.org/packages/5c/20/8347dcabd41ef3a3cdc4f7b7a2aff3d06598c8779faa189cdbf878b626a4/PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl",
hash =
"sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68", size
= 720527 },
+ { url =
"https://files.pythonhosted.org/packages/be/aa/5afe99233fb360d0ff37377145a949ae258aaab831bde4792b32650a4378/PyYAML-6.0.2-cp310-cp310-win32.whl",
hash =
"sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99", size
= 144052 },
+ { url =
"https://files.pythonhosted.org/packages/b5/84/0fa4b06f6d6c958d207620fc60005e241ecedceee58931bb20138e1e5776/PyYAML-6.0.2-cp310-cp310-win_amd64.whl",
hash =
"sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e", size
= 161774 },
+ { url =
"https://files.pythonhosted.org/packages/f8/aa/7af4e81f7acba21a4c6be026da38fd2b872ca46226673c89a758ebdc4fd2/PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl",
hash =
"sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774", size
= 184612 },
+ { url =
"https://files.pythonhosted.org/packages/8b/62/b9faa998fd185f65c1371643678e4d58254add437edb764a08c5a98fb986/PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl",
hash =
"sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee", size
= 172040 },
+ { url =
"https://files.pythonhosted.org/packages/ad/0c/c804f5f922a9a6563bab712d8dcc70251e8af811fce4524d57c2c0fd49a4/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c", size
= 736829 },
+ { url =
"https://files.pythonhosted.org/packages/51/16/6af8d6a6b210c8e54f1406a6b9481febf9c64a3109c541567e35a49aa2e7/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl",
hash =
"sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317", size
= 764167 },
+ { url =
"https://files.pythonhosted.org/packages/75/e4/2c27590dfc9992f73aabbeb9241ae20220bd9452df27483b6e56d3975cc5/PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85", size
= 762952 },
+ { url =
"https://files.pythonhosted.org/packages/9b/97/ecc1abf4a823f5ac61941a9c00fe501b02ac3ab0e373c3857f7d4b83e2b6/PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl",
hash =
"sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4", size
= 735301 },
+ { url =
"https://files.pythonhosted.org/packages/45/73/0f49dacd6e82c9430e46f4a027baa4ca205e8b0a9dce1397f44edc23559d/PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl",
hash =
"sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e", size
= 756638 },
+ { url =
"https://files.pythonhosted.org/packages/22/5f/956f0f9fc65223a58fbc14459bf34b4cc48dec52e00535c79b8db361aabd/PyYAML-6.0.2-cp311-cp311-win32.whl",
hash =
"sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5", size
= 143850 },
+ { url =
"https://files.pythonhosted.org/packages/ed/23/8da0bbe2ab9dcdd11f4f4557ccaf95c10b9811b13ecced089d43ce59c3c8/PyYAML-6.0.2-cp311-cp311-win_amd64.whl",
hash =
"sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44", size
= 161980 },
+ { url =
"https://files.pythonhosted.org/packages/86/0c/c581167fc46d6d6d7ddcfb8c843a4de25bdd27e4466938109ca68492292c/PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl",
hash =
"sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab", size
= 183873 },
+ { url =
"https://files.pythonhosted.org/packages/a8/0c/38374f5bb272c051e2a69281d71cba6fdb983413e6758b84482905e29a5d/PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl",
hash =
"sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725", size
= 173302 },
+ { url =
"https://files.pythonhosted.org/packages/c3/93/9916574aa8c00aa06bbac729972eb1071d002b8e158bd0e83a3b9a20a1f7/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5", size
= 739154 },
+ { url =
"https://files.pythonhosted.org/packages/95/0f/b8938f1cbd09739c6da569d172531567dbcc9789e0029aa070856f123984/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl",
hash =
"sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425", size
= 766223 },
+ { url =
"https://files.pythonhosted.org/packages/b9/2b/614b4752f2e127db5cc206abc23a8c19678e92b23c3db30fc86ab731d3bd/PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476", size
= 767542 },
+ { url =
"https://files.pythonhosted.org/packages/d4/00/dd137d5bcc7efea1836d6264f049359861cf548469d18da90cd8216cf05f/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl",
hash =
"sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48", size
= 731164 },
+ { url =
"https://files.pythonhosted.org/packages/c9/1f/4f998c900485e5c0ef43838363ba4a9723ac0ad73a9dc42068b12aaba4e4/PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl",
hash =
"sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b", size
= 756611 },
+ { url =
"https://files.pythonhosted.org/packages/df/d1/f5a275fdb252768b7a11ec63585bc38d0e87c9e05668a139fea92b80634c/PyYAML-6.0.2-cp312-cp312-win32.whl",
hash =
"sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4", size
= 140591 },
+ { url =
"https://files.pythonhosted.org/packages/0c/e8/4f648c598b17c3d06e8753d7d13d57542b30d56e6c2dedf9c331ae56312e/PyYAML-6.0.2-cp312-cp312-win_amd64.whl",
hash =
"sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8", size
= 156338 },
+ { url =
"https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl",
hash =
"sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size
= 181309 },
+ { url =
"https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl",
hash =
"sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size
= 171679 },
+ { url =
"https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size
= 733428 },
+ { url =
"https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl",
hash =
"sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size
= 763361 },
+ { url =
"https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size
= 759523 },
+ { url =
"https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl",
hash =
"sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size
= 726660 },
+ { url =
"https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl",
hash =
"sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size
= 751597 },
+ { url =
"https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl",
hash =
"sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size
= 140527 },
+ { url =
"https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl",
hash =
"sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size
= 156446 },
+ { url =
"https://files.pythonhosted.org/packages/65/d8/b7a1db13636d7fb7d4ff431593c510c8b8fca920ade06ca8ef20015493c5/PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl",
hash =
"sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d", size
= 184777 },
+ { url =
"https://files.pythonhosted.org/packages/0a/02/6ec546cd45143fdf9840b2c6be8d875116a64076218b61d68e12548e5839/PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl",
hash =
"sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f", size
= 172318 },
+ { url =
"https://files.pythonhosted.org/packages/0e/9a/8cc68be846c972bda34f6c2a93abb644fb2476f4dcc924d52175786932c9/PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290", size
= 720891 },
+ { url =
"https://files.pythonhosted.org/packages/e9/6c/6e1b7f40181bc4805e2e07f4abc10a88ce4648e7e95ff1abe4ae4014a9b2/PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl",
hash =
"sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12", size
= 722614 },
+ { url =
"https://files.pythonhosted.org/packages/3d/32/e7bd8535d22ea2874cef6a81021ba019474ace0d13a4819c2a4bce79bd6a/PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19", size
= 737360 },
+ { url =
"https://files.pythonhosted.org/packages/d7/12/7322c1e30b9be969670b672573d45479edef72c9a0deac3bb2868f5d7469/PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl",
hash =
"sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e", size
= 699006 },
+ { url =
"https://files.pythonhosted.org/packages/82/72/04fcad41ca56491995076630c3ec1e834be241664c0c09a64c9a2589b507/PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl",
hash =
"sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725", size
= 723577 },
+ { url =
"https://files.pythonhosted.org/packages/ed/5e/46168b1f2757f1fcd442bc3029cd8767d88a98c9c05770d8b420948743bb/PyYAML-6.0.2-cp39-cp39-win32.whl",
hash =
"sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631", size
= 144593 },
+ { url =
"https://files.pythonhosted.org/packages/19/87/5124b1c1f2412bb95c59ec481eaf936cd32f0fe2a7b16b97b81c4c017a6a/PyYAML-6.0.2-cp39-cp39-win_amd64.whl",
hash =
"sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8", size
= 162312 },
+]
+
+[[package]]
+name = "pyyaml-env-tag"
+source = { editable = "." }
+dependencies = [
+ { name = "pyyaml" },
+]
+
+[package.metadata]
+requires-dist = [{ name = "pyyaml" }]
diff -Nru pyyaml-env-tag-0.1/yaml_env_tag.py pyyaml-env-tag-1.1/yaml_env_tag.py
--- pyyaml-env-tag-0.1/yaml_env_tag.py 2020-11-12 03:03:56.000000000 +0200
+++ pyyaml-env-tag-1.1/yaml_env_tag.py 2025-05-13 17:22:05.000000000 +0200
@@ -1,5 +1,5 @@
""" A custom YAML tag for referencing environment variables in YAML files. """
-__version__ = '0.1'
+__version__ = '1.1'
import os
import yaml
@@ -20,9 +20,11 @@
# Env Vars are resolved as string values, ignoring (implicit) types.
vars = [loader.construct_scalar(child) for child in child_nodes]
else:
- raise yaml.constructor.ConstructorError(None, None,
+ raise yaml.constructor.ConstructorError(
+ None, None,
f'expected a scalar or sequence node, but found {node.id}',
- node.start_mark)
+ node.start_mark
+ )
for var in vars:
if var in os.environ:
@@ -32,3 +34,9 @@
return loader.construct_object(yaml.nodes.ScalarNode(tag, value))
return default
+
+
+def add_env_tag(loader: yaml.Loader) -> yaml.Loader:
+ """ Modify and return Loader with env tag support. """
+ loader.add_constructor('!ENV', construct_env_tag)
+ return loader
--- End Message ---