diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index da3e642c..2556e0ae 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/changes/428.removed b/changes/428.removed new file mode 100644 index 00000000..8a3d28ca --- /dev/null +++ b/changes/428.removed @@ -0,0 +1 @@ +Drop Python 3.9 support. diff --git a/pyproject.toml b/pyproject.toml index 0b56ca4f..89f47c66 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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", 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}",