From 8bdf3b86b4c79a95627c08f53f54132c4ebda680 Mon Sep 17 00:00:00 2001 From: SdgJlbl Date: Mon, 9 Sep 2024 15:59:32 +0200 Subject: [PATCH] chore: drop Python 3.9 support Signed-off-by: SdgJlbl --- .github/workflows/python.yml | 2 +- substra/sdk/backends/local/compute/worker.py | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index aca19056..ec1f34d3 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -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 diff --git a/substra/sdk/backends/local/compute/worker.py b/substra/sdk/backends/local/compute/worker.py index 48fd4c50..1b98335e 100644 --- a/substra/sdk/backends/local/compute/worker.py +++ b/substra/sdk/backends/local/compute/worker.py @@ -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, @@ -156,10 +150,7 @@ 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) @@ -167,10 +158,7 @@ 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}",