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

fix tests to allow for variable STAC versions in output #73

Merged
merged 5 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 2 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
* 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`)

* enforce versions for dependencies so that new installs won't fail unexpectedly
* update tests to allow for a variable `stac_version` field in STAC item and collections

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

Expand Down
33 changes: 16 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ version = "0.6.0"
description = "Utility to populate STAC Catalog, Collections and Items from various dataset/catalog sources."
requires-python = ">=3.10"
dependencies = [
"colorlog",
"pyyaml",
"siphon",
"pystac",
"xncml>=0.3.1", # python 3.12 support
"pydantic>=2",
"pyessv",
"requests",
"lxml",
"colorlog~=6.9",
"pyyaml~=6.0",
"siphon~=0.10",
"pystac~=1.12.1",
"xncml~=0.3", # python 3.12 support
"pydantic~=2.10",
"pyessv~=0.9",
"requests~=2.32",
"lxml~=5.3",
]
readme = "README.md"
license = { file = "LICENSE" }
Expand Down Expand Up @@ -162,12 +162,11 @@ Changelog = "https://github.com/crim-ca/stac-populator/blob/master/CHANGES.md"

[project.optional-dependencies]
dev = [
"pytest",
"pytest-cov",
"coverage",
"responses",
"bump-my-version",
"jsonschema",
"pystac[validation]>=1.9.0"
"pytest~=8.3",
"pytest-cov~=6.0",
"coverage~=7.6",
"responses~=0.25",
"bump-my-version~=0.32",
"jsonschema~=4.23",
"pystac[validation]~=1.12.1"
]

5 changes: 3 additions & 2 deletions tests/test_standalone_stac_item.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import pystac
import pytest
import requests
import os
Expand Down Expand Up @@ -49,7 +50,7 @@ def test_standalone_stac_item_thredds_ncml():

ref_file = os.path.join(CUR_DIR, "data/stac_item_testdata_xclim_cmip6_ncml.json")
with open(ref_file, mode="r", encoding="utf-8") as ff:
reference = json.load(ff)
reference = pystac.Item.from_dict(json.load(ff)).to_dict()

assert stac_item.to_dict() == reference

Expand Down Expand Up @@ -85,6 +86,6 @@ def test_cmip6_stac_thredds_catalog_parsing():

ref_file = os.path.join(CUR_DIR, "data/stac_collection_testdata_xclim_cmip6_catalog.json")
with open(ref_file, mode="r", encoding="utf-8") as ff:
reference = json.load(ff)
reference = pystac.Collection.from_dict(json.load(ff)).to_dict()

assert result == reference