amati 0.2__py3-none-any.whl → 0.2.1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amati
3
- Version: 0.2
3
+ Version: 0.2.1
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
@@ -28,7 +28,7 @@ amati is designed to validate that a file conforms to the [OpenAPI Specification
28
28
 
29
29
  ## Name
30
30
 
31
- amati means to observe in Malay, especially with attention to detail. It's also one of the plurals of beloved or favourite in Italian.
31
+ "amati" means to observe in Malay, especially with attention to detail. It's also one of the plurals of beloved or favourite in Italian.
32
32
 
33
33
  ## Usage
34
34
 
@@ -59,34 +59,47 @@ A Dockerfile is available on [DockerHub](https://hub.docker.com/r/benale/amati/t
59
59
  To run against a specific specification the location of the specification needs to be mounted in the container.
60
60
 
61
61
  ```sh
62
- docker run -v "<path-to-mount>:/<mount-name> amati <options>
62
+ docker run -v "<path-to-mount>:/<mount-name> amati:alpha <options>
63
63
  ```
64
64
 
65
65
  e.g.
66
66
 
67
67
  ```sh
68
- docker run -v /Users/myuser/myrepo:/data amati --spec data/myspec.yaml --hr
68
+ docker run -v /Users/myuser/myrepo:/data amati:alpha --spec data/myspec.yaml --hr
69
69
  ```
70
70
 
71
71
  ## Architecture
72
72
 
73
- This uses Pydantic, especially the validation, and Typing to construct the entire OAS as a single data type. Passing a dictionary to the top-level data type runs all the validation in the Pydantic models constructing a single set of inherited classes and datatypes that validate that the API specification is accurate.
73
+ amati uses Pydantic, especially the validation, and Typing to construct the entire OAS as a single data type. Passing a dictionary to the top-level data type runs all the validation in the Pydantic models constructing a single set of inherited classes and datatypes that validate that the API specification is accurate. To the extent that Pydantic is functional, amati has a [functional core and an imperative shell](https://www.destroyallsoftware.com/screencasts/catalog/functional-core-imperative-shell).
74
74
 
75
75
  Where the specification conforms, but relies on implementation-defined behavior (e.g. [data type formats](https://spec.openapis.org/oas/v3.1.1.html#data-type-format)), a warning will be raised.
76
76
 
77
77
  ## Contributing
78
78
 
79
- ### Requirements
79
+ ### Prerequisites
80
80
 
81
81
  * The latest version of [uv](https://docs.astral.sh/uv/)
82
82
  * [git 2.49+](https://git-scm.com/downloads/linux)
83
+ * [Docker](https://docs.docker.com/engine/install/)
84
+
85
+ ### Starting
86
+
87
+ The project uses a [`pyproject.toml` file](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml) to determine what to build.
88
+
89
+ To get started run:
90
+
91
+ ```sh
92
+ uv python install
93
+ uv venv
94
+ uv sync
95
+ ```
83
96
 
84
97
  ### Testing and formatting
85
98
 
86
99
  This project uses:
87
100
 
88
101
  * [Pytest](https://docs.pytest.org/en/stable/) as a testing framework
89
- * [PyLance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) on strict mode for type checking
102
+ * [Pyright](https://microsoft.github.io/pyright/#/) on strict mode for type checking
90
103
  * [Pylint](https://www.pylint.org/) as a linter, using a modified version from [Google's style guide](https://google.github.io/styleguide/pyguide.html)
91
104
  * [Hypothesis](https://hypothesis.readthedocs.io/en/latest/index.html) for test data generation
92
105
  * [Coverage](https://coverage.readthedocs.io/en/7.6.8/) on both the tests and code for test coverage
@@ -94,33 +107,20 @@ This project uses:
94
107
  * [isort](https://pycqa.github.io/isort/) for import sorting
95
108
 
96
109
  It's expected that there are no errors and 100% of the code is reached and executed. The strategy for test coverage is based on parsing test specifications and not unit tests.
97
-
98
- amati runs tests on external specifications, detailed in `tests/data/.amati.tests.yaml`. To be able to run these tests the appropriate GitHub repos need to be local. Specific revisions of the repos can be downloaded by running
110
+ amati runs tests on the external specifications, detailed in `tests/data/.amati.tests.yaml`. To be able to run these tests the GitHub repos containing the specifications need to be available locally. Specific revisions of the repos can be downloaded by running the following, which will clone the repos into `../amati-tests-specs/<repo-name>`.
99
111
 
100
112
  ```sh
101
113
  python scripts/tests/setup_test_specs.py
102
114
  ```
103
115
 
116
+ If there are some issues with the specification a JSON file detailing those should be placed into `tests/data/` and the name of that file noted in `tests/data/.amati.tests.yaml` for the test suite to pick it up and check that the errors are expected. Any specifications that close the coverage gap are gratefully received.
117
+
104
118
  To run everything, from linting, type checking to downloading test specs and building and testing the Docker image run:
105
119
 
106
120
  ```sh
107
121
  sh bin/checks.sh
108
122
  ```
109
123
 
110
- You will need to have Docker installed.
111
-
112
- ### Building
113
-
114
- The project uses a [`pyproject.toml` file](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml) to determine what to build.
115
-
116
- To install, assuming that [uv](https://docs.astral.sh/uv/) is already installed and initialised
117
-
118
- ```sh
119
- uv python install
120
- uv venv
121
- uv sync
122
- ```
123
-
124
124
  ### Docker
125
125
 
126
126
  A development Docker image is provided, `Dockerfile.dev`, to build:
@@ -129,7 +129,7 @@ A development Docker image is provided, `Dockerfile.dev`, to build:
129
129
  docker build -t amati -f Dockerfile .
130
130
  ```
131
131
 
132
- and to run against a specific specification the location of the specification needs to be mounted in the container.
132
+ to run against a specific specification the location of the specification needs to be mounted in the container.
133
133
 
134
134
  ```sh
135
135
  docker run -v "<path-to-mount>:/<mount-name> amati <options>
@@ -138,13 +138,13 @@ docker run -v "<path-to-mount>:/<mount-name> amati <options>
138
138
  This can be tested against a provided specification, from the root directory
139
139
 
140
140
  ```sh
141
- docker run --detach -v "$(pwd):/data" amati
141
+ docker run --detach -v "$(pwd):/data" amati <options>
142
142
  ```
143
143
 
144
144
 
145
145
  ### Data
146
146
 
147
- There are some scripts to create the data needed by the project, for example, all the possible licences. If the data needs to be refreshed this can be done by running the contents of `/scripts/data`.
147
+ There are some scripts to create the data needed by the project, for example, all the registered TLDs. To refresh the data, run the contents of `/scripts/data`.
148
148
 
149
149
 
150
150
 
@@ -30,8 +30,8 @@ amati/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
30
30
  amati/validators/generic.py,sha256=AYIHIuEHpf1p-lCynBp-YGaayIZOylzNgGi533ykVbc,3983
31
31
  amati/validators/oas304.py,sha256=84sAc37azkgrOt29scjRtYtJGypnFZd5UkV9VGLsX8c,32472
32
32
  amati/validators/oas311.py,sha256=FVMOjNXWlZhq6fgah0NGGPlgdcSZFgVxVbEwWnk4Sn4,17712
33
- amati-0.2.dist-info/METADATA,sha256=pDJg9ueeR6-_otHva88kNPxiEy3e-AAMIRvxsc4RFhg,5916
34
- amati-0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
- amati-0.2.dist-info/entry_points.txt,sha256=sacBb6g0f0ZJtNjNYx93_Xe4y5xzawvklCFVXup9ru0,37
36
- amati-0.2.dist-info/licenses/LICENSE,sha256=WAA01ZXeNs1bwpNWKR6aVucjtYjYm_iQIUYkCAENjqM,1070
37
- amati-0.2.dist-info/RECORD,,
33
+ amati-0.2.1.dist-info/METADATA,sha256=D2pXSaxSmc8pRwCdpqJNeGozaUZjKdsXvJ1BBODaF4Y,6425
34
+ amati-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
+ amati-0.2.1.dist-info/entry_points.txt,sha256=sacBb6g0f0ZJtNjNYx93_Xe4y5xzawvklCFVXup9ru0,37
36
+ amati-0.2.1.dist-info/licenses/LICENSE,sha256=WAA01ZXeNs1bwpNWKR6aVucjtYjYm_iQIUYkCAENjqM,1070
37
+ amati-0.2.1.dist-info/RECORD,,
File without changes