Skip to content

Commit

Permalink
deprecate calling implementation scripts directly
Browse files Browse the repository at this point in the history
  • Loading branch information
mishaschwartz committed Feb 11, 2025
1 parent fc4f257 commit dbd0084
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* move argument parsing for logging options to the implementation code
* fix bug where logging options were being set incorrectly
* rename files to avoid potential naming conflicts with other packages (`logging` and `requests`)

* deprecate calling implementation scripts directly

## [0.6.0](https://github.com/crim-ca/stac-populator/tree/0.6.0) (2024-02-22)

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ setup-pyessv-archive:
@cd $(PYESSV_ARCHIVE_HOME) && git pull

test-cmip6:
python $(IMP_DIR)/CMIP6_UofT/add_CMIP6.py $(STAC_HOST) $(CATALOG)
stac-populator run CMIP6_UofT $(STAC_HOST) $(CATALOG)

del-cmip6:
curl --location --request DELETE '$(STAC_HOST)/collections/CMIP6_UofT'
Expand Down
5 changes: 5 additions & 0 deletions STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import sys
from typing import Any, MutableMapping, Optional, Union
import warnings

from pystac import STACValidationError
from pystac.extensions.datacube import DatacubeExtension
Expand Down Expand Up @@ -129,6 +130,10 @@ def runner(ns: argparse.Namespace) -> int:


def main(*args: str) -> int:
warnings.warn(
"Calling implementation scripts directly is deprecated. Please use the 'stac-populator' CLI instead.",
DeprecationWarning
)
parser = argparse.ArgumentParser()
add_parser_args(parser)
ns = parser.parse_args(args or None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os.path
import sys
from typing import Any, MutableMapping, Optional
import warnings

from requests.sessions import Session

Expand Down Expand Up @@ -70,6 +71,10 @@ def runner(ns: argparse.Namespace) -> int:


def main(*args: str) -> int:
warnings.warn(
"Calling implementation scripts directly is deprecated. Please use the 'stac-populator' CLI instead.",
DeprecationWarning
)
parser = argparse.ArgumentParser()
add_parser_args(parser)
ns = parser.parse_args(args or None)
Expand Down

0 comments on commit dbd0084

Please sign in to comment.