From 7d5b13c582d840cf7ab0df02b586e38f4a224d20 Mon Sep 17 00:00:00 2001 From: jkeifer Date: Tue, 7 Nov 2023 09:20:18 -0800 Subject: [PATCH 1/3] split dev deps from runtime deps --- .github/workflows/test-runner.yml | 4 +- CHANGELOG.md | 59 +++++++++++++++------------ README.md | 68 +++++++++++++++---------------- setup.py | 10 +++-- 4 files changed, 75 insertions(+), 66 deletions(-) diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml index 8c3af92..cd3d8c2 100644 --- a/.github/workflows/test-runner.yml +++ b/.github/workflows/test-runner.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: python-version: [3.8, 3.9] - + steps: - uses: actions/checkout@v2 @@ -30,5 +30,5 @@ jobs: - name: Run unit tests run: | - pip install . + pip install '.[dev]' pytest -v diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d362ca..dc02721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,18 +6,23 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) ## Unreleased +### Changed + +- Development dependencies removed from runtime dependency list + ([#109](https://github.com/stac-utils/stac-check/pull/109)) + ## [v1.3.2] - 2023-03-23 -## Added +### Added - Ability to lint dictionaries https://github.com/stac-utils/stac-check/pull/94 - Docstrings and pdoc api documents -## Fixed +### Fixed - Fixed the check_catalog_file_name() method to only work on static catalogs https://github.com/stac-utils/stac-check/pull/94 - Jsonschema version to use a released version https://github.com/stac-utils/stac-check/pull/105 ## [v1.3.1] - 2022-10-05 -## Changed -- Changed pin on stac-validator to >=3.1.0 from ==3.2.0 - +### Changed +- Changed pin on stac-validator to >=3.1.0 from ==3.2.0 + ## [v1.3.0] - 2022-09-20 ### Added - recursive mode lints assets https://github.com/stac-utils/stac-check/pull/84 @@ -39,7 +44,7 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) - Make it easier to export linting messages - Set stac-validator version to 2.4.0 ### Fixed -- Fix self-link test +- Fix self-link test ## [v1.0.1] - 2022-02-20 ### Changed @@ -61,7 +66,7 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) - Check for bloated metadata, too many fields in properties - Check for geometry field, recommend that STAC not be used for non-spatial data -### Changed +### Changed - Changed bloated links check to a boolean to mirror bloated metadata ## [v0.1.2] - 2022-01-17 - 2022-01-22 @@ -70,19 +75,19 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) - Check for unlocated items, bbox should be set to null if geometry is ## [v0.1.1] - 2021-11-26 - 2021-12-12 -### Added +### Added - Added github actions to test and push to pypi -- Added makefile, dockerfile +- Added makefile, dockerfile -### Changed -- Removed pipenv +### Changed +- Removed pipenv ## [v0.1.0] - 2021-11-26 - 2021-12-05 ### Added - Best practices - searchable identifiers - lowercase, numbers, '_' or '-' for id names https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers -- Best practices ensure item ids don't contain ':' or '/' characters +- Best practices ensure item ids don't contain ':' or '/' characters https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#item-ids - Best practices check for item ids to see if they match file names - Add url support, check for valid urls, validate urls @@ -91,18 +96,18 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/) - Move stac-validator 2.3.0 into repository - Best practices check for too many links in object - Best practices check for summaries in collections -- Validation from stac-validator 2.3.0 -- Links and assets validation checks - -[Unreleased]: https://github.com/stac-utils/stac-check/compare/v1.3.2...main -[v1.3.2]: https://github.com/stac-utils/stac-check/compare/v1.3.1...v1.3.2 -[v1.3.1]: https://github.com/stac-utils/stac-check/compare/v1.3.0...v1.3.1 -[v1.3.0]: https://github.com/stac-utils/stac-check/compare/v1.2.0...v1.3.0 -[v1.2.0]: https://github.com/stac-utils/stac-check/compare/v1.1.2...v1.2.0 -[v1.1.2]: https://github.com/stac-utils/stac-check/compare/v1.0.1...v1.1.2 -[v1.0.1]: https://github.com/stac-utils/stac-check/compare/v0.2.0...v1.0.1 -[v0.2.0]: https://github.com/stac-utils/stac-check/compare/v0.1.3...v0.2.0 -[v0.1.3]: https://github.com/stac-utils/stac-check/compare/v0.1.2...v0.1.3 -[v0.1.2]: https://github.com/stac-utils/stac-check/compare/v0.1.1...v0.1.2 -[v0.1.1]: https://github.com/stac-utils/stac-check/compare/v0.1.0...v0.1.1 -[v0.1.0]: https://github.com/stac-utils/stac-check/releases/tag/v0.1.0 +- Validation from stac-validator 2.3.0 +- Links and assets validation checks + +[Unreleased]: https://github.com/stac-utils/stac-check/compare/v1.3.2...main +[v1.3.2]: https://github.com/stac-utils/stac-check/compare/v1.3.1...v1.3.2 +[v1.3.1]: https://github.com/stac-utils/stac-check/compare/v1.3.0...v1.3.1 +[v1.3.0]: https://github.com/stac-utils/stac-check/compare/v1.2.0...v1.3.0 +[v1.2.0]: https://github.com/stac-utils/stac-check/compare/v1.1.2...v1.2.0 +[v1.1.2]: https://github.com/stac-utils/stac-check/compare/v1.0.1...v1.1.2 +[v1.0.1]: https://github.com/stac-utils/stac-check/compare/v0.2.0...v1.0.1 +[v0.2.0]: https://github.com/stac-utils/stac-check/compare/v0.1.3...v0.2.0 +[v0.1.3]: https://github.com/stac-utils/stac-check/compare/v0.1.2...v0.1.3 +[v0.1.2]: https://github.com/stac-utils/stac-check/compare/v0.1.1...v0.1.2 +[v0.1.1]: https://github.com/stac-utils/stac-check/compare/v0.1.0...v0.1.1 +[v0.1.0]: https://github.com/stac-utils/stac-check/releases/tag/v0.1.0 diff --git a/README.md b/README.md index 57158a4..9208199 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ The intent of this project is to provide a validation tool that also follows the --- ### Install -`$ pip install stac-check` - -or for local development +`$ pip install stac-check` + +or for local development + +`$ pip install -e '.[dev]'` -`$ pip install -e .` - --- ### CLI Usage ``` @@ -31,10 +31,10 @@ Options: --help Show this message and exit. Show this message and exit. ``` --- -### Docker +### Docker ``` -$ make build +$ make build $ make shell ``` --- @@ -50,14 +50,14 @@ for k, v in linter.create_best_practices_dict().items(): ``` --- ### CLI Examples - + ``` stac-check https://raw.githubusercontent.com/stac-utils/pystac/main/tests/data-files/examples/0.9.0/collection-spec/examples/landsat-collection.json --recursive ``` ``` - ____ ____ __ ___ ___ _ _ ____ ___ __ _ + ____ ____ __ ___ ___ _ _ ____ ___ __ _ / ___)(_ _)/ _\ / __)___ / __)/ )( \( __)/ __)( / ) -\___ \ )( / \( (__(___)( (__ ) __ ( ) _)( (__ ) ( +\___ \ )( / \( (__(___)( (__ ) __ ( ) _)( (__ ) ( (____/ (__)\_/\_/ \___) \___)\_)(_/(____)\___)(__\_) - + stac-check: STAC spec validaton and linting tool Please upgrade from version 0.9.0 to version 1.0.0! @@ -72,10 +72,10 @@ Asset 1 Validated: https://raw.githubusercontent.com/stac-utils/pystac/main/test Valid COLLECTION: True -Schemas validated: +Schemas validated: https://cdn.staclint.com/v0.9.0/collection.json -STAC Best Practices: +STAC Best Practices: Object should be called 'collection.json' not 'landsat-collection.json' A STAC collection should contain a summaries field @@ -89,7 +89,7 @@ This object has 4 links Asset 2 Validated: https://landsat-stac.s3.amazonaws.com/landsat-8-l1/paths/catalog.json Valid: False -Schemas validated: +Schemas validated: https://cdn.staclint.com/v0.9.0/collection.json Error Type: JSONDecodeError Error Message: Expecting value: line 1 column 1 (char 0) @@ -106,12 +106,12 @@ Validator: stac-validator 2.3.0 Valid ITEM: True -Schemas validated: +Schemas validated: https://cdn.staclint.com/v0.9.0/extension/eo.json https://cdn.staclint.com/v0.9.0/extension/view.json https://cdn.staclint.com/v0.9.0/item.json -STAC Best Practices: +STAC Best Practices: Item name 'LC81530252014153LGN00' should only contain Searchable identifiers Identifiers should consist of only lowercase characters, numbers, '_', and '-' https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers @@ -124,7 +124,7 @@ STAC Best Practices: This object has 4 links -``` stac-check sample_files/1.0.0/core-item.json --assets``` +``` stac-check sample_files/1.0.0/core-item.json --assets```
 stac-check: STAC spec validaton and linting tool
 
