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

Update to stac v1.1.0, release stac-validator v3.4.0 #235

Merged
merged 10 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
7 changes: 2 additions & 5 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ on:
- dev

jobs:

test:

name: Execute tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
Expand All @@ -35,7 +32,7 @@ jobs:
pytest --mypy stac_validator

- name: Run pre-commit
if: matrix.python-version == 3.8
if: matrix.python-version == 3.10
run: |
pre-commit install
pre-commit autoupdate
Expand Down
36 changes: 17 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
repos:
- repo: https://github.com/PyCQA/flake8
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/timothycrosley/isort
- id: flake8
- repo: https://github.com/timothycrosley/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
language_version: python3.8
- repo: https://github.com/pre-commit/mirrors-mypy
- id: black
language_version: python3.10
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
exclude: /tests/
# --strict
args: [
--no-strict-optional,
--ignore-missing-imports,
--implicit-reexport,
--explicit-package-bases,
]
additional_dependencies: [
"types-attrs",
"types-requests"
]
args:
[
--no-strict-optional,
--ignore-missing-imports,
--implicit-reexport,
--explicit-package-bases,
]
additional_dependencies: ["types-attrs", "types-requests"]
80 changes: 46 additions & 34 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)

## [Unreleased]

## [v3.4.0] - 2024-10-08

### Added

