Skip to content

Commit

Permalink
depreciate Python <=3.7 and add warning for the depreciation of Pytho…
Browse files Browse the repository at this point in the history
…n 3.8 and 3.9 support in 2025
  • Loading branch information
ghislainp committed Aug 14, 2024
1 parent b874f2b commit 9f07794
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: [3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -21,8 +21,8 @@ jobs:
pip install ruff pytest numpy pandas scipy xarray numba joblib
- name: Lint with ruff
run: |
ruff -output-format=github --select=E9,F63,F7,F82 --target-version=py37 .
ruff -output-format=github --target-version=py37 .
ruff -output-format=github --select=E9,F63,F7,F82 --target-version=py38 .
ruff -output-format=github --target-version=py38 .
continue-on-error: true
- name: Test with pytest
run: |
Expand Down
21 changes: 17 additions & 4 deletions smrt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@


# functions to be exported by default

import sys

from .inputs.make_medium import make_snowpack, make_snow_layer, make_ice_column, make_atmosphere, make_interface, make_water_body
if (sys.version_info[0] == 2) or ((sys.version_info[0] == 3) and (sys.version_info[0] < 8)):
raise RuntimeError('Python 3.7 and lower are not supported anymore')

if (sys.version_info[0] == 3) and (sys.version_info[0] <= 9):
from warnings import warn

warn('Support of Python 3.8 and 3.9 will be discarded in 2025 to implement type hinting')

from .inputs.make_medium import (
make_snowpack,
make_snow_layer,
make_ice_column,
make_atmosphere,
make_interface,
make_water_body,
)
from .inputs.make_soil import make_soil

from .core.model import make_model, make_emmodel, rtsolver, emmodel
from .core.error import SMRTError
from .core import sensor
from .core.result import open_result
from .core.sensitivity_study import sensitivity_study
from .core.sensitivity_study import sensitivity_study
from .core.globalconstants import PSU, GHz, cm, mm, micron
from .core.plugin import register_package

Expand Down

0 comments on commit 9f07794

Please sign in to comment.