@@ -134,10 +134,10 @@ Validator: stac-validator 2.3.0
 
 Valid ITEM: True
 
-Schemas validated: 
+Schemas validated:
     https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json
 
-STAC Best Practices: 
+STAC Best Practices:
     Item name '20201211_223832_CS2' should only contain Searchable identifiers
     Identifiers should consist of only lowercase characters, numbers, '_', and '-'
     https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers
@@ -151,15 +151,15 @@ STAC Best Practices:
 
 No ASSET format errors!
 
-ASSET request errors: 
+ASSET request errors:
     http://cool-sat.com/catalog/20201211_223832_CS2/20201211_223832_CS2.EPH
 
 This object has 4 links
 
- -``` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets``` + +``` stac-check sample_files/1.0.0/core-item-bad-links.json --links --assets```
 stac-check: STAC spec validaton and linting tool
 
@@ -169,10 +169,10 @@ Validator: stac-validator 2.3.0
 
 Valid ITEM: True
 
-Schemas validated: 
+Schemas validated:
     https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json
 
-STAC Best Practices: 
+STAC Best Practices:
     Item name '20201211_223832_CS2' should only contain Searchable identifiers
     Identifiers should consist of only lowercase characters, numbers, '_', and '-'
     https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#searchable-identifiers
@@ -184,24 +184,24 @@ STAC Best Practices:
     A link to 'self' in links is strongly recommended
 
 
