Skip to content

Move verbose messaging for --recursive #222

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

Merged
merged 7 commits into from
Dec 17, 2022
Merged
Changes from all 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
@@ -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.10", "3.11"]

steps:

9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
@@ -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>
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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()
10 changes: 5 additions & 5 deletions stac_validator/validate.py
Original file line number Diff line number Diff line change
@@ -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:
@@ -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":
@@ -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):
2 changes: 1 addition & 1 deletion tox/Dockerfile-tox
Original file line number Diff line number Diff line change
@@ -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