Skip to content

Commit

Permalink
remove useless <3.9 dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jan 28, 2025
1 parent ec83f59 commit 3fc6e48
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies = [
"rasterio>=1.4.0",
"color-operations",
"typing-extensions",
"importlib_resources>=1.1.0; python_version < '3.9'",
]

[project.optional-dependencies]
Expand Down
11 changes: 2 additions & 9 deletions rio_tiler/colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import pathlib
import re
import warnings
from importlib.resources import as_file
from importlib.resources import files as resources_files
from typing import Dict, List, Sequence, Tuple, Union

import attr
Expand All @@ -24,15 +26,6 @@
IntervalColorMapType,
)

try:
from importlib.resources import as_file
from importlib.resources import files as resources_files
except ImportError:
# Try backported to PY<39 `importlib_resources`.
from importlib_resources import as_file # type: ignore
from importlib_resources import files as resources_files # type: ignore


EMPTY_COLORMAP: GDALColorMapType = {i: (0, 0, 0, 0) for i in range(256)}

_RIO_CMAP_DIR = resources_files(__package__) / "cmap_data"
Expand Down
7 changes: 1 addition & 6 deletions tests/test_cmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import pathlib
from copy import deepcopy
from importlib.resources import as_file

import numpy
import pytest
Expand All @@ -16,12 +17,6 @@
InvalidFormat,
)

try:
from importlib.resources import as_file
except ImportError:
# Try backported to PY<39 `importlib_resources`.
from importlib_resources import as_file # type: ignore

PREFIX = os.path.join(os.path.dirname(__file__), "fixtures", "cmap")

colormap_number = 211
Expand Down

0 comments on commit 3fc6e48

Please sign in to comment.