Skip to content

Commit

Permalink
chore: drop python 3.8
Browse files Browse the repository at this point in the history
I did _not_ run **pyupgrade** as that'll be really noisy, so I'm going to wait
until the sprint is over and the repo has fewer folks hacking on it.
  • Loading branch information
gadomski committed Sep 27, 2023
1 parent 9c323c4 commit f5c43d0
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 30 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 26,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand Down Expand Up @@ -59,10 58,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
cache: "pip"

- name: Install with dependencies
Expand Down Expand Up @@ -102,7 101,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand All @@ -129,7 127,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"

- name: Install
run: pip install .[validation,test]
Expand All @@ -147,7 145,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
cache: "pip"

- name: Install all dependencies
Expand All @@ -162,7 160,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.9"
cache: "pip"
- name: Install pystac
run: pip install .[bench]
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 7,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.9"

formats:
# Temporarily disabling PDF downloads due to problem with nbsphinx in LateX builds
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 10,10 @@

- Typing of `href` arguments ([#1234](https://github.com/stac-utils/pystac/pull/1234))

### Removed

- Python 3.8 support ([#1236](https://github.com/stac-utils/pystac/pull/1236))

## [v1.8.4] - 2023-09-22

### Added
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 27,9 @@ Install from source
Dependencies
============

PySTAC requires Python >= 3.8. This project follows the recommendations of
PySTAC requires Python >= 3.9. This project follows the recommendations of
`NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`__ in deprecating support
for Python versions. This means that users can expect support for Python 3.8 to be
for Python versions. This means that users can expect support for Python 3.9 to be
removed from the ``main`` branch after Apr 14, 2023 and therefore from the next release
after that date.

Expand Down
8 changes: 2 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 15,12 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.8"
dependencies = [
"importlib-resources>=5.12.0; python_version<'3.9'",
"python-dateutil>=2.7.0",
]
requires-python = ">=3.9"
dependencies = ["python-dateutil>=2.7.0"]
dynamic = ["version"]

[project.optional-dependencies]
Expand Down
9 changes: 2 additions & 7 deletions pystac/summaries.py
Original file line number Diff line number Diff line change
@@ -1,8 1,8 @@
from __future__ import annotations

import importlib.resources
import json
import numbers
import sys
from abc import abstractmethod
from copy import deepcopy
from enum import Enum
Expand All @@ -20,11 20,6 @@
Union,
)

if sys.version_info[:2] < (3, 9):
from importlib_resources import files as importlib_resources_files
else:
from importlib.resources import files as importlib_resources_files

import pystac
from pystac.utils import get_required

Expand Down Expand Up @@ -112,7 107,7 @@ def _get_fields_json(url: Optional[str]) -> Dict[str, Any]:
# Every time pystac is released this file gets pulled from
# https://cdn.jsdelivr.net/npm/@radiantearth/stac-fields/fields-normalized.json
jsonfields: Dict[str, Any] = json.loads(
importlib_resources_files("pystac.static")
importlib.resources.files("pystac.static")
.joinpath("fields-normalized.json")
.read_text()
)
Expand Down
9 changes: 2 additions & 7 deletions pystac/validation/local_validator.py
Original file line number Diff line number Diff line change
@@ -1,5 1,5 @@
import importlib.resources
import json
import sys
import warnings
from typing import Any, Dict, List, cast

Expand All @@ -9,16 9,11 @@
from pystac.errors import STACLocalValidationError
from pystac.version import STACVersion

if sys.version_info[:2] < (3, 9):
from importlib_resources import files as importlib_resources_files
else:
from importlib.resources import files as importlib_resources_files

VERSION = STACVersion.DEFAULT_STAC_VERSION


def _read_schema(file_name: str) -> Dict[str, Any]:
with importlib_resources_files("pystac.validation.jsonschemas").joinpath(
with importlib.resources.files("pystac.validation.jsonschemas").joinpath(
file_name
).open("r") as f:
return cast(Dict[str, Any], json.load(f))
Expand Down

0 comments on commit f5c43d0

Please sign in to comment.