Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: drop Python 3.9 support #428

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
name: Tests on Python ${{ matrix.python-version }}
steps:
- name: Set up python
Expand Down
1 change: 1 addition & 0 deletions changes/428.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 @@ -13,7 +13,7 @@ name = "substra"
description = "Low-level Python library for interacting with a Substra network"
dynamic = ["version"]
readme = "README.md"
requires-python = ">= 3.9"
requires-python = ">= 3.10"
dependencies = [
"requests!=2.32.*",
"docker",
Expand All @@ -28,7 +28,6 @@ classifiers = [
"Topic :: Utilities",
"Natural Language :: English",
"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 Down
16 changes: 2 additions & 14 deletions substra/sdk/backends/local/compute/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ def _get_cmd_template_inputs_outputs(
]
return command_template

def _tmp_is_three_nine(self):
"""Temporary helper function to remove as soon as support of Python 3.9 is dropped."""
import platform

return platform.python_version_tuple()[1] == "9"

def _prepare_artifact_input(self, task_input, task_key, input_volume, multiple):
outputs = self._db.list(
schemas.Type.OutputAsset,
Expand All @@ -156,21 +150,15 @@ def _prepare_artifact_input(self, task_input, task_key, input_volume, multiple):
assert output.kind == schemas.AssetKind.model, "The task_input value must be an artifact, not a performance"
filename = _generate_filename()
path_to_input = input_volume / filename
if self._tmp_is_three_nine():
Path(output.asset.address.storage_address).link_to(path_to_input)
else:
Path(path_to_input).hardlink_to(output.asset.address.storage_address)
Path(path_to_input).hardlink_to(output.asset.address.storage_address)

return TaskResource(id=task_input.identifier, value=f"{TPL_VOLUME_INPUTS}/{filename}", multiple=multiple)

def _prepare_dataset_input(
self, dataset: models.Dataset, task_input: models.InputRef, input_volume: str, multiple: bool
):
path_to_opener = input_volume / Filenames.OPENER.value
if self._tmp_is_three_nine():
Path(dataset.opener.storage_address).link_to(path_to_opener)
else:
Path(path_to_opener).hardlink_to(dataset.opener.storage_address)
Path(path_to_opener).hardlink_to(dataset.opener.storage_address)
return TaskResource(
id=task_input.identifier,
value=f"{TPL_VOLUME_INPUTS}/{Filenames.OPENER.value}",
Expand Down