Skip to content

Commit 9badb4f

Browse files
authored
improve conformance class checking (#75)
* improve conformance class checking * fix poetry version
1 parent c3e4965 commit 9badb4f

File tree

5 files changed

+267
-207
lines changed

5 files changed

+267
-207
lines changed

.github/workflows/constraints.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pip==22.2.2
22
nox==2022.8.7
33
nox-poetry==1.0.1
4-
poetry==1.2.1
4+
poetry~=1.1.10
55
virtualenv==20.16.5

poetry.lock

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

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "stac-api-validator"
3-
version = "0.0.0"
3+
version = "0.0.1"
44
description = "STAC API Validator"
55
authors = ["Phil Varner <[email protected]>"]
66
license = "Apache-2.0"
@@ -16,15 +16,15 @@ classifiers = [
1616
Changelog = "https://github.com/philvarner/stac-api-validator/releases"
1717

1818
[tool.poetry.dependencies]
19-
python = "^3.8"
19+
python = "^3.10"
2020
click = ">=8.0.1"
2121
pystac-client = "^0.5.0"
2222
requests = "^2.28.1"
2323
pystac = {extras = ["orjson"], version = "^1.6.1"}
2424

2525
[tool.poetry.dev-dependencies]
2626
Pygments = ">=2.10.0"
27-
black = ">=21.10b0"
27+
black = ">=22.8.0"
2828
coverage = {extras = ["toml"], version = ">=6.2"}
2929
darglint = ">=1.8.1"
3030
flake8 = ">=4.0.1"
@@ -34,7 +34,7 @@ flake8-docstrings = ">=1.6.0"
3434
flake8-rst-docstrings = ">=0.2.5"
3535
furo = ">=2021.11.12"
3636
isort = ">=5.10.1"
37-
mypy = ">=0.930"
37+
mypy = ">=0.971"
3838
pep8-naming = ">=0.12.1"
3939
pre-commit = ">=2.16.0"
4040
pre-commit-hooks = ">=4.1.0"

src/stac_api_validator/__main__.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
import sys
44
import traceback
5+
from typing import List
56

67
import click
78

@@ -25,15 +26,35 @@
2526
default=True,
2627
help="Test all validations with POST method for requests in addition to GET",
2728
)
28-
def main(log_level: str, root_url: str, post: bool) -> int:
29+
@click.option(
30+
"--conformance",
31+
"conformance_classes",
32+
required=True,
33+
multiple=True,
34+
type=click.Choice(
35+
[
36+
"core",
37+
"browseable",
38+
"item-search",
39+
"features",
40+
"collections",
41+
"children",
42+
],
43+
case_sensitive=False,
44+
),
45+
help="Conformance class URIs to validate",
46+
)
47+
def main(
48+
log_level: str, root_url: str, post: bool, conformance_classes: List[str]
49+
) -> int:
2950
"""STAC API Validator."""
3051

3152
logging.basicConfig(stream=sys.stdout, level=log_level)
3253

3354
print(f"Validating {root_url}", flush=True)
3455

3556
try:
36-
(warnings, errors) = validate_api(root_url, post)
57+
(warnings, errors) = validate_api(root_url, post, conformance_classes)
3758
except Exception as e:
3859
print(f"Failed.\nError {root_url}: {type(e)} {str(e)}")
3960
traceback.print_exc()

0 commit comments

Comments
 (0)