Skip to content

Commit bb1cbd6

Browse files
authored
Merge pull request #211 from stac-utils/v3.1.0
update to version 3.1.0
2 parents f8647f8 + af95625 commit bb1cbd6

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
66

77
## Unreleased
88

9+
## [v3.1.0] - 2022-04-28
10+
911
### Added
1012

11-
- Added core linting messages from stac-check to stac-validator messages https://github.com/stac-utils/stac-validator/pull/201/
13+
- Added update stac version message to cli output https://github.com/stac-utils/stac-validator/pull/211
1214

1315
### Fixed
1416

setup.py

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

33
from setuptools import setup
44

5-
__version__ = "3.0.0"
5+
__version__ = "3.1.0"
66

77
with open("README.md", "r") as fh:
88
long_description = fh.read()
@@ -34,6 +34,7 @@
3434
"requests>=2.19.1",
3535
"jsonschema>=3.2.0",
3636
"click>=8.0.0",
37+
"types-setuptools",
3738
],
3839
packages=["stac_validator"],
3940
entry_points={

stac_validator/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
__version__ = "3.0.0"

stac_validator/stac_validator.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@
22
import sys
33

44
import click # type: ignore
5+
import pkg_resources
56

67
from .validate import StacValidate
78

89

10+
def print_update_message(version):
11+
click.secho()
12+
if version != "1.0.0":
13+
click.secho(
14+
f"Please upgrade from version {version} to version 1.0.0!", fg="red"
15+
)
16+
else:
17+
click.secho("Thanks for using STAC version 1.0.0!", fg="green")
18+
click.secho()
19+
20+
921
@click.command()
1022
@click.argument("stac_file")
1123
@click.option(
@@ -49,7 +61,7 @@
4961
default="",
5062
help="Save full recursive output to log file (local filepath).",
5163
)
52-
@click.version_option(version="3.0.0")
64+
@click.version_option(version=pkg_resources.require("stac-validator")[0].version)
5365
def main(
5466
stac_file,
5567
recursive,
@@ -81,6 +93,8 @@ def main(
8193
valid = stac.run()
8294

8395
message = stac.message
96+
if "version" in message[0]:
97+
print_update_message(message[0]["version"])
8498

8599
if no_output is False:
86100
click.echo(json.dumps(message, indent=4))

0 commit comments

Comments
 (0)