Skip to content

Commit 9987d99

Browse files
authored
Remove support for Python 3.8 (#20071)
1 parent bf25167 commit 9987d99

File tree

14 files changed

+65
-100
lines changed

14 files changed

+65
-100
lines changed

.github/checkgroup.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ subprojects:
1919
- "!*.md"
2020
- "!**/*.md"
2121
checks:
22-
- "pl-cpu (macOS-13, lightning, 3.8, 2.1, oldest)"
22+
- "pl-cpu (macOS-13, lightning, 3.9, 2.1, oldest)"
2323
- "pl-cpu (macOS-14, lightning, 3.10, 2.1)"
2424
- "pl-cpu (macOS-14, lightning, 3.10, 2.2)"
2525
- "pl-cpu (macOS-14, lightning, 3.10, 2.3)"
26-
- "pl-cpu (ubuntu-20.04, lightning, 3.8, 2.1, oldest)"
26+
- "pl-cpu (ubuntu-20.04, lightning, 3.9, 2.1, oldest)"
2727
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.1)"
2828
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.2)"
2929
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.3)"
30-
- "pl-cpu (windows-2022, lightning, 3.8, 2.1, oldest)"
30+
- "pl-cpu (windows-2022, lightning, 3.9, 2.1, oldest)"
3131
- "pl-cpu (windows-2022, lightning, 3.10, 2.1)"
3232
- "pl-cpu (windows-2022, lightning, 3.10, 2.2)"
3333
- "pl-cpu (windows-2022, lightning, 3.10, 2.3)"
34-
- "pl-cpu (macOS-14, pytorch, 3.8, 2.1)"
35-
- "pl-cpu (ubuntu-20.04, pytorch, 3.8, 2.1)"
36-
- "pl-cpu (windows-2022, pytorch, 3.8, 2.1)"
34+
- "pl-cpu (macOS-14, pytorch, 3.9, 2.1)"
35+
- "pl-cpu (ubuntu-20.04, pytorch, 3.9, 2.1)"
36+
- "pl-cpu (windows-2022, pytorch, 3.9, 2.1)"
3737
- "pl-cpu (macOS-12, pytorch, 3.11, 2.1)"
3838
- "pl-cpu (ubuntu-22.04, pytorch, 3.11, 2.1)"
3939
- "pl-cpu (windows-2022, pytorch, 3.11, 2.1)"
@@ -167,21 +167,21 @@ subprojects:
167167
- "!*.md"
168168
- "!**/*.md"
169169
checks:
170-
- "fabric-cpu (macOS-13, lightning, 3.8, 2.1, oldest)"
170+
- "fabric-cpu (macOS-13, lightning, 3.9, 2.1, oldest)"
171171
- "fabric-cpu (macOS-14, lightning, 3.11, 2.1)"
172172
- "fabric-cpu (macOS-14, lightning, 3.11, 2.2)"
173173
- "fabric-cpu (macOS-14, lightning, 3.10, 2.3)"
174-
- "fabric-cpu (ubuntu-20.04, lightning, 3.8, 2.1, oldest)"
174+
- "fabric-cpu (ubuntu-20.04, lightning, 3.9, 2.1, oldest)"
175175
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.1)"
176176
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.2)"
177177
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.3)"
178-
- "fabric-cpu (windows-2022, lightning, 3.8, 2.1, oldest)"
178+
- "fabric-cpu (windows-2022, lightning, 3.9, 2.1, oldest)"
179179
- "fabric-cpu (windows-2022, lightning, 3.11, 2.1)"
180180
- "fabric-cpu (windows-2022, lightning, 3.11, 2.2)"
181181
- "fabric-cpu (windows-2022, lightning, 3.11, 2.3)"
182-
- "fabric-cpu (macOS-14, fabric, 3.8, 2.1)"
183-
- "fabric-cpu (ubuntu-20.04, fabric, 3.8, 2.1)"
184-
- "fabric-cpu (windows-2022, fabric, 3.8, 2.1)"
182+
- "fabric-cpu (macOS-14, fabric, 3.9, 2.1)"
183+
- "fabric-cpu (ubuntu-20.04, fabric, 3.9, 2.1)"
184+
- "fabric-cpu (windows-2022, fabric, 3.9, 2.1)"
185185
- "fabric-cpu (macOS-12, fabric, 3.11, 2.1)"
186186
- "fabric-cpu (ubuntu-22.04, fabric, 3.11, 2.1)"
187187
- "fabric-cpu (windows-2022, fabric, 3.11, 2.1)"
@@ -248,27 +248,27 @@ subprojects:
248248
- "!*.md"
249249
- "!**/*.md"
250250
checks:
251-
- "install-pkg (ubuntu-22.04, fabric, 3.8)"
251+
- "install-pkg (ubuntu-22.04, fabric, 3.9)"
252252
- "install-pkg (ubuntu-22.04, fabric, 3.11)"
253-
- "install-pkg (ubuntu-22.04, pytorch, 3.8)"
253+
- "install-pkg (ubuntu-22.04, pytorch, 3.9)"
254254
- "install-pkg (ubuntu-22.04, pytorch, 3.11)"
255-
- "install-pkg (ubuntu-22.04, lightning, 3.8)"
255+
- "install-pkg (ubuntu-22.04, lightning, 3.9)"
256256
- "install-pkg (ubuntu-22.04, lightning, 3.11)"
257-
- "install-pkg (ubuntu-22.04, notset, 3.8)"
257+
- "install-pkg (ubuntu-22.04, notset, 3.9)"
258258
- "install-pkg (ubuntu-22.04, notset, 3.11)"
259-
- "install-pkg (macOS-12, fabric, 3.8)"
259+
- "install-pkg (macOS-12, fabric, 3.9)"
260260
- "install-pkg (macOS-12, fabric, 3.11)"
261-
- "install-pkg (macOS-12, pytorch, 3.8)"
261+
- "install-pkg (macOS-12, pytorch, 3.9)"
262262
- "install-pkg (macOS-12, pytorch, 3.11)"
263-
- "install-pkg (macOS-12, lightning, 3.8)"
263+
- "install-pkg (macOS-12, lightning, 3.9)"
264264
- "install-pkg (macOS-12, lightning, 3.11)"
265-
- "install-pkg (macOS-12, notset, 3.8)"
265+
- "install-pkg (macOS-12, notset, 3.9)"
266266
- "install-pkg (macOS-12, notset, 3.11)"
267-
- "install-pkg (windows-2022, fabric, 3.8)"
267+
- "install-pkg (windows-2022, fabric, 3.9)"
268268
- "install-pkg (windows-2022, fabric, 3.11)"
269-
- "install-pkg (windows-2022, pytorch, 3.8)"
269+
- "install-pkg (windows-2022, pytorch, 3.9)"
270270
- "install-pkg (windows-2022, pytorch, 3.11)"
271-
- "install-pkg (windows-2022, lightning, 3.8)"
271+
- "install-pkg (windows-2022, lightning, 3.9)"
272272
- "install-pkg (windows-2022, lightning, 3.11)"
273-
- "install-pkg (windows-2022, notset, 3.8)"
273+
- "install-pkg (windows-2022, notset, 3.9)"
274274
- "install-pkg (windows-2022, notset, 3.11)"

