Skip to content

Commit 5285785

Browse files
authored
Merge pull request networktocode#134 from networktocode/issue-133
Add jsonschema format checker installation that does not install GPL-…
2 parents 224b6dc + 8b7c641 commit 5285785

File tree

7 files changed

+95
-223
lines changed

7 files changed

+95
-223
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Changelog
22

3-
## v1.1.4 - 2022-06-16
3+
## v1.1.4 - TBD
4+
5+
### Adds
6+
7+
- Add format_nongpl extra to jsonschema install. This ensures draft7 format checkers validate format adherence as expected while also ensuring GPL-Licenced transitive dependencies are not installed.
48

59
### Changes
610

711
- Update jsonschema schema version dependency so that only versions greater than 4.4 are supported.
812

13+
### Removes
14+
15+
- Automatic support for `iri` and `iri-reference` format checkers. This was removed because these format checkers require the `rfc3987` library, which is licensed under GPL. If you require these checkers, you can manually install `rfc3987` or install this package as `jsonschema[rfc3987]`.
16+
917
## v1.1.3 - 2022-05-31
1018

1119
### Changes

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ bash$ cat pyproject.toml
189189
```
190190

191191
> More information on available configuration settings can be found in the [configuration README](docs/configuration.md)
192+
193+
### Supported Formats
194+
195+
By default, schema enforcer installs the jsonschema `format-nongpl` extra which allows the use of formats that can be used in schema definitions (e.g. ipv4, hostname...etc). The `format-nongpl` extra only installs transitive dependencies that are not licensed under GPL. The `iri` and `iri-reference` formats are defined by the `rfc3987` transitive dependency which is licensed under GPL. As such, `iri` and `iri-reference` formats are *not* supported by `format-nongpl`. If you have a need to use `iri` and/or `iri-reference` formats, you can do so by running the following pip command (or it's poetry equivalent):
196+
197+
```
198+
pip install 'jsonschema[rfc3987]'
199+
```
200+
201+
See the "Validating Formats" section in the [jsonschema documentation](https://github.com/python-jsonschema/jsonschema/blob/main/docs/validate.rst) for more information.
202+
192203
### Where To Go Next
193204

194205
Detailed documentation can be found in the README.md files inside of the `docs/` directory.

poetry.lock

Lines changed: 74 additions & 195 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,17 @@ include = [
1717
python = "^3.7"
1818
click = "^7.1 || ^8.0"
1919
termcolor = "^1.1"
20-
jsonschema = {version = "^4.4", extras = ["format"]}
2120
toml = "^0.10"
2221
"ruamel.yaml" = "^0.16 || ^0.17"
2322
jinja2 = ">=2.11"
2423
jsonref = "^0.2"
2524
pydantic = "^1.6"
2625
rich = "^9.5"
27-
rfc3987 = "^1.3"
2826
jsonpointer = "^2.1"
29-
strict-rfc3339 = "^0.7"
30-
rfc3339-validator = "^0.1"
3127
jmespath = "^0.10"
3228
ansible = { version = "^2.10.0", optional = true }
3329
ansible-base = { version = "^2.10.0", optional = true }
30+
jsonschema = {version = "^4.7.1", extras = ["format-nongpl"]}
3431

3532
[tool.poetry.extras]
3633
ansible = ["ansible"]

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"incorrect_ipv6_format": "'2001:00000:3238:DFE1:63:0000:0000:FEFB' is not a 'ipv6'",
1818
"incorrect_time_format": "'20:20:33333+00:00' is not a 'time'",
1919
"incorrect_datetime_format": "'January 29th 2021' is not a 'date-time'",
20-
"incorrect_iri_format": "'fake_iri' is not a 'iri'",
2120
}
2221

2322

tests/fixtures/test_jsonschema/hostvars/spa-madrid-rt1/incorrect_iri_format.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/fixtures/test_jsonschema/schema/schemas/incorrect_iri_format.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)