- Added ability to validate response from a /collections endpoint [#220](https://github.com/stac-utils/stac-validator/issues/220)
- Added mypy to pre-commit config ([#229](https://github.com/stac-utils/stac-validator/pull/224))
- Support for stac spec version 1.1.0 [#235](https://github.com/stac-utils/stac-validator/pull/235)

## [v3.3.2] - 2023-11-17

### Added

- Docstrings ([#224](https://github.com/stac-utils/stac-validator/pull/224))

### Changed
### Changed

- Development dependencies removed from runtime dependency list
([#228](https://github.com/stac-utils/stac-check/pull/109))
Expand All @@ -38,13 +41,13 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)

## [v3.2.0] - 2022-09-20

### Added
### Added

- Added ability to check local schemas in item extensions https://github.com/stac-utils/stac-validator/pull/215
- Added an example on validating a dictionary https://github.com/stac-utils/stac-validator/pull/215

### Changed

- Changed 'ValidationError' error type to 'JSONSchemaValidationError' https://github.com/stac-utils/stac-validator/pull/213

## [v3.1.0] - 2022-04-28
Expand Down Expand Up @@ -83,32 +86,38 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
- References to Python 3.6

## [v2.5.0] - 2022-03-10

### Changed

- Split the `--recursive` option into a `--recursive` flag and a `--max-depth` option
- Renamed the entry point from `stac_validator` to `stac-validator`

## [v2.4.3] - 2022-03-10

### Changed

- Add schema caching
- Add schema caching

## [v2.4.2] - 2022-03-02

### Changed

- Loosen pystac version dependency
- Loosen pystac version dependency

## [v2.4.1] - 2022-03-02

### Changed

- Loosen stac-check version dependency
- Loosen stac-check version dependency

## [v2.4.0] - 2022-02-02

### Added

- Linting option in cli to display stac-check generated information
- Linting option in cli to display stac-check generated information

## [v2.3.0] - 2021-08-31 - 2021-11-28

### Added

- Added --links option to validate links on format and a valid response
Expand All @@ -125,6 +134,7 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
- Moved backend to validate.py

## [v2.2.0] - 2021-05-25

### Added

- Added Support for STAC 1.0.0
Expand All @@ -133,17 +143,18 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)

### Changed

- Moved std out to cli so that it doesn't display in pure python applications
- Added Pypi badges to readme
- Moved std out to cli so that it doesn't display in pure python applications
- Added Pypi badges to readme

## [v2.1.0] - 2021-05-06

### Added

- Added more tests for STAC 1.0.0-rc.3
- Added basic support for rc.4
- Add system exit code to CLI. see #144

### Changed
### Changed

- Modified how Lambda CDK is built

Expand All @@ -160,7 +171,7 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)

### Changed

- Pystac is now only being used to identify stac objects. Jsonschema is being used for all other validation.
- Pystac is now only being used to identify stac objects. Jsonschema is being used for all other validation.
- The cli library was changed from Docopt to Click.
- Custom validation was updated to allow for local schemas.

Expand Down Expand Up @@ -196,24 +207,25 @@ 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.2..main>
[v3.3.2]: <https://github.com/sparkgeo/stac-validator/compare/v3.3.1..v3.3.2>
[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>
[v3.0.0]: <https://github.com/sparkgeo/stac-validator/compare/v2.5.0..v3.0.0>
[v2.5.0]: <https://github.com/sparkgeo/stac-validator/compare/v2.4.3..v2.5.0>
[v2.4.3]: <https://github.com/sparkgeo/stac-validator/compare/v2.3.0..v2.4.0>
[v2.4.2]: <https://github.com/sparkgeo/stac-validator/compare/v2.4.1..v2.4.2>
[v2.4.1]: <https://github.com/sparkgeo/stac-validator/compare/v2.4.0..v2.4.1>
[v2.4.0]: <https://github.com/sparkgeo/stac-validator/compare/v2.3.0..v2.4.0>
[v2.3.0]: <https://github.com/sparkgeo/stac-validator/compare/v2.2.0..v2.3.0>
[v2.2.0]: <https://github.com/sparkgeo/stac-validator/compare/v2.1.0..v2.2.0>
[v2.1.0]: <https://github.com/sparkgeo/stac-validator/compare/v2.0.0..v2.1.0>
[v2.0.0]: <https://github.com/sparkgeo/stac-validator/compare/v1.0.1..v2.0.0>
[v1.0.1]: <https://github.com/sparkgeo/stac-validator/compare/v0.5.0..v1.0.1>
[v0.5.0]: <https://github.com/sparkgeo/stac-validator/compare/v0.1.3..v0.5.0>
[v0.1.3]: <https://github.com/sparkgeo/stac-validator/compare/v0.1.1..v0.1.3>
[v0.1.1]: <https://github.com/sparkgeo/stac-validator/compare/v0.1.0..v0.1.1>
[v0.1.0]: <https://github.com/sparkgeo/stac-validator/releases/tag/v0.1.0>
[Unreleased]: https://github.com/sparkgeo/stac-validator/compare/v3.4.0..main
[v3.4.0]: https://github.com/sparkgeo/stac-validator/compare/v3.3.2..v3.4.0
[v3.3.2]: https://github.com/sparkgeo/stac-validator/compare/v3.3.1..v3.3.2
[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
[v3.0.0]: https://github.com/sparkgeo/stac-validator/compare/v2.5.0..v3.0.0
[v2.5.0]: https://github.com/sparkgeo/stac-validator/compare/v2.4.3..v2.5.0
[v2.4.3]: https://github.com/sparkgeo/stac-validator/compare/v2.3.0..v2.4.0
[v2.4.2]: https://github.com/sparkgeo/stac-validator/compare/v2.4.1..v2.4.2
[v2.4.1]: https://github.com/sparkgeo/stac-validator/compare/v2.4.0..v2.4.1
[v2.4.0]: https://github.com/sparkgeo/stac-validator/compare/v2.3.0..v2.4.0
[v2.3.0]: https://github.com/sparkgeo/stac-validator/compare/v2.2.0..v2.3.0
[v2.2.0]: https://github.com/sparkgeo/stac-validator/compare/v2.1.0..v2.2.0
[v2.1.0]: https://github.com/sparkgeo/stac-validator/compare/v2.0.0..v2.1.0
[v2.0.0]: https://github.com/sparkgeo/stac-validator/compare/v1.0.1..v2.0.0
[v1.0.1]: https://github.com/sparkgeo/stac-validator/compare/v0.5.0..v1.0.1
[v0.5.0]: https://github.com/sparkgeo/stac-validator/compare/v0.1.3..v0.5.0
[v0.1.3]: https://github.com/sparkgeo/stac-validator/compare/v0.1.1..v0.1.3
[v0.1.1]: https://github.com/sparkgeo/stac-validator/compare/v0.1.0..v0.1.1
[v0.1.0]: https://github.com/sparkgeo/stac-validator/releases/tag/v0.1.0
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

[read the docs](https://stac-validator.readthedocs.io/en/latest/)


## Validate STAC json files against the [STAC spec](https://github.com/radiantearth/stac-spec).


## Validate STAC json files against the [STAC spec](https://github.com/radiantearth/stac-spec).

```bash
stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/examples/extended-item.json
Expand Down Expand Up @@ -60,7 +57,6 @@ or for local development
pip install -e '.[dev]'
```


The [Makefile](./Makefile) has convenience commands if Make is installed.

```bash
Expand All @@ -81,7 +77,7 @@ make help
| 1.0.0-rc.3 |
| 1.0.0-rc.4 |
| 1.0.0 |

| 1.1.0 |

---

Expand Down Expand Up @@ -146,7 +142,9 @@ docker run stac-validator https://raw.githubusercontent.com/stac-extensions/proj
```

## AWS (CDK)

An example [AWS CDK](https://aws.amazon.com/cdk/) deployment is available in [cdk-deployment](./cdk-deployment/README.md)

```bash
cd cdk-deployment
cdk diff
Expand Down Expand Up @@ -201,29 +199,29 @@ print(stac.message)
```

**Dictionary**

```python
from stac_validator import stac_validator

stac = stac_validator.StacValidate()
stac.validate_dict(dictionary)
print(stac.message)
```

**Item Collection**

```python
from stac_validator import stac_validator

stac = stac_validator.StacValidate()
stac.validate_item_collection_dict(item_collection_dict)
print(stac.message)
```

---

# Testing


```bash
make test
# or
Expand All @@ -233,6 +231,7 @@ pytest -v
See the [tests](./tests/test_stac_validator.py) files for examples on different usages.

---

# Additional Examples

**--core**
Expand Down Expand Up @@ -292,7 +291,7 @@ stac-validator https://raw.githubusercontent.com/radiantearth/stac-spec/master/e
}
]
```

**--recursive**

```bash
Expand Down Expand Up @@ -324,8 +323,9 @@ stac-validator https://spot-canada-ortho.s3.amazonaws.com/catalog.json --recursi
}
]
```

**--item-collection**

```bash
stac-validator https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a/items --item-collection --pages 2
```
```
4 changes: 2 additions & 2 deletions 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.2"
__version__ = "3.4.0"

with open("README.md", "r") as fh:
long_description = fh.read()
Expand All @@ -11,7 +11,7 @@
name="stac_validator",
version=__version__,
author="James Banting, Jonathan Healy",
author_email="jhealy@sparkgeo.com",
author_email="jonathan.d.healy@gmail.com",
description="A package to validate STAC files",
license="Apache-2.0",
classifiers=[
Expand Down
6 changes: 3 additions & 3 deletions stac_validator/stac_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def print_update_message(version: str) -> None:
None
"""
click.secho()
if version != "1.0.0":
if version != "1.1.0":
click.secho(
f"Please upgrade from version {version} to version 1.0.0!", fg="red"
f"Please upgrade from version {version} to version 1.1.0!", fg="red"
)
else:
click.secho("Thanks for using STAC version 1.0.0!", fg="green")
click.secho("Thanks for using STAC version 1.1.0!", fg="green")
click.secho()


Expand Down
2 changes: 2 additions & 0 deletions stac_validator/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"1.0.0-rc.3",
"1.0.0-rc.4",
"1.0.0",
"1.1.0-beta.1",
"1.1.0",
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
]


Expand Down
Loading
Loading