.github/workflows/ci-pkg-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
matrix:
4545
os: ["ubuntu-22.04", "macOS-12", "windows-2022"]
4646
pkg-name: ["fabric", "pytorch", "lightning", "notset"]
47-
python-version: ["3.8", "3.11"]
47+
python-version: ["3.9", "3.11"]
4848
steps:
4949
- uses: actions/checkout@v4
5050
- uses: actions/setup-python@v5

.github/workflows/ci-tests-fabric.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@ jobs:
5858
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.11", pytorch-version: "2.1" }
5959
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.11", pytorch-version: "2.1" }
6060
# "oldest" versions tests, only on minimum Python
61-
- { os: "macOS-13", pkg-name: "lightning", python-version: "3.8", pytorch-version: "2.1", requires: "oldest" }
61+
- { os: "macOS-13", pkg-name: "lightning", python-version: "3.9", pytorch-version: "2.1", requires: "oldest" }
6262
- {
6363
os: "ubuntu-20.04",
6464
pkg-name: "lightning",
65-
python-version: "3.8",
65+
python-version: "3.9",
6666
pytorch-version: "2.1",
6767
requires: "oldest",
6868
}
6969
- {
7070
os: "windows-2022",
7171
pkg-name: "lightning",
72-
python-version: "3.8",
72+
python-version: "3.9",
7373
pytorch-version: "2.1",
7474
requires: "oldest",
7575
}
7676
# "fabric" installs the standalone package
77-
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.8", pytorch-version: "2.1" }
78-
- { os: "ubuntu-20.04", pkg-name: "fabric", python-version: "3.8", pytorch-version: "2.1" }
79-
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.8", pytorch-version: "2.1" }
77+
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.9", pytorch-version: "2.1" }
78+
- { os: "ubuntu-20.04", pkg-name: "fabric", python-version: "3.9", pytorch-version: "2.1" }
79+
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.9", pytorch-version: "2.1" }
8080
timeout-minutes: 25 # because of building grpcio on Mac
8181
env:
8282
PACKAGE_NAME: ${{ matrix.pkg-name }}

