amati 0.2.22__tar.gz → 0.2.23__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 (96) hide show
  1. amati-0.2.23/.python-version +1 -0
  2. {amati-0.2.22 → amati-0.2.23}/Dockerfile +1 -1
  3. {amati-0.2.22 → amati-0.2.23}/PKG-INFO +1 -1
  4. {amati-0.2.22 → amati-0.2.23}/amati/amati.py +1 -0
  5. {amati-0.2.22 → amati-0.2.23}/amati/fields/media.py +2 -1
  6. {amati-0.2.22 → amati-0.2.23}/amati/file_handler.py +1 -1
  7. {amati-0.2.22 → amati-0.2.23}/bin/checks.sh +2 -2
  8. amati-0.2.23/bin/upgrade-python.sh +16 -0
  9. {amati-0.2.22 → amati-0.2.23}/pyproject.toml +6 -8
  10. {amati-0.2.22 → amati-0.2.23}/scripts/setup_test_specs.py +1 -1
  11. {amati-0.2.22 → amati-0.2.23}/uv.lock +1 -1
  12. amati-0.2.22/.python-version +0 -1
  13. {amati-0.2.22 → amati-0.2.23}/.dockerignore +0 -0
  14. {amati-0.2.22 → amati-0.2.23}/.github/dependabot.yml +0 -0
  15. {amati-0.2.22 → amati-0.2.23}/.github/workflows/checks.yaml +0 -0
  16. {amati-0.2.22 → amati-0.2.23}/.github/workflows/codeql.yml +0 -0
  17. {amati-0.2.22 → amati-0.2.23}/.github/workflows/coverage.yaml +0 -0
  18. {amati-0.2.22 → amati-0.2.23}/.github/workflows/data-refresh.yaml +0 -0
  19. {amati-0.2.22 → amati-0.2.23}/.github/workflows/dependency-review.yml +0 -0
  20. {amati-0.2.22 → amati-0.2.23}/.github/workflows/publish.yaml +0 -0
  21. {amati-0.2.22 → amati-0.2.23}/.github/workflows/scorecards.yml +0 -0
  22. {amati-0.2.22 → amati-0.2.23}/.github/workflows/tag-and-create-release.yaml +0 -0
  23. {amati-0.2.22 → amati-0.2.23}/.gitignore +0 -0
  24. {amati-0.2.22 → amati-0.2.23}/.pre-commit-config.yaml +0 -0
  25. {amati-0.2.22 → amati-0.2.23}/LICENSE +0 -0
  26. {amati-0.2.22 → amati-0.2.23}/README.md +0 -0
  27. {amati-0.2.22 → amati-0.2.23}/SECURITY.md +0 -0
  28. {amati-0.2.22 → amati-0.2.23}/TEMPLATE.html +0 -0
  29. {amati-0.2.22 → amati-0.2.23}/amati/__init__.py +0 -0
  30. {amati-0.2.22 → amati-0.2.23}/amati/_data/files/http-status-codes.json +0 -0
  31. {amati-0.2.22 → amati-0.2.23}/amati/_data/files/iso9110.json +0 -0
  32. {amati-0.2.22 → amati-0.2.23}/amati/_data/files/media-types.json +0 -0
  33. {amati-0.2.22 → amati-0.2.23}/amati/_data/files/schemes.json +0 -0
  34. {amati-0.2.22 → amati-0.2.23}/amati/_data/files/spdx-licences.json +0 -0
  35. {amati-0.2.22 → amati-0.2.23}/amati/_data/files/tlds.json +0 -0
  36. {amati-0.2.22 → amati-0.2.23}/amati/_data/http_status_code.py +0 -0
  37. {amati-0.2.22 → amati-0.2.23}/amati/_data/iso9110.py +0 -0
  38. {amati-0.2.22 → amati-0.2.23}/amati/_data/media_types.py +0 -0
  39. {amati-0.2.22 → amati-0.2.23}/amati/_data/refresh.py +0 -0
  40. {amati-0.2.22 → amati-0.2.23}/amati/_data/schemes.py +0 -0
  41. {amati-0.2.22 → amati-0.2.23}/amati/_data/spdx_licences.py +0 -0
  42. {amati-0.2.22 → amati-0.2.23}/amati/_data/tlds.py +0 -0
  43. {amati-0.2.22 → amati-0.2.23}/amati/_error_handler.py +0 -0
  44. {amati-0.2.22 → amati-0.2.23}/amati/_logging.py +0 -0
  45. {amati-0.2.22 → amati-0.2.23}/amati/_resolve_forward_references.py +0 -0
  46. {amati-0.2.22 → amati-0.2.23}/amati/exceptions.py +0 -0
  47. {amati-0.2.22 → amati-0.2.23}/amati/fields/__init__.py +0 -0
  48. {amati-0.2.22 → amati-0.2.23}/amati/fields/_custom_types.py +0 -0
  49. {amati-0.2.22 → amati-0.2.23}/amati/fields/commonmark.py +0 -0
  50. {amati-0.2.22 → amati-0.2.23}/amati/fields/email.py +0 -0
  51. {amati-0.2.22 → amati-0.2.23}/amati/fields/http_status_codes.py +0 -0
  52. {amati-0.2.22 → amati-0.2.23}/amati/fields/iso9110.py +0 -0
  53. {amati-0.2.22 → amati-0.2.23}/amati/fields/json.py +0 -0
  54. {amati-0.2.22 → amati-0.2.23}/amati/fields/oas.py +0 -0
  55. {amati-0.2.22 → amati-0.2.23}/amati/fields/spdx_licences.py +0 -0
  56. {amati-0.2.22 → amati-0.2.23}/amati/fields/uri.py +0 -0
  57. {amati-0.2.22 → amati-0.2.23}/amati/grammars/oas.py +0 -0
  58. {amati-0.2.22 → amati-0.2.23}/amati/grammars/rfc6901.py +0 -0
  59. {amati-0.2.22 → amati-0.2.23}/amati/grammars/rfc7159.py +0 -0
  60. {amati-0.2.22 → amati-0.2.23}/amati/model_validators.py +0 -0
  61. {amati-0.2.22 → amati-0.2.23}/amati/py.typed +0 -0
  62. {amati-0.2.22 → amati-0.2.23}/amati/validators/__init__.py +0 -0
  63. {amati-0.2.22 → amati-0.2.23}/amati/validators/generic.py +0 -0
  64. {amati-0.2.22 → amati-0.2.23}/amati/validators/oas304.py +0 -0
  65. {amati-0.2.22 → amati-0.2.23}/amati/validators/oas311.py +0 -0
  66. {amati-0.2.22 → amati-0.2.23}/bin/startup.sh +0 -0
  67. {amati-0.2.22 → amati-0.2.23}/bin/uv-upgrade-from-main.sh +0 -0
  68. {amati-0.2.22 → amati-0.2.23}/tests/__init__.py +0 -0
  69. {amati-0.2.22 → amati-0.2.23}/tests/data/.amati.tests.yaml +0 -0
  70. {amati-0.2.22 → amati-0.2.23}/tests/data/DigitalOcean-public.v2.errors.json +0 -0
  71. {amati-0.2.22 → amati-0.2.23}/tests/data/api.github.com.yaml.errors.json +0 -0
  72. {amati-0.2.22 → amati-0.2.23}/tests/data/next-api.github.com.yaml.errors.json +0 -0
  73. {amati-0.2.22 → amati-0.2.23}/tests/data/openapi.yaml +0 -0
  74. {amati-0.2.22 → amati-0.2.23}/tests/data/openapi.yaml.gz +0 -0
  75. {amati-0.2.22 → amati-0.2.23}/tests/data/redocly.openapi.yaml.errors.json +0 -0
  76. {amati-0.2.22 → amati-0.2.23}/tests/fields/__init__.py +0 -0
  77. {amati-0.2.22 → amati-0.2.23}/tests/fields/test_email.py +0 -0
  78. {amati-0.2.22 → amati-0.2.23}/tests/fields/test_http_status_codes.py +0 -0
  79. {amati-0.2.22 → amati-0.2.23}/tests/fields/test_iso9110.py +0 -0
  80. {amati-0.2.22 → amati-0.2.23}/tests/fields/test_media.py +0 -0
  81. {amati-0.2.22 → amati-0.2.23}/tests/fields/test_oas.py +0 -0
  82. {amati-0.2.22 → amati-0.2.23}/tests/fields/test_spdx_licences.py +0 -0
  83. {amati-0.2.22 → amati-0.2.23}/tests/fields/test_uri.py +0 -0
  84. {amati-0.2.22 → amati-0.2.23}/tests/helpers.py +0 -0
  85. {amati-0.2.22 → amati-0.2.23}/tests/model_validators/test_all_of.py +0 -0
  86. {amati-0.2.22 → amati-0.2.23}/tests/model_validators/test_at_least_one.py +0 -0
  87. {amati-0.2.22 → amati-0.2.23}/tests/model_validators/test_if_then.py +0 -0
  88. {amati-0.2.22 → amati-0.2.23}/tests/model_validators/test_only_one.py +0 -0
  89. {amati-0.2.22 → amati-0.2.23}/tests/test_amati.py +0 -0
  90. {amati-0.2.22 → amati-0.2.23}/tests/test_external_specs.py +0 -0
  91. {amati-0.2.22 → amati-0.2.23}/tests/test_logging.py +0 -0
  92. {amati-0.2.22 → amati-0.2.23}/tests/validators/__init__.py +0 -0
  93. {amati-0.2.22 → amati-0.2.23}/tests/validators/test_generic.py +0 -0
  94. {amati-0.2.22 → amati-0.2.23}/tests/validators/test_licence_object.py +0 -0
  95. {amati-0.2.22 → amati-0.2.23}/tests/validators/test_security_scheme_object.py +0 -0
  96. {amati-0.2.22 → amati-0.2.23}/tests/validators/test_server_variable_object.py +0 -0
