Skip to content

Commit 6ea1427

Browse files
committed
update tox.ini
1 parent 18b1880 commit 6ea1427

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

.github/workflows/test-runner.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,14 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install -e ".[pydantic]"
32-
pip install pytest
33-
# Explicitly install stac-pydantic and verify it's installed
34-
pip install stac-pydantic>=3.3.0
35-
python -c "import stac_pydantic; print('stac-pydantic installed successfully')"
36-
37-
# Debug information
38-
echo "Installed packages:"
39-
pip list
40-
echo "Python path:"
41-
python -c "import sys; print(sys.path)"
42-
echo "stac_pydantic location:"
43-
python -c "import stac_pydantic; print(stac_pydantic.__file__)"
44-
4528
- name: Run mypy
4629
run: |
4730
pip install .
4831
pip install -r requirements-dev.txt
4932
pytest --mypy stac_validator
5033
5134
- name: Run pre-commit
52-
if: matrix.python-version == 3.10
35+
if: matrix.python-version == 3.12
5336
run: |
5437
pre-commit install
5538
pre-commit autoupdate

stac_validator/validate.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,9 @@ def validate_collections(self) -> None:
477477
478478
Raises:
479479
URLError, JSONDecodeError, ValueError, TypeError, FileNotFoundError,
480-
ConnectionError, exceptions.SSLError, OSError: Various errors related
481-
to fetching or parsing.
480+
ConnectionError, exceptions.SSLError, OSError, KeyError, HTTPError,
481+
jsonschema.exceptions.ValidationError, Exception: Various errors
482+
during fetching or parsing.
482483
"""
483484
collections = fetch_and_parse_file(str(self.stac_file), self.headers)
484485
for collection in collections["collections"]:
@@ -491,8 +492,9 @@ def validate_item_collection(self) -> None:
491492
492493
Raises:
493494
URLError, JSONDecodeError, ValueError, TypeError, FileNotFoundError,
494-
ConnectionError, exceptions.SSLError, OSError: Various errors related
495-
to fetching or parsing.
495+
ConnectionError, exceptions.SSLError, OSError, KeyError, HTTPError,
496+
jsonschema.exceptions.ValidationError, Exception: Various errors
497+
during fetching or parsing.
496498
"""
497499
page = 1
498500
print(f"processing page {page}")
@@ -558,7 +560,7 @@ def pydantic_validator(self, stac_type: str) -> Dict:
558560

559561
item_model = Item.model_validate(self.stac_content)
560562
message["schema"] = ["stac-pydantic Item model"]
561-
print("Set schema to: " + message["schema"])
563+
print("Set schema to: " + str(message["schema"]))
562564

563565
# Validate extensions if present
564566
if (
@@ -577,7 +579,7 @@ def pydantic_validator(self, stac_type: str) -> Dict:
577579

578580
collection_model = Collection.model_validate(self.stac_content)
579581
message["schema"] = ["stac-pydantic Collection model"]
580-
print("Set schema to: " + message["schema"])
582+
print("Set schema to: " + str(message["schema"]))
581583

582584
# Validate extensions if present
583585
if (
@@ -596,7 +598,7 @@ def pydantic_validator(self, stac_type: str) -> Dict:
596598

597599
catalog_model = Catalog.model_validate(self.stac_content)
598600
message["schema"] = ["stac-pydantic Catalog model"]
599-
print("Set schema to: " + message["schema"])
601+
print("Set schema to: " + str(message["schema"]))
600602

601603
# For catalogs, we don't need to validate extensions, but we still need to use the model
602604
# to avoid flake8 warnings

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ envlist = py38,py39,py310,py311,py312,py313
55
deps =
66
pytest
77
requests-mock
8-
commands = pytest
8+
commands = pytest
9+
extras = pydantic

0 commit comments

Comments
 (0)