diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b6b45f8..ad56432 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.12"] + python-version: ["3.8", "3.13"] steps: - uses: actions/checkout@v2 diff --git a/setup.py b/setup.py index 147d7b6..06f4a15 100755 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ version=version, url="https://github.com/23andMe/Yamale", author="Bo Lopker", - author_email="blopker@23andme.com", + author_email="dev-api@23andme.com", description="A schema and validator for YAML.", long_description=readme, long_description_content_type="text/markdown", @@ -18,6 +18,7 @@ packages=find_packages(), include_package_data=True, install_requires=["pyyaml"], + extras_requires={"ruamel": ["ruamel.yaml"]}, python_requires=">=3.8", entry_points={ "console_scripts": ["yamale=yamale.command_line:main"], @@ -34,5 +35,6 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ], ) diff --git a/tox.ini b/tox.ini index fff02c0..27a416f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] -envlist = py38, py310 +envlist = py38, py313 [gh-actions] python = 3.8: py38 - 3.12: py312 + 3.13: py313 [testenv] commands = py.test --cov yamale --cov-report term-missing yamale diff --git a/yamale/VERSION b/yamale/VERSION index 26d99a2..03f488b 100644 --- a/yamale/VERSION +++ b/yamale/VERSION @@ -1 +1 @@ -5.2.1 +5.3.0 diff --git a/yamale/command_line.py b/yamale/command_line.py index d5cb929..3c35751 100644 --- a/yamale/command_line.py +++ b/yamale/command_line.py @@ -110,7 +110,11 @@ def _router(paths, schema_name, cpus, parser, strict=True): def main(): parser = argparse.ArgumentParser(description="Validate yaml files.") parser.add_argument( - "paths", metavar="PATHS", default=["./"], nargs="*", help="Paths to validate, either directories or files. Default is the current directory." + "paths", + metavar="PATH", + default=["./"], + nargs="*", + help="Paths to validate, either directories or files. Default is the current directory.", ) parser.add_argument("-V", "--version", action="version", version=__version__) parser.add_argument("-s", "--schema", default="schema.yaml", help="filename of schema. Default is schema.yaml.") diff --git a/yamale/tests/test_command_line.py b/yamale/tests/test_command_line.py index e5c4cf9..1d01c49 100644 --- a/yamale/tests/test_command_line.py +++ b/yamale/tests/test_command_line.py @@ -51,18 +51,28 @@ def test_good_yaml(parser): def test_multiple_paths_good_yaml(): - command_line._router([ - "yamale/tests/command_line_fixtures/yamls/good.yaml", - "yamale/tests/command_line_fixtures/yamls/good2.yaml", - ], "schema.yaml", 1, "PyYAML") + command_line._router( + [ + "yamale/tests/command_line_fixtures/yamls/good.yaml", + "yamale/tests/command_line_fixtures/yamls/good2.yaml", + ], + "schema.yaml", + 1, + "PyYAML", + ) def test_multiple_paths_bad_yaml(): with pytest.raises(ValueError) as e: - command_line._router([ - "yamale/tests/command_line_fixtures/yamls/good.yaml", - "yamale/tests/command_line_fixtures/yamls/bad.yaml", - ], "schema.yaml", 1, "PyYAML") + command_line._router( + [ + "yamale/tests/command_line_fixtures/yamls/good.yaml", + "yamale/tests/command_line_fixtures/yamls/bad.yaml", + ], + "schema.yaml", + 1, + "PyYAML", + ) assert "map.bad: '12.5' is not a int." in e.value.message diff --git a/yamale/validators/validators.py b/yamale/validators/validators.py index 20fbb7a..16886de 100644 --- a/yamale/validators/validators.py +++ b/yamale/validators/validators.py @@ -257,7 +257,9 @@ def __init__(self, *args, **kwargs): super(SemVer, self).__init__(*args, **kwargs) self.regexes = [ # https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string - re.compile(r"^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"), + re.compile( + r"^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" + ), ]