Skip to content

Commit 4ae635f

Browse files
authored
Merge pull request #145 from sparkgeo/dev
Release 2.0.0
2 parents 02e5c61 + bf305c5 commit 4ae635f

File tree

282 files changed

+15420
-5388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+15420
-5388
lines changed

.github/workflows/test-runner.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Test Runner
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
- dev
88

99
jobs:
@@ -12,17 +12,32 @@ jobs:
1212

1313
name: Execute tests
1414
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: [3.6, 3.7, 3.8, 3.9]
1518

1619
steps:
1720

18-
- name: Check out the repo
19-
uses: actions/checkout@v2
20-
21-
- name: Set up Python
22-
uses: actions/setup-python@master
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@main
2324
with:
24-
python-version: 3.8
25+
python-version: ${{ matrix.python-version }}
26+
2527
- name: Run unit tests
2628
run: |
27-
pip install -r requirements.txt
28-
pytest
29+
pip install .
30+
pip install -r requirements-dev.txt
31+
pytest --mypy stac_validator
32+
33+
- name: Run pre-commit
34+
if: matrix.python-version == 3.8
35+
run: |
36+
pre-commit install
37+
pre-commit autoupdate
38+
pre-commit run --all-files
39+
40+
- name: Run tox
41+
run: |
42+
pip install tox
43+
tox -e py

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ venv.bak/
107107
.DS_Store
108108

109109
# lambda file
110-
.zip
110+
*.zip
111111

112112

113113
# IDE
114114
.vscode
115+
116+
cdk-deployment/lambda/stac_validator/
117+
cdk-deployment/build-libraries/libraries.zip
118+
119+
Pipfile*

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://gitlab.com/pycqa/flake8
3-
rev: 3.9.0
3+
rev: 3.9.1
44
hooks:
55
- id: flake8
66
- repo: https://github.com/timothycrosley/isort

CHANGELOG.md

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,51 @@ 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-
## [1.0.0] - 2020-09-01
7+
## [v2.0.0] - 2021-04-28
88

99
### Added
10-
- The ability (--update) to update a STAC object. This is based on migrate from pystac. It doesn't always work. Frequently it does. Presently it tries to update to version 1.0.0-beta.2
11-
- A function to display what has changed via --update. This is represented in the logs as diff.
10+
11+
- Stac versions from 0.8.0 --> 1.0.0-rc.3 are now supported.
12+
- Version is detected automatically.
13+
- Default validation attempts to validate a core Stac object as well as any extensions.
14+
- Recursion which was previously handled by Pystac is now done natively with both a depth option to limit the time it takes to validate and a verbose option to display output as individual objects are being validated one by one.
15+
- Added AWS CDK deployment example.
16+
- Added FastAPI routing to CDK deployment.
17+
18+
### Changed
19+
20+
- Pystac is now only being used to identify stac objects. Jsonschema is being used for all other validation.
21+
- The cli library was changed from Docopt to Click.
22+
- Custom validation was updated to allow for local schemas.
23+
24+
### Removed
25+
26+
- The force, legacy, version, and update methods were removed.
27+
- stac versions where a `stac_version` field is not present are
28+
no longer supported.
29+
30+
## [1.0.0] - 2020-09-01
31+
32+
### Added
33+
34+
- The ability (--update) to update a STAC object. This is based on migrate from pystac. It doesn't always work. Frequently it does. Presently it tries to update to version 1.0.0-beta.2
35+
- A function to display what has changed via --update. This is represented in the logs as diff.
1236
- A --force option. This updates the stac_version to v0.9.0 and adds an id field as older STAC versions seem to be missing this sometimes. This seems to be especially effective with objects as old as 0.6.0 and 0.6.1
13-
- An option (--version) to specify and set a specific version to validate against.
14-
- The --extension option. This uses pystac validation to validate against various extension schemas.
15-
- The ExtensionError, as inputing a bad value for extension caused validation in pystac to be bypassed.
16-
- The VersionError, as inputing a bad value for version was causing validation in pystac to be bypassed as well.
37+
- An option (--version) to specify and set a specific version to validate against.
38+
- The --extension option. This uses pystac validation to validate against various extension schemas.
39+
- The ExtensionError, as inputing a bad value for extension caused validation in pystac to be bypassed.
40+
- The VersionError, as inputing a bad value for version was causing validation in pystac to be bypassed as well.
1741
- The --recursive option. This uses validate_all from pystac to recursively search the links from a catalog or collection.
1842
- The ability (--core) to validate against the core only. This is provided by pystac.
1943
- (--legacy). This validates agains schemas from v0.4.0 to v1.0.0-beta.1 Legacy must be accompanied by --version.
2044
- valid_versions for --legacy are: 'v0.4.0', 'v0.4.1', 'v0.5.0', 'v0.5.1', 'v0.5.2', 'v0.6.0', 'v0.6.0-rc1',
21-
'v0.6.0-rc2', 'v0.6.1', 'v0.6.2', 'v0.7.0', 'v0.8.0', 'v0.8.0-rc1', 'v0.8.1', 'v0.9.0',
22-
'v0.9.0-rc1', 'v0.9.0-rc2', and 'v1.0.0-beta.1'
23-
- (--custom). Validate against a custom schema
24-
- Tests to explore new functionality.
45+
'v0.6.0-rc2', 'v0.6.1', 'v0.6.2', 'v0.7.0', 'v0.8.0', 'v0.8.0-rc1', 'v0.8.1', 'v0.9.0',
46+
'v0.9.0-rc1', 'v0.9.0-rc2', and 'v1.0.0-beta.1'
47+
- (--custom). Validate against a custom schema
48+
- Tests to explore new functionality.
2549

