Skip to content

Commit

Permalink
chore: drop Python 3.9 support (#247)
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <[email protected]>
  • Loading branch information
SdgJlbl authored Sep 13, 2024
1 parent 9ac1ac6 commit 70c89f1
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
python: ["3.9", "3.10", "3.11"]
python: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
python: ["3.9", "3.10", "3.11", "3.12"]
python: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-22.04]
python: ["3.9", "3.10", "3.11", "3.12"]
python: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/setup-python@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-subprocess-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
python: ["3.9", "3.10", "3.11"]
python: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions changes/247.removed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Drop Python 3.9 support.
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ path = "substrafl/__version__.py"
name = "substrafl"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand All @@ -38,7 +37,7 @@ license = { file = "LICENSE" }

description = """A high-level federated learning Python library to run
federated learning experiments at scale on a Substra network"""
requires-python = ">= 3.9"
requires-python = ">= 3.10"

[project.optional-dependencies]
dev = [
Expand Down
10 changes: 3 additions & 7 deletions substrafl/dependency/path_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,9 @@ def copy_paths(
def _ignore_files(expanded_excluded, dest_dir):
def _ignore_files(path: str, names: List[str]) -> Set[str]:
p = Path(path).resolve()

# Replicate is_relative_to, added in Python 3.9
try:
p.relative_to(dest_dir.resolve())
except ValueError:
return set(name for name in names if p / name in expanded_excluded)
else:
if p.is_relative_to(dest_dir.resolve()):
return set(names)
else:
return set(name for name in names if p / name in expanded_excluded)

return _ignore_files
2 changes: 1 addition & 1 deletion substrafl/remote/register/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# minimal and maximal values of Python 3 minor versions supported
# we need to store this as integer, else "3.11" < "3.9" (string comparison)
MINIMAL_PYTHON_VERSION = 9 # 3.9
MINIMAL_PYTHON_VERSION = 10 # 3.10
MAXIMAL_PYTHON_VERSION = 12 # 3.12

_CPU_BASE_IMAGE = """
Expand Down
2 changes: 1 addition & 1 deletion tests/installable_library/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
version="0.0.1",
description="testlib",
packages=find_packages(),
python_requires=">=3.9",
python_requires=">=3.10",
)
4 changes: 2 additions & 2 deletions tests/remote/register/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def add_function(*args):
pass


@pytest.mark.parametrize("version", ["2.7", "3.7", "3.8", "3.18"])
@pytest.mark.parametrize("version", ["2.7", "3.7", "3.8", "3.9", "3.18"])
def test_check_python_version(version):
with pytest.raises(UnsupportedPythonVersionError):
register._check_python_version(version)


@pytest.mark.parametrize("version", ["3.9", "3.10", "3.11", "3.12"])
@pytest.mark.parametrize("version", ["3.10", "3.11", "3.12"])
def test_check_python_version_valid(version):
"""Does not raise for supported versions"""
register._check_python_version(version)
Expand Down

0 comments on commit 70c89f1

Please sign in to comment.