@@ -0,0 +1 @@
1
+ 3.14.0
@@ -1,4 +1,4 @@
1
- FROM python:3.13-slim@sha256:5f55cdf0c5d9dc1a415637a5ccc4a9e18663ad203673173b8cda8f8dcacef689
1
+ FROM python:3.14.0-slim@sha256:9dc4ef3e628432af2237d1418908f5c6d4528e9f776aaa6e7c95c18854c86e48
2
2
 
3
3
  ENV PYTHONUNBUFFERED=1
4
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amati
3
- Version: 0.2.22
3
+ Version: 0.2.23
4
4
  Summary: Validates that a .yaml or .json file conforms to the OpenAPI Specifications 3.x.
5
5
  Project-URL: Homepage, https://github.com/ben-alexander/amati
6
6
  Project-URL: Issues, https://github.com/ben-alexander/amati/issues
@@ -232,6 +232,7 @@ if __name__ == "__main__":
232
232
  Creates a file <filename>.errors.json alongside the original specification
233
233
  containing a JSON representation of all the errors.
234
234
  """,
235
+ suggest_on_error=True,
235
236
  )
236
237
 
237
238
  parser.add_argument(
@@ -2,6 +2,7 @@
2
2
  Validates a media type or media type range according to RFC7321
3
3
  """
