Skip to content

Commit

Permalink
chore: drop Python 3.9 support
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <[email protected]>
  • Loading branch information
SdgJlbl committed Sep 9, 2024
1 parent ce8452a commit 8bdf3b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
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
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

0 comments on commit 8bdf3b8

Please sign in to comment.