Skip to content

Commit fd9a6a5

Browse files
authored
fix: drivers have been separated out of the gdal conda, bump min python to 3.10 (#480)
* fix: drivers have been separated out of the gdal conda * fix: bump min python to 3.10 * fix: reformat, remove tests that check behavior of other libs * feat: update pre-commit * fix: remove more broken stuff
1 parent 059856e commit fd9a6a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+75
-329
lines changed

.github/workflows/continuous-integration.yml

+4-21
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11"]
19+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2020
defaults:
2121
run:
2222
shell: bash -l {0}
@@ -34,7 +34,7 @@ jobs:
3434
runs-on: ubuntu-latest
3535
strategy:
3636
matrix:
37-
python-version: ["3.8", "3.9", "3.10", "3.11"]
37+
python-version: ["3.10", "3.11", "3.12", "3.13"]
3838
defaults:
3939
run:
4040
shell: bash -l {0}
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353
strategy:
5454
matrix:
55-
python-version: ["3.8", "3.9", "3.10", "3.11"]
55+
python-version: ["3.10", "3.11", "3.12", "3.13"]
5656
defaults:
5757
run:
5858
shell: bash -l {0}
@@ -73,7 +73,7 @@ jobs:
7373
continue-on-error: true
7474
strategy:
7575
matrix:
76-
python-version: ["3.8", "3.9", "3.10", "3.11"]
76+
python-version: ["3.10", "3.11", "3.12", "3.13"]
7777
defaults:
7878
run:
7979
shell: bash -l {0}
@@ -88,23 +88,6 @@ jobs:
8888
run: pip install -U --pre pystac rasterio --no-binary rasterio
8989
- name: Run tests
9090
run: scripts/test
91-
codecov:
92-
name: Codecov
93-
needs:
94-
- standard
95-
- extra-requires
96-
- minimum-versions
97-
runs-on: ubuntu-latest
98-
steps:
99-
- uses: actions/checkout@v4
100-
- name: Execute linters and test suites
101-
run: ./docker/cibuild
102-
- name: Upload coverage to Codecov
103-
uses: codecov/codecov-action@v4
104-
with:
105-
token: ${{ secrets.CODECOV_TOKEN }}
106-
file: ./coverage.xml
107-
fail_ci_if_error: false
10891
docker:
10992
name: Docker
11093
needs:

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33

44
repos:
55
- repo: https://github.com/charliermarsh/ruff-pre-commit
6-
rev: v0.0.265
6+
rev: v0.8.4
77
hooks:
88
- id: ruff
99
args: [--fix, --exit-non-zero-on-fix]
1010
- repo: https://github.com/psf/black
11-
rev: 23.3.0
11+
rev: 24.10.0
1212
hooks:
1313
- id: black
1414
- repo: https://github.com/codespell-project/codespell
15-
rev: v2.2.4
15+
rev: v2.3.0
1616
hooks:
1717
- id: codespell
1818
args: [--ignore-words=.codespellignore]
1919
types_or: [jupyter, markdown, python, shell]
2020
- repo: https://github.com/PyCQA/doc8
21-
rev: v1.1.1
21+
rev: v1.1.2
2222
hooks:
2323
- id: doc8
2424
- repo: https://github.com/pre-commit/mirrors-mypy
25-
rev: v1.3.0
25+
rev: v1.14.0
2626
hooks:
2727
- id: mypy
2828
# TODO lint test and scripts too

README.md

-6
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,6 @@ Once the container is built, you can run the `scripts/` scripts inside a docker
162162
docker/console
163163
```
164164

165-
A complete build and test can be run with:
166-
167-
```sh
168-
docker/cibuild
169-
```
170-
171165
In scenarios where you want to run scripts in `docker/` but don't want to run the build, images can be downloaded via the `pull` script:
172166

173167
```sh

docker/cibuild

-23
This file was deleted.

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ See the `stactools-packages website <https://stactools-packages.github.io>`_ and
1919
Requirements
2020
============
2121

22-
* `Python 3.8 or greater <https://www.python.org/>`_
22+
* `Python 3.10 or greater <https://www.python.org/>`_
2323

2424
STAC version support
2525
====================

environment.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- conda-forge::gdal>=3.3
6+
- conda-forge::gdal>=3.10
77
- conda-forge::geos>=3.3
88
- conda-forge::rasterio>=1.3
9-
- conda-forge::libstdcxx-ng # gdal dependency. Make sure it's from the same channel as gdal
10-
- conda-forge::libarchive # gdal dependency. Make sure it's from the same channel as gdal
9+
- conda-forge::libgdal-hdf5
10+
- conda-forge::libgdal-jp2openjpeg

pyproject.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ keywords = ["pystac", "imagery", "raster", "catalog", "STAC"]
1212
classifiers = [
1313
"Development Status :: 4 - Beta",
1414
"License :: OSI Approved :: Apache Software License",
15-
"Programming Language :: Python :: 3.8",
16-
"Programming Language :: Python :: 3.9",
1715
"Programming Language :: Python :: 3.10",
1816
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
1919
]
20-
requires-python = ">=3.8"
20+
requires-python = ">=3.10"
2121
dependencies = [
2222
"antimeridian>=0.2.6",
2323
"click>=8.1.3",
@@ -54,7 +54,7 @@ dev = [
5454
"pytest-cov~=3.0",
5555
"pytest~=7.3",
5656
"requests>=2.27.1",
57-
"ruff==0.0.265",
57+
"ruff~=0.8.0",
5858
"types-certifi~=2021.10.8",
5959
"types-orjson~=3.6",
6060
"types-python-dateutil~=2.8",
@@ -82,7 +82,7 @@ version = { attr = "stactools.core.__version__" }
8282

8383
[tool.ruff]
8484
line-length = 88
85-
select = ["E", "F", "I"]
85+
lint.select = ["E", "F", "I"]
8686

8787
[tool.mypy]
8888
mypy_path = "src"

scripts/cibuild

-23
This file was deleted.

scripts/rewrite_test_data.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def remap_property(item: Item, before: str, after: str) -> None:
3737
for i, interval in enumerate(collection.extent.temporal.intervals):
3838
for j, datetime in enumerate(interval):
3939
if datetime:
40-
collection.extent.temporal.intervals[i][
41-
j
42-
] = datetime.astimezone(UTC)
40+
collection.extent.temporal.intervals[i][j] = (
41+
datetime.astimezone(UTC)
42+
)
4343

4444
if object.STAC_OBJECT_TYPE == "Feature":
4545
item = cast(Item, object)

src/stactools/cli/cli.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from typing import Union
33

44
import click
5+
56
from stactools.cli import registry
67

78

src/stactools/cli/commands/add.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import click
44
from pystac import Catalog, Item, read_file
5+
56
from stactools.core import add_item
67

78

src/stactools/cli/commands/add_asset.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import click
44
import pystac
55
import pystac.utils
6+
67
from stactools.core import add_asset
78

89

src/stactools/cli/commands/add_raster.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import click
22
import pystac
3+
34
from stactools.core import add_raster_to_item
45

56

src/stactools/cli/commands/copy.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import click
44
import pystac
55
from pystac.utils import make_absolute_href
6+
67
from stactools.core.copy import copy_catalog, move_all_assets
78

89

src/stactools/cli/commands/create.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import List
44

55
import click
6+
67
from stactools.core import create
78

89

src/stactools/cli/commands/layout.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import click
22
import pystac
3+
34
from stactools.core import layout_catalog
45

56

src/stactools/cli/commands/merge.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import click
44
import pystac
5+
56
from stactools.core import merge_all_items
67

78

src/stactools/cli/commands/migrate.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import click
22
import pystac
3+
34
from stactools.core import migrate_object
45

56

src/stactools/cli/commands/summary.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
def format_summary(summary: Dict[str, Any], indent: int = 4) -> str:
1010
out = ""
1111
for var in summary:
12-
if type(summary[var]) == dict:
12+
if summary[var] is dict:
1313
out += var + ": \n" + " " * indent + str(summary[var]) + "\n"
1414
else:
1515
out += var + ": " + str(summary[var]) + "\n"

src/stactools/cli/commands/update_geometry.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import click
44
from click import Command, Group
55
from pystac import Item
6+
67
from stactools.core.utils import raster_footprint
78

89

src/stactools/cli/commands/version.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from click import echo
33
from click.core import Command, Group
44
from pystac.version import get_stac_version
5+
56
from stactools.core import __version__
67

78

src/stactools/core/add.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from pystac import Catalog, Collection, Item
66
from pystac.layout import BestPracticesLayoutStrategy
7+
78
from stactools.core.copy import move_assets as do_move_assets
89

910

src/stactools/core/add_asset.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from pystac import Asset, Collection, Item
66
from pystac.utils import is_absolute_href, make_relative_href
7+
78
from stactools.core.copy import move_asset_file
89

910
logger = logging.getLogger(__name__)

src/stactools/core/add_raster.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ def _read_bands(href: str, statistics: bool, histogram: bool) -> List[RasterBand
6969
data, range=(minimum, maximum), bins=BINS
7070
)
7171
band.histogram = Histogram.create(
72-
BINS, minimum, maximum, hist_data.tolist()
72+
BINS,
73+
minimum,
74+
maximum,
75+
hist_data.tolist(), # type: ignore
7376
)
7477
bands.append(band)
7578
return bands

src/stactools/core/create.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44

55
import rasterio
66
import shapely.geometry
7-
import stactools.core.projection
87
from pystac import Asset, Item
98
from pystac.extensions.projection import ProjectionExtension
109

10+
import stactools.core.projection
11+
1112
from .io import ReadHrefModifier
1213

1314

src/stactools/core/geometry.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,4 @@ class GeoInterface(Protocol):
4646
extract geometries from objects.
4747
"""
4848

49-
def __geo_interface__(self) -> Dict[str, Any]:
50-
...
49+
def __geo_interface__(self) -> Dict[str, Any]: ...

src/stactools/core/io/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import fsspec
77
from pystac.link import HREF
88
from pystac.stac_io import StacIO
9+
910
from stactools.core import utils
1011

1112
ReadHrefModifier = Callable[[str], str]

src/stactools/core/io/xml.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from lxml import etree
55
from lxml.etree import _Element as lxmlElement
6+
67
from stactools.core.io import ReadHrefModifier, read_text
78

89

src/stactools/core/layout.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from pystac import Catalog
44
from pystac.layout import TemplateLayoutStrategy
5+
56
from stactools.core import move_all_assets
67

78

src/stactools/core/merge.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pystac.layout import BestPracticesLayoutStrategy
66
from pystac.utils import is_absolute_href, make_relative_href
77
from shapely.geometry import mapping, shape
8+
89
from stactools.core.copy import copy_catalog, move_asset_file
910
from stactools.core.copy import move_assets as do_move_assets
1011

0 commit comments

Comments
 (0)