Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move verbose messaging for --recursive #222

Merged
merged 7 commits into from
Dec 17, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9, 3.11]
gadomski marked this conversation as resolved.
Show resolved Hide resolved

steps:

Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## [v3.3.1] - 2022-12-16

### Fixed

- Moved --verbose messaging for --recursive as --verbose was printing out the wrong messages https://github.com/stac-utils/stac-validator/pull/222

## [v3.3.0] - 2022-11-28

### Added
Expand Down Expand Up @@ -171,7 +177,8 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
- With the newest version - 1.0.0-beta.2 - items will run through jsonchema validation before the PySTAC validation. The reason for this is that jsonschema will give more informative error messages. This should be addressed better in the future. This is not the case with the --recursive option as time can be a concern here with larger collections.
- Logging. Various additions were made here depending on the options selected. This was done to help assist people to update their STAC collections.

[Unreleased]: <https://github.com/sparkgeo/stac-validator/compare/v3.3.0..main>
[Unreleased]: <https://github.com/sparkgeo/stac-validator/compare/v3.3.1..main>
[v3.3.1]: <https://github.com/sparkgeo/stac-validator/compare/v3.3.0..v3.3.1>
[v3.3.0]: <https://github.com/sparkgeo/stac-validator/compare/v3.2.0..v3.3.0>
[v3.2.0]: <https://github.com/sparkgeo/stac-validator/compare/v3.1.0..v3.2.0>
[v3.1.0]: <https://github.com/sparkgeo/stac-validator/compare/v3.0.0..v3.1.0>
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup

__version__ = "3.3.0"
__version__ = "3.3.1"

with open("README.md", "r") as fh:
long_description = fh.read()
Expand Down
10 changes: 5 additions & 5 deletions stac_validator/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,14 @@ def recursive_validator(self, stac_type: str) -> bool:
self.create_err_msg("JSONSchemaValidationError", err_msg)
)
self.message.append(message)
if self.verbose is True:
click.echo(json.dumps(message, indent=4))
return False

message["valid_stac"] = True
self.message.append(message)
if self.verbose is True:
click.echo(json.dumps(message, indent=4))
self.depth = self.depth + 1
if self.max_depth:
if self.depth >= self.max_depth:
Expand All @@ -243,9 +248,6 @@ def recursive_validator(self, stac_type: str) -> bool:
stac_type = get_stac_type(self.stac_content).lower()

if link["rel"] == "child":

if self.verbose is True:
click.echo(json.dumps(message, indent=4))
self.recursive_validator(stac_type)

if link["rel"] == "item":
Expand All @@ -267,8 +269,6 @@ def recursive_validator(self, stac_type: str) -> bool:
not self.max_depth or self.max_depth < 5
): # TODO this should be configurable, correct?
self.message.append(message)
if self.verbose is True:
click.echo(json.dumps(message, indent=4))
return True

def validate_dict(self, stac_content):
Expand Down
2 changes: 1 addition & 1 deletion tox/Dockerfile-tox
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ COPY . /code/
RUN export LC_ALL=C.UTF-8 && \
export LANG=C.UTF-8 && \
pip3 install . && \
pip3 install tox==3.23.0 && \
pip3 install tox==4.0.11 && \
tox