Skip to content

Commit 3f5ef40

Browse files
authored
Merge pull request #222 from stac-utils/fix_verbose_recursive
Move verbose messaging for --recursive
2 parents f2ee8be + 99cc07e commit 3f5ef40

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

.github/workflows/test-runner.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: [3.7, 3.8, 3.9]
21+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
2222

2323
steps:
2424

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

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

7+
## [v3.3.1] - 2022-12-16
8+
9+
### Fixed
10+
11+
- Moved --verbose messaging for --recursive as --verbose was printing out the wrong messages https://github.com/stac-utils/stac-validator/pull/222
12+
713
## [v3.3.0] - 2022-11-28
814

915
### Added
@@ -171,7 +177,8 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
171177
- 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.
172178
- Logging. Various additions were made here depending on the options selected. This was done to help assist people to update their STAC collections.
173179

174-
[Unreleased]: <https://github.com/sparkgeo/stac-validator/compare/v3.3.0..main>
180+
[Unreleased]: <https://github.com/sparkgeo/stac-validator/compare/v3.3.1..main>
181+
[v3.3.1]: <https://github.com/sparkgeo/stac-validator/compare/v3.3.0..v3.3.1>
175182
[v3.3.0]: <https://github.com/sparkgeo/stac-validator/compare/v3.2.0..v3.3.0>
176183
[v3.2.0]: <https://github.com/sparkgeo/stac-validator/compare/v3.1.0..v3.2.0>
177184
[v3.1.0]: <https://github.com/sparkgeo/stac-validator/compare/v3.0.0..v3.1.0>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import setup
44

5-
__version__ = "3.3.0"
5+
__version__ = "3.3.1"
66

77
with open("README.md", "r") as fh:
88
long_description = fh.read()

stac_validator/validate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,14 @@ def recursive_validator(self, stac_type: str) -> bool:
217217
self.create_err_msg("JSONSchemaValidationError", err_msg)
218218
)
219219
self.message.append(message)
220+
if self.verbose is True:
221+
click.echo(json.dumps(message, indent=4))
220222
return False
223+
221224
message["valid_stac"] = True
222225
self.message.append(message)
226+
if self.verbose is True:
227+
click.echo(json.dumps(message, indent=4))
223228
self.depth = self.depth + 1
224229
if self.max_depth:
225230
if self.depth >= self.max_depth:
@@ -243,9 +248,6 @@ def recursive_validator(self, stac_type: str) -> bool:
243248
stac_type = get_stac_type(self.stac_content).lower()
244249

245250
if link["rel"] == "child":
246-
247-
if self.verbose is True:
248-
click.echo(json.dumps(message, indent=4))
249251
self.recursive_validator(stac_type)
250252

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

274274
def validate_dict(self, stac_content):

tox/Dockerfile-tox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ COPY . /code/
44
RUN export LC_ALL=C.UTF-8 && \
55
export LANG=C.UTF-8 && \
66
pip3 install . && \
7-
pip3 install tox==3.23.0 && \
7+
pip3 install tox==4.0.11 && \
88
tox

0 commit comments

Comments
 (0)