-ASSET format errors: 
+ASSET format errors:
     https:/storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg
 
-ASSET request errors: 
+ASSET request errors:
     https:/storage.googleapis.com/open-cogs/stac-examples/20201211_223832_CS2.jpg
     http://cool-sat.com/catalog/20201211_223832_CS2/20201211_223832_CS2.EPH
 
-LINK format errors: 
+LINK format errors:
     http:/remotdata.io/catalog/20201211_223832_CS2/index.html
 
-LINK request errors: 
+LINK request errors:
     http://catalog/collection.json
     http:/remotdata.io/catalog/20201211_223832_CS2/index.html
 
 This object has 4 links
 
- -``` stac-check sample_files/0.9.0/bad-item.json``` + +``` stac-check sample_files/0.9.0/bad-item.json```
 stac-check: STAC spec validaton and linting tool
 
@@ -211,15 +211,15 @@ Validator: stac-validator 2.3.0
 
 Valid : False
 
-Schemas validated: 
+Schemas validated:
     https://cdn.staclint.com/v0.9.0/item.json
 
-STAC Best Practices: 
+STAC Best Practices:
     A link to 'self' in links is strongly recommended
 
-Validation error type: 
+Validation error type:
     ValidationError
-Validation error message: 
+Validation error message:
     'id' is a required property of the root of the STAC object
 
 This object has 5 links
diff --git a/setup.py b/setup.py
index 793da63..e6d4257 100644
--- a/setup.py
+++ b/setup.py
@@ -18,12 +18,16 @@
         "click>=8.0.0",
         "requests>=2.19.1",
         "jsonschema>=3.1.2",
-        "pytest",
         "stac-validator>=3.1.0",
         "PyYAML",
         "python-dotenv",
-        "types-setuptools",
     ],
+    extras_require={
+        "dev": [
+            "pytest",
+            "types-setuptools",
+        ],
+    },
     entry_points={
         'console_scripts': ['stac-check=stac_check.cli:main']
     },
@@ -34,4 +38,4 @@
     long_description_content_type="text/markdown",
     python_requires=">=3.7",
     tests_require=["pytest"]
-)
\ No newline at end of file
+)

From aae77fe22c72c40ebe177adf4e8a1359f7b37cde Mon Sep 17 00:00:00 2001
From: Jonathan Healy 
Date: Fri, 17 Nov 2023 17:54:45 +0800
Subject: [PATCH 2/3] Update .github/workflows/test-runner.yml

Co-authored-by: Phil Varner 
---
 .github/workflows/test-runner.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/test-runner.yml b/.github/workflows/test-runner.yml
index cd3d8c2..011f62a 100644
--- a/.github/workflows/test-runner.yml
+++ b/.github/workflows/test-runner.yml
@@ -18,7 +18,7 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: [3.8, 3.9]
+        python-version: ["3.8", "3.9", "3.10", "3.11"]
 
     steps:
 

From 0e290be030186711ec89c27d24e9622d450b652f Mon Sep 17 00:00:00 2001
From: Jonathan Healy 
Date: Fri, 17 Nov 2023 17:54:54 +0800
Subject: [PATCH 3/3] Update setup.py

Co-authored-by: Phil Varner 
---
 setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index e6d4257..32f34e6 100644
--- a/setup.py
+++ b/setup.py
@@ -36,6 +36,6 @@
     license="MIT",
     long_description=long_description,
     long_description_content_type="text/markdown",
-    python_requires=">=3.7",
+    python_requires=">=3.8",
     tests_require=["pytest"]
 )