Skip to content

Commit

Permalink
Prepare for release (#538)
Browse files Browse the repository at this point in the history
* update version and changelog

* update precommit hooks

* Update CHANGELOG.MD

Co-authored-by: Matic Lubej <[email protected]>

---------

Co-authored-by: Matic Lubej <[email protected]>
  • Loading branch information
zigaLuksic and mlubej authored Aug 13, 2024
1 parent 6634bdd commit 4f7074a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ repos:
- id: debug-statements

- repo: https://github.com/psf/black
rev: 24.4.0
rev: 24.8.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.4.1"
rev: "v0.5.7"
hooks:
- id: ruff

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
rev: 1.8.7
hooks:
- id: nbqa-black
- id: nbqa-ruff
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [Version 3.10.3] - 2024-13-08

- Monitoring a batch job now concludes if the batch job is cancelled.
- The monitoring function now waits for the status of the batch job to change (even if all tiles have completed) before finalization in order to return the correct status.


## [Version 3.10.2] - 2024-24-04

- Added `max_retries` parameter to `SHConfig` class. It controls how many times the client will attempt to re-download before raising `OutOfRequestsException`. It is set to `None` by default, in which case it never stops trying. Contributed by @Regan-Koopmans.
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ preview = true
[tool.ruff]
line-length = 120
target-version = "py38"
select = [
lint.select = [
"F", # pyflakes
"E", # pycodestyle
"W", # pycodestyle
Expand Down Expand Up @@ -143,15 +143,15 @@ select = [
"RUF", # ruff rules
]
fix = true
fixable = [
lint.fixable = [
"I", # sort imports
"F401", # remove redundant imports
"UP007", # use new-style union type annotations
"UP006", # use new-style built-in type annotations
"UP037", # remove quotes around types when not necessary
"FA100", # import future annotations where necessary (not autofixable ATM)
]
ignore = [
lint.ignore = [
"C408", # complains about `dict()` calls, we use them to avoid too many " in the code
"SIM108", # tries to aggresively inline `if`, not always readable
"COM812", # trailing comma missing, fights with black
Expand All @@ -162,11 +162,11 @@ ignore = [
"B028", # always demands a stacklevel argument when warning
"PT011", # complains for `pytest.raises(ValueError)` but we use it a lot
]
per-file-ignores = { "__init__.py" = ["F401"], "conf.py" = ["FA100"] }
lint.per-file-ignores = { "__init__.py" = ["F401"], "conf.py" = ["FA100"] }
exclude = [".git", "__pycache__", "build", "dist", "sentinelhub/aws/*"]


[tool.ruff.isort]
[tool.ruff.lint.isort]
section-order = [
"future",
"standard-library",
Expand Down
2 changes: 1 addition & 1 deletion sentinelhub/_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version of the sentinelhub package."""

__version__ = "3.10.2"
__version__ = "3.10.3"
8 changes: 4 additions & 4 deletions sentinelhub/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __new__(mcs, cls, bases, classdict): # type: ignore[no-untyped-def] # noqa:

return super().__new__(mcs, cls, bases, classdict)

def __call__(cls, crs_value, *args, **kwargs): # type: ignore[no-untyped-def] # noqa: N805
def __call__(cls, crs_value, *args, **kwargs): # type: ignore[no-untyped-def]
"""This is executed whenever CRS('something') is called"""
# pylint: disable=signature-differs
crs_value = cls._parse_crs(crs_value)
Expand Down Expand Up @@ -201,7 +201,7 @@ def is_utm(self) -> bool:
"""
return self.name.startswith("UTM")

@functools.lru_cache(maxsize=128) # noqa: B019
@functools.lru_cache(maxsize=128)
def projection(self) -> pyproj.Proj:
"""Returns a projection in form of pyproj class.
Expand All @@ -212,7 +212,7 @@ def projection(self) -> pyproj.Proj:
"""
return pyproj.Proj(self._get_pyproj_projection_def(), preserve_units=True)

@functools.lru_cache(maxsize=128) # noqa: B019
@functools.lru_cache(maxsize=128)
def pyproj_crs(self) -> pyproj.CRS:
"""Returns a pyproj CRS class.
Expand All @@ -223,7 +223,7 @@ def pyproj_crs(self) -> pyproj.CRS:
"""
return pyproj.CRS(self._get_pyproj_projection_def())

@functools.lru_cache(maxsize=512) # noqa: B019
@functools.lru_cache(maxsize=512)
def get_transform_function(self, other: CRS, always_xy: bool = True) -> Callable[..., tuple]:
"""Returns a function for transforming geometrical objects from one CRS to another. The function will support
transformations between any objects that pyproj supports.
Expand Down
4 changes: 2 additions & 2 deletions tests/download/test_sentinelhub_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ def test_session_caching_and_clearing(
client_object: SentinelHubDownloadClient | type[SentinelHubDownloadClient], session: SentinelHubSession
) -> None:
client_object.clear_cache()
assert {} == SentinelHubDownloadClient._CACHED_SESSIONS
assert SentinelHubDownloadClient._CACHED_SESSIONS == {}

client_object.cache_session(session)
assert len(SentinelHubDownloadClient._CACHED_SESSIONS) == 1
assert list(SentinelHubDownloadClient._CACHED_SESSIONS.values()) == [session]

client_object.clear_cache()
assert {} == SentinelHubDownloadClient._CACHED_SESSIONS
assert SentinelHubDownloadClient._CACHED_SESSIONS == {}


@pytest.mark.sh_integration()
Expand Down

0 comments on commit 4f7074a

Please sign in to comment.