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

Update all minor versions (minor) #2007

Merged
merged 3 commits into from
Feb 4, 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
2 changes: 2 additions & 0 deletions .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ignore-patterns:
- ^examples/.*.py

pylint:
options:
extension-pkg-allow-list: cairo
disable:
- cyclic-import # see: https://github.com/PyCQA/pylint/issues/850

Expand Down
42 changes: 21 additions & 21 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ tc-viewer = "tilecloud.scripts.tc_viewer:main"
python = ">=3.10,<3.13"
azure-storage-blob = { version = "12.24.1", optional = true }
azure-identity = { version = "1.19.0", optional = true }
boto3 = { version = "1.35.99", optional = true }
boto3 = { version = "1.36.12", optional = true }
bottle = "0.13.2"
prometheus_client = { version = "0.21.1", optional = true }
Pillow = "11.1.0"
Expand All @@ -71,9 +71,9 @@ prometheus = ["prometheus_client"]
all = ["azure-storage-blob", "azure-identity", "boto3", "pyramid", "redis", "prometheus_client"]

[tool.poetry.group.dev.dependencies]
prospector = { version = "1.13.3", extras = ["with_bandit", "with_mypy", "with_pyroma", "with_ruff"] }
prospector = { version = "1.14.1", extras = ["with_bandit", "with_mypy", "with_pyroma", "with_ruff"] }
prospector-profile-duplicated = "1.10.4"
prospector-profile-utils = "1.15.1"
prospector-profile-utils = "1.17.0"
pytest = "8.3.4"
pytest-cov = "6.0.0"
types-boto = "2.49.18.20241019"
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
poetry==2.0.1
poetry-plugin-export==1.8.0
poetry-plugin-export==1.9.0
poetry-plugin-tweak-dependencies-version==1.5.2
poetry-dynamic-versioning==1.5.2
poetry-dynamic-versioning==1.7.1
poetry-plugin-drop-python-upper-constraint==0.1.0
2 changes: 1 addition & 1 deletion tilecloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def load(name: str, allows_no_contenttype: bool = False) -> "TileStore": # prag

from tilecloud.store.bsddb import BSDDBTileStore

return BSDDBTileStore(bsddb.hashopen(name))
return BSDDBTileStore(bsddb.hashopen(name)) # pylint: disable=no-member
if ext == ".mbtiles":
import sqlite3

Expand Down
29 changes: 16 additions & 13 deletions tilecloud/lib/sqlite3_.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

from tilecloud import TileCoord

# For me this class can't works!
# flake8: noqa


def _query(connection: Connection, *args: Any) -> Cursor:
cursor = connection.cursor()
Expand All @@ -28,51 +31,51 @@ def __init__(
) -> None:
self.connection = connection
self.commit = commit
_query(self.connection, self.CREATE_TABLE_SQL) # type: ignore
_query(self.connection, self.CREATE_TABLE_SQL) # pylint: disable=no-member # type: ignore[attr-defined]
if self.commit:
self.connection.commit()
# Convert a Dict to a Mapping
self.update({k: v for k, v in kwargs.items()}) # pylint: disable=unnecessary-comprehension

def __contains__(self, key: Union[str, TileCoord]) -> bool: # type: ignore
return _query(self.connection, self.CONTAINS_SQL, self._packkey(key)).fetchone()[0] # type: ignore
def __contains__(self, key: Union[str, TileCoord]) -> bool:
return _query(self.connection, self.CONTAINS_SQL, self._packkey(key)).fetchone()[0] # pylint: disable=no-member # type: ignore[attr-defined]

def __delitem__(self, key: Union[str, TileCoord]) -> None:
_query(self.connection, self.DELITEM_SQL, self._packkey(key)) # type: ignore
_query(self.connection, self.DELITEM_SQL, self._packkey(key)) # pylint: disable=no-member # type: ignore[attr-defined]
if self.commit:
self.connection.commit()