4
4
 
5
+ from annotationlib import get_annotations
5
6
  from typing import cast
6
7
 
7
8
  from abnf import ParseError
@@ -55,7 +56,7 @@ class MediaType(_Str):
55
56
  media_type = rfc7231.Rule("media-type").parse_all(value)
56
57
 
57
58
  for node in media_type.children:
58
- if node.name in self.__annotations__:
59
+ if node.name in get_annotations(self.__class__):
59
60
  self.__dict__[node.name] = node.value
60
61
 
61
62
  except ParseError as e:
@@ -19,9 +19,9 @@ Supported File Types:
19
19
  - YAML: .yaml, .yml (optionally gzip compressed)
20
20
  """
21
21
 
22
- import gzip
23
22
  import json
24
23
  from abc import ABC, abstractmethod
24
+ from compression import gzip
25
25
  from pathlib import Path
26
26
 
27
27
  import yaml
@@ -6,6 +6,6 @@ pytest --cov-report term-missing --cov=amati tests
6
6
  pytest --doctest-modules amati/
7
7
  pyright --verifytypes amati --ignoreexternal
8
8
  docker build -t amati -f Dockerfile .
9
- cd tests/ || exit
9
+ cd .amati/test-specs/swagger/src/main/resources/ || exit
10
10
  docker run -v "$(pwd):/data" amati -d /data --consistency-check
11
- cd ..
11
+ cd - || exit
@@ -0,0 +1,16 @@
1
+ #!/bin/sh
2
+
3
+ # Upgrades the Python version
4
+ # Steps:
5
+ # 1. Run this script
6
+ # 2. Upgraed the Dockerfile to match the new version
7
+ # 3. Run sh bin/checks.sh to ensure everything is working
8
+ # 4. Commit the changes and push
9
+
10
+ deactivate || true
11
+ uv self update
12
+ uv python upgrade "$1"
13
+ uv python pin "$1"
14
+ uv venv
15
+ . .venv/bin/activate
16
+ uv sync --all-groups
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "amati"
3
- version = "0.2.22"
3
+ version = "0.2.23"
4
4
  description = "Validates that a .yaml or .json file conforms to the OpenAPI Specifications 3.x."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -51,13 +51,6 @@ dev = [
51
51
  "ruff>=0.12.1",
52
52
  ]
53
53
 
54
- [tool.isort]
55
- src_paths = ["amati", "tests"]
56
- known_first_party=["amati"]
57
- known_third_party=["pytest","pydantic","yaml","abnf", "rfc3987"]
58
- extra_standard_library=["typing_extensions"]
59
- profile="black"
60
-
61
54
  [tool.coverage.run]
62
55
  relative_files=true
63
56
  omit=[
@@ -99,3 +92,8 @@ select = [
99
92
  "UP", # pyupgrade
100
93
  ]
101
94
  extend-fixable = ["UP015"]
95
+
96
+ [tool.ruff.lint.isort]
97
+ known-first-party=["amati"]
98
+ known-third-party=["pytest","pydantic","yaml","abnf", "rfc3987"]
99
+ extra-standard-library=["typing_extensions", "annotationlib", "compression"]
@@ -62,7 +62,7 @@ def clone(content: dict[str, Any]):
62
62
  dir=clone_directory.parent, prefix=clone_directory.name
63
63
  )
64
64
 
65
- logger.info(f"Cloning {remote['uri']} into {clone_directory}")
65
+ logger.info(f"Cloning {remote['uri']} into {tmp_directory}")
66
66
 
67
67
  subprocess.run(
68
68
  [
@@ -13,7 +13,7 @@ wheels = [
13
13
 
14
14
  [[package]]
15
15
  name = "amati"
16
- version = "0.2.22"
16
+ version = "0.2.23"
17
17
  source = { editable = "." }
18
18
  dependencies = [
19
19
  { name = "abnf" },
@@ -1 +0,0 @@
1
- 3.13.7
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
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