Skip to content

Commit 6d42b81

Browse files
committed
Support 3.13, add [ruamel] optional package dep, prepare 5.3.0 release
1 parent ec646c5 commit 6d42b81

File tree

7 files changed

+33
-15
lines changed

7 files changed

+33
-15
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: ["3.8", "3.12"]
17+
python-version: ["3.8", "3.13"]
1818

1919
steps:
2020
- uses: actions/checkout@v2

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
version=version,
1111
url="https://github.com/23andMe/Yamale",
1212
author="Bo Lopker",
13-
author_email="blopker@23andme.com",
13+
author_email="dev-api@23andme.com",
1414
description="A schema and validator for YAML.",
1515
long_description=readme,
1616
long_description_content_type="text/markdown",
1717
license="MIT",
1818
packages=find_packages(),
1919
include_package_data=True,
2020
install_requires=["pyyaml"],
21+
extras_requires={"ruamel": ["ruamel.yaml"]},
2122
python_requires=">=3.8",
2223
entry_points={
2324
"console_scripts": ["yamale=yamale.command_line:main"],
@@ -34,5 +35,6 @@
3435
"Programming Language :: Python :: 3.10",
3536
"Programming Language :: Python :: 3.11",
3637
"Programming Language :: Python :: 3.12",
38+
"Programming Language :: Python :: 3.13",
3739
],
3840
)

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
2-
envlist = py38, py310
2+
envlist = py38, py313
33

44
[gh-actions]
55
python =
66
3.8: py38
7-
3.12: py312
7+
3.13: py313
88

99
[testenv]
1010
commands = py.test --cov yamale --cov-report term-missing yamale

yamale/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.2.1
1+
5.3.0

yamale/command_line.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ def _router(paths, schema_name, cpus, parser, strict=True):
110110
def main():
111111
parser = argparse.ArgumentParser(description="Validate yaml files.")
112112
parser.add_argument(
113-
"paths", metavar="PATHS", default=["./"], nargs="*", help="Paths to validate, either directories or files. Default is the current directory."
113+
"paths",
114+
metavar="PATH",
115+
default=["./"],
116+
nargs="*",
117+
help="Paths to validate, either directories or files. Default is the current directory.",
114118
)
115119
parser.add_argument("-V", "--version", action="version", version=__version__)
116120
parser.add_argument("-s", "--schema", default="schema.yaml", help="filename of schema. Default is schema.yaml.")

yamale/tests/test_command_line.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,28 @@ def test_good_yaml(parser):
5151

5252

5353
def test_multiple_paths_good_yaml():
54-
command_line._router([
55-
"yamale/tests/command_line_fixtures/yamls/good.yaml",
56-
"yamale/tests/command_line_fixtures/yamls/good2.yaml",
57-
], "schema.yaml", 1, "PyYAML")
54+
command_line._router(
55+
[
56+
"yamale/tests/command_line_fixtures/yamls/good.yaml",
57+
"yamale/tests/command_line_fixtures/yamls/good2.yaml",
58+
],
59+
"schema.yaml",
60+
1,
61+
"PyYAML",
62+
)
5863

5964

6065
def test_multiple_paths_bad_yaml():
6166
with pytest.raises(ValueError) as e:
62-
command_line._router([
63-
"yamale/tests/command_line_fixtures/yamls/good.yaml",
64-
"yamale/tests/command_line_fixtures/yamls/bad.yaml",
65-
], "schema.yaml", 1, "PyYAML")
67+
command_line._router(
68+
[
69+
"yamale/tests/command_line_fixtures/yamls/good.yaml",
70+
"yamale/tests/command_line_fixtures/yamls/bad.yaml",
71+
],
72+
"schema.yaml",
73+
1,
74+
"PyYAML",
75+
)
6676
assert "map.bad: '12.5' is not a int." in e.value.message
6777

6878

yamale/validators/validators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ def __init__(self, *args, **kwargs):
257257
super(SemVer, self).__init__(*args, **kwargs)
258258
self.regexes = [
259259
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
260-
re.compile(r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?: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<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"),
260+
re.compile(
261+
r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?: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<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
262+
),
261263
]
262264

263265

0 commit comments

Comments
 (0)