2650
### Changed
51+
2752
- Updated core validation to use validation from pystac instead of jsonchema.
28-
- 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.
29-
- Logging. Various additions were made here depending on the options selected. This was done to help assist people to update their STAC collections.
53+
- 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.
54+
- Logging. Various additions were made here depending on the options selected. This was done to help assist people to update their STAC collections.

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM python:3.8-slim-buster
2+
WORKDIR /code
3+
COPY . /code/
4+
5+
RUN pip install . && \
6+
stac_validator --help
7+
8+
ENTRYPOINT ["stac_validator"]

Makefile

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
1-
install:
1+
help: ## Show this help
2+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
3+
4+
install: ## Install using pip
25
pip install .
36

4-
code-check:
7+
install-edit: ## Install using pip in edit mode
8+
pip install --editable .["test"]
9+
10+
code-check: ## Check and format code using pre-commit
511
pre-commit install
6-
pre-commit update
12+
pre-commit autoupdate
713
pre-commit run --all-files
814

9-
test:
10-
pytest --mypy --cov --cov-report=html --verbose
15+
test: ## Run the tests
16+
pytest --verbose
17+
pytest --mypy stac_validator
18+
19+
build: ## Build a Docker container
20+
docker build -t stac_validator:2.0.0 .
21+
22+
build-libraries: # Build the libraries for layers. Used internally
23+
docker build -f "cdk-deployment/build-libraries/Dockerfile-libraries" -t lambdalayer:latest .
24+
docker run -d -it --name lambdalayer lambdalayer:latest
25+
docker cp lambdalayer:code/libraries.zip ./cdk-deployment/build-libraries
26+
docker stop lambdalayer
27+
docker rm lambdalayer
28+
docker rmi lambdalayer
29+
30+
build-cdk: ## Build the libraries in preperation for CDK deployment
31+
make build-libraries
32+
33+
build-tox: ## Test stac_validator on multiple Python versions
34+
docker build -f tox/Dockerfile-tox -t stac_tox .
35+
36+
run: ## Run the Docker Container and enter into bash
37+
docker run -it --entrypoint /bin/bash stac_validator:2.0.0

0 commit comments

Comments
 (0)