.github/workflows/ci-tests-pytorch.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@ jobs:
6161
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.11", pytorch-version: "2.1" }
6262
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.11", pytorch-version: "2.1" }
6363
# "oldest" versions tests, only on minimum Python
64-
- { os: "macOS-13", pkg-name: "lightning", python-version: "3.8", pytorch-version: "2.1", requires: "oldest" }
64+
- { os: "macOS-13", pkg-name: "lightning", python-version: "3.9", pytorch-version: "2.1", requires: "oldest" }
6565
- {
6666
os: "ubuntu-20.04",
6767
pkg-name: "lightning",
68-
python-version: "3.8",
68+
python-version: "3.9",
6969
pytorch-version: "2.1",
7070
requires: "oldest",
7171
}
7272
- {
7373
os: "windows-2022",
7474
pkg-name: "lightning",
75-
python-version: "3.8",
75+
python-version: "3.9",
7676
pytorch-version: "2.1",
7777
requires: "oldest",
7878
}
7979
# "pytorch" installs the standalone package
80-
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "2.1" }
81-
- { os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "2.1" }
82-
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "2.1" }
80+
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "2.1" }
81+
- { os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "2.1" }
82+
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "2.1" }
8383
timeout-minutes: 50
8484
env:
8585
PACKAGE_NAME: ${{ matrix.pkg-name }}

.github/workflows/release-pkg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ defaults:
2424
env:
2525
FREEZE_REQUIREMENTS: 1
2626
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
27-
PYTHON_VER: "3.8"
27+
PYTHON_VER: "3.9"
2828

2929
jobs:
3030
build-packages:

src/lightning/__setup__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def _setup_args() -> Dict[str, Any]:
9393
"long_description_content_type": "text/markdown",
9494
"include_package_data": True,
9595
"zip_safe": False,
96-
"keywords": ["deep learning", "pytorch", "AI"], # todo: aggregate tags from all packages
97-
"python_requires": ">=3.8", # todo: take the lowes based on all packages
96+
"keywords": ["deep learning", "pytorch", "AI"],
97+
"python_requires": ">=3.9",
9898
"entry_points": {
9999
"console_scripts": [
100100
"fabric = lightning.fabric.cli:_main",

src/lightning/fabric/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3030
- Removed support for PyTorch 2.1 ([#20009](https://github.com/Lightning-AI/lightning/pull/20009))
3131

3232

33-
-
33+
- Removed support for Python 3.8 ([#20071](https://github.com/Lightning-AI/lightning/pull/20071))
3434

3535
### Fixed
3636

src/lightning/fabric/utilities/imports.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_TORCH_GREATER_EQUAL_2_3 = compare_version("torch", operator.ge, "2.3.0")
3131
_TORCH_GREATER_EQUAL_2_4 = compare_version("torch", operator.ge, "2.4.0")
3232

33-
_PYTHON_GREATER_EQUAL_3_8_0 = (sys.version_info.major, sys.version_info.minor) >= (3, 8)
3433
_PYTHON_GREATER_EQUAL_3_10_0 = (sys.version_info.major, sys.version_info.minor) >= (3, 10)
3534

3635
_UTILITIES_GREATER_EQUAL_0_10 = compare_version("lightning_utilities", operator.ge, "0.10.0")

src/lightning/fabric/utilities/registry.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import logging
15+
from importlib.metadata import entry_points
1516
from inspect import getmembers, isclass
1617
from types import ModuleType
1718
from typing import Any, List, Type, Union
1819

1920
from lightning_utilities import is_overridden
2021

21-
from lightning.fabric.utilities.imports import _PYTHON_GREATER_EQUAL_3_8_0, _PYTHON_GREATER_EQUAL_3_10_0
22+
from lightning.fabric.utilities.imports import _PYTHON_GREATER_EQUAL_3_10_0
2223

2324
_log = logging.getLogger(__name__)
2425

@@ -35,16 +36,9 @@ def _load_external_callbacks(group: str) -> List[Any]:
3536
A list of all callbacks collected from external factories.
3637
3738
"""
38-
if _PYTHON_GREATER_EQUAL_3_8_0:
39-
from importlib.metadata import entry_points
40-
41-
factories = (
42-
entry_points(group=group) if _PYTHON_GREATER_EQUAL_3_10_0 else entry_points().get(group, {}) # type: ignore[arg-type]
43-
)
44-
else:
45-
from pkg_resources import iter_entry_points
46-
47-
factories = iter_entry_points(group) # type: ignore[assignment]
39+
factories = (
40+
entry_points(group=group) if _PYTHON_GREATER_EQUAL_3_10_0 else entry_points().get(group, {}) # type: ignore[arg-type]
41+
)
4842

4943
external_callbacks: List[Any] = []
5044
for factory in factories:

src/lightning/pytorch/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3030
- Removed support for PyTorch 2.1 ([#20009](https://github.com/Lightning-AI/lightning/pull/20009))
3131

3232

33-
-
33+
- Removed support for Python 3.8 ([#20071](https://github.com/Lightning-AI/lightning/pull/20071))
34+
3435

3536
### Fixed
3637

0 commit comments

Comments
 (0)