Skip to content

Commit

Permalink
Drop support for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindeide committed Nov 13, 2024
1 parent d32d419 commit c1e1c80
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 62 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ body:
description: |
Please check of the environments where this behavior has been observed.
options:
- label: python 3.8
- label: python 3.9
- label: python 3.10
- label: python 3.11
- label: python 3.12
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
python-version: [ '3.10', '3.11', '3.12' ]

uses: ./.github/workflows/build-wheels.yml
with:
Expand All @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
test-type: [ 'performance-tests', 'unit-tests', 'gui-tests', 'cli-tests' ]
python-version: [ '3.8', '3.11', '3.12' ]
python-version: [ '3.11', '3.12' ]
os: [ ubuntu-latest ]
uses: ./.github/workflows/test_ert.yml
with:
Expand All @@ -48,7 +48,7 @@ jobs:
fail-fast: false
matrix:
test-type: [ 'test', 'ui-test', 'integration-test', 'everest-models-test', 'doc', 'everest-docs-entry-test' ]
python-version: [ '3.8', '3.11', '3.12' ]
python-version: [ '3.11', '3.12' ]
os: [ ubuntu-latest ]
uses: ./.github/workflows/test_everest.yml
with:
Expand All @@ -62,7 +62,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.8', '3.11', '3.12' ]
python-version: [ '3.11', '3.12' ]
uses: ./.github/workflows/test_ert_with_slurm.yml
with:
os: ${{ matrix.os }}
Expand Down Expand Up @@ -106,11 +106,9 @@ jobs:
fail-fast: false
matrix:
test-type: [ 'test', 'integration-test', 'everest-models-test' ]
python-version: [ '3.8', '3.12' ]
os: [ 'macos-13', 'macos-14', 'macos-14-large']
python-version: [ '3.12' ]
exclude:
- os: 'macos-14'
python-version: '3.8'
- os: 'macos-13'
python-version: '3.12'
uses: ./.github/workflows/test_everest.yml
Expand All @@ -126,11 +124,9 @@ jobs:
fail-fast: false
matrix:
test-type: [ 'performance-tests', 'unit-tests', 'gui-tests', 'cli-tests' ]
python-version: [ '3.8', '3.12' ]
python-version: [ '3.12' ]
os: [ 'macos-13', 'macos-14']
exclude:
- os: 'macos-14'
python-version: '3.8'
- os: 'macos-13'
python-version: '3.12'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_ert_test_data_setups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.11', '3.12']
python-version: ['3.11', '3.12']
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install HDF5 source files
if: ${{ runner.os == 'macOS' && (inputs.python-version == '3.8' || inputs.python-version == '3.9' )}}
run: brew install hdf5

- name: Install ert
run: |
uv pip install ".[dev, everest]"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/test_everest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install HDF5 source files on mac
if: ${{ runner.os == 'macOS' && (inputs.python-version == '3.8' || inputs.python-version == '3.9' )}}
run: brew install hdf5

- name: Install Everest and dependencies
run: |
uv pip install ".[dev,everest]"
Expand Down
10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
{ name = "Equinor ASA", email = "[email protected]" },
]
description = "Ensemble based Reservoir Tool (ERT)"
requires-python = ">=3.8"
requires-python = ">=3.10"
readme = "README.md"
license = { text = "GPL-3.0" }
classifiers = [
Expand All @@ -21,8 +21,6 @@ classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -41,7 +39,6 @@ dependencies = [
"filelock",
"httpx",
"humanize",
"importlib_resources; python_version <= '3.8'",
"iterative_ensemble_smoother>=0.2.6",
"jinja2 >= 2.10",
"lark",
Expand Down Expand Up @@ -70,8 +67,7 @@ dependencies = [
"resfo",
"scipy >= 1.10.1",
"seaborn",
"tables; python_version >= '3.9'", # extra dependency for pandas (hdf5)
"tables<3.9; python_version == '3.8'",
"tables", # extra dependency for pandas (hdf5)
"tabulate",
"tqdm>=4.62.0",
"typing_extensions>=4.5",
Expand Down Expand Up @@ -244,7 +240,7 @@ include = ["src"]
exclude = ["tests"]
reportMissingImports = "error"
typeCheckingMode = "standard"
pythonVersion = "3.8"
pythonVersion = "3.11"

[tool.pyright.defineConstant]
PYSIDE6 = false
Expand Down
16 changes: 3 additions & 13 deletions src/ert/config/parsing/schema_dict.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import abc
from typing import TYPE_CHECKING, List, Set, no_type_check
from collections import UserDict
from typing import List, Set, no_type_check

from .config_dict import ConfigDict
from .config_errors import ConfigValidationError, ConfigWarning
Expand All @@ -8,19 +9,8 @@
from .deprecation_info import DeprecationInfo
from .error_info import ErrorInfo

# Python 3.8 does not implement UserDict as a MutableMapping, meaning it's not
# possible to specify the key and value types.
#
# Instead, we only set the types during type checking
if TYPE_CHECKING:
from collections import UserDict

_UserDict = UserDict[str, SchemaItem]
else:
from collections import UserDict as _UserDict


class SchemaItemDict(_UserDict):
class SchemaItemDict(UserDict[str, SchemaItem]):
def search_for_unset_required_keywords(
self, config_dict: ConfigDict, filename: str
) -> None:
Expand Down
15 changes: 3 additions & 12 deletions src/ert/substitutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,16 @@

import logging
import re
from typing import TYPE_CHECKING, Optional
from typing import Optional

logger = logging.getLogger(__name__)
_PATTERN = re.compile("<[^<>]+>")


# Python 3.8 does not implement UserDict as a MutableMapping, meaning it's not
# possible to specify the key and value types.
#
# Instead, we only set the types during type checking
if TYPE_CHECKING:
from collections import UserDict
from collections import UserDict

_UserDict = UserDict[str, str]
else:
from collections import UserDict as _UserDict


class Substitutions(_UserDict):
class Substitutions(UserDict[str, str]):
def substitute(
self,
to_substitute: str,
Expand Down
9 changes: 0 additions & 9 deletions tests/everest/utils/test_pydantic_doc_generation.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
import sys

import pytest

from everest.docs.generate_docs_from_config_spec import generate_docs_pydantic_to_rst
from tests.everest.utils import relpath


@pytest.mark.skipif(sys.version_info < (3, 10), reason="python version less than 3.11")
def test_generated_doc():
"""Python 3.9 and below interprets annotations differently than 3.11 and above.
3.8 will also soon be dropped so it's better to support only the updated interpretation.
thus I limit this test to run for versions with the updated annotations handler
"""
error_msg = """
The generated documentation for the configuration file is
out of date. Run `python -m everest.docs` to re-generate.
Expand Down

0 comments on commit c1e1c80

Please sign in to comment.