def __getitem__(self, key: Union[str, TileCoord]) -> Optional[bytes]:
row = _query(self.connection, self.GETITEM_SQL, self._packkey(key)).fetchone() # type: ignore
row = _query(self.connection, self.GETITEM_SQL, self._packkey(key)).fetchone() # pylint: disable=no-member # type: ignore[attr-defined]
if row is None:
return None
return self._unpackvalue(row)

def __iter__(self) -> Iterator[str]:
return map(self._unpackkey, _query(self.connection, self.ITER_SQL)) # type: ignore
return map(self._unpackkey, _query(self.connection, self.ITER_SQL)) # pylint: disable=no-member # type: ignore[attr-defined]

def __len__(self) -> int:
return _query(self.connection, self.LEN_SQL).fetchone()[0] # type: ignore
return _query(self.connection, self.LEN_SQL).fetchone()[0] # pylint: disable=no-member # type: ignore[attr-defined]

def __setitem__(self, key: Union[str, TileCoord], value: Any) -> None:
_query(self.connection, self.SETITEM_SQL, self._packitem(key, value)) # type: ignore
_query(self.connection, self.SETITEM_SQL, self._packitem(key, value)) # pylint: disable=no-member # type: ignore[attr-defined]
if self.commit:
self.connection.commit()

def iteritems(self) -> Iterator[Cursor]:
return map(self._unpackitem, _query(self.connection, self.ITERITEMS_SQL)) # type: ignore
return map(self._unpackitem, _query(self.connection, self.ITERITEMS_SQL)) # pylint: disable=no-member # type: ignore[attr-defined]

def itervalues(self) -> Iterator[tuple[bytes]]:
return map(self._unpackvalue, _query(self.connection, self.ITERVALUES_SQL)) # type: ignore
return map(self._unpackvalue, _query(self.connection, self.ITERVALUES_SQL)) # pylint: disable=no-member # type: ignore[attr-defined]

def keys(self) -> KeysView[str]:
return set(iter(self)) # type: ignore
return set(iter(self))

def _packitem(self, key: TileCoord, value: Optional[bytes]) -> tuple[int, int, int, Optional[memoryview]]:
return (key, value) # type: ignore
return (key, value)

def _packkey(self, key: TileCoord) -> tuple[int, int, int]:
return (key,) # type: ignore
return (key,)

@staticmethod
def _packvalue(value: Any) -> tuple[Any]: # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion tilecloud/store/mbtiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(
self, connection: Connection, commit: bool = True, tilecoord_in_topleft: bool = False, **kwargs: Any
) -> None:
self.connection = connection
self.metadata = Metadata(self.connection, commit)
self.metadata = Metadata(self.connection, commit) # pylint: disable=no-member
self.tiles = Tiles(tilecoord_in_topleft, self.connection, commit)
if "content_type" not in kwargs and "format" in self.metadata:
kwargs["content_type"] = mimetypes.types_map.get("." + self.metadata["format"]) # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion tilecloud/store/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(
**kwargs: Any,
) -> None:
self._s3_host = s3_host
self._client: Optional[botocore.client.S3] = None
self._client: Optional[botocore.client.S3] = None # pylint: disable=no-member
self.bucket = bucket
self.tilelayout = tilelayout
self.dry_run = dry_run
Expand Down
2 changes: 1 addition & 1 deletion tilecloud/store/tilejson.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, tile_json: str, urls_key: str = "tiles", **kwargs: Any):
zmin, zmax = tile.get("minzoom", 0), tile.get("maxzoom", 22)
if "bounds" in tile:
lonmin, latmin, lonmax, latmax = tile["bounds"]
bounding_pyramid = BoundingPyramid.from_wgs84( # type: ignore
bounding_pyramid = BoundingPyramid.from_wgs84( # type: ignore[attr-defined] # pylint: disable=no-member
zmin, zmax, lonmin, lonmax, latmin, latmax
)
else:
Expand Down