diff --git a/.github/workflows/main-check.yml b/.github/workflows/main-check.yml index 7f20c2a1..9e0a184b 100644 --- a/.github/workflows/main-check.yml +++ b/.github/workflows/main-check.yml @@ -44,11 +44,11 @@ jobs: repository: substra/substra path: substra - - uses: actions/cache@v3.0.8 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('substrafl/pyproject.toml') }}-${{ hashFiles ('substrafl/docs/requirements.txt') }}-${{ hashFiles('substrafl/benchmark/camelyon/requirements.txt') }} +# - uses: actions/cache@v3.0.8 +# id: cache +# with: +# path: ${{ env.pythonLocation }} +# key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('substrafl/pyproject.toml') }}-${{ hashFiles ('substrafl/docs/requirements.txt') }}-${{ hashFiles('substrafl/benchmark/camelyon/requirements.txt') }} - name: Install package run: | diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 57c4de79..dfeaa73b 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-22.04] - python: ["3.9", "3.10", "3.11"] + python: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 @@ -74,7 +74,7 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.11" - uses: actions/cache@v3.0.8 id: cache @@ -105,11 +105,16 @@ jobs: make clean html benchmark: - runs-on: ubuntu-22.04 + name: benchmark-${{ matrix.python }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04] + python: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 - uses: actions/checkout@v4 with: diff --git a/benchmark/camelyon/requirements.txt b/benchmark/camelyon/requirements.txt index b4eff0a4..7c588837 100644 --- a/benchmark/camelyon/requirements.txt +++ b/benchmark/camelyon/requirements.txt @@ -1,6 +1,6 @@ tqdm==4.66.3 -numpy==1.24.3 -scikit-learn==1.5.0 -torch==2.0.1 -torchvision==0.15.2 +numpy==1.26.4 +scikit-learn==1.5.1 +torch==2.3.0 +torchvision==0.18.0 --extra-index-url https://download.pytorch.org/whl/cpu diff --git a/benchmark/camelyon/workflows.py b/benchmark/camelyon/workflows.py index c395752f..23f805be 100644 --- a/benchmark/camelyon/workflows.py +++ b/benchmark/camelyon/workflows.py @@ -93,9 +93,9 @@ def substrafl_fed_avg( ) pypi_dependencies = [ - "numpy==1.24.3", - "torch==2.0.1", - "scikit-learn==1.3.1", + "numpy==1.26.4", + "torch==2.3.0", + "scikit-learn==1.5.1", ] if not torch_gpu: pypi_dependencies += ["--extra-index-url https://download.pytorch.org/whl/cpu"] diff --git a/changes/226.added b/changes/226.added new file mode 100644 index 00000000..3c484d83 --- /dev/null +++ b/changes/226.added @@ -0,0 +1 @@ +Python 3.12 support diff --git a/docs/api/algorithms.rst b/docs/api/algorithms.rst index fb8f8b6c..28721b05 100755 --- a/docs/api/algorithms.rst +++ b/docs/api/algorithms.rst @@ -14,7 +14,7 @@ TorchFedAvgAlgo TorchScaffoldAlgo ----------------- -.. automodule:: substrafl.algorithms.pytorch.torch_scaffold_algo +.. autoclass:: substrafl.algorithms.pytorch.torch_scaffold_algo.TorchScaffoldAlgo :private-members: _local_train, _local_predict, _scaffold_parameters_update, _save_predictions :inherited-members: diff --git a/docs/conf.py b/docs/conf.py index f69d48a1..b666cfcc 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -192,6 +192,8 @@ ("py:class", "FieldInfo"), ("py:class", "ConfigDict"), ("py:class", "ComputedFieldInfo"), + ("py:class", "CUpdateRule"), + ("py:class", "substrafl.algorithms.pytorch.torch_scaffold_algo.CUpdateRule"), ] html_css_files = [ diff --git a/pyproject.toml b/pyproject.toml index fa8f1c28..272b428f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,14 +15,15 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] dynamic = ["version"] readme = "README.md" dependencies = [ "numpy>=1.24,<2.0", "cloudpickle>=1.6.0", - "substra~=0.53.0", - "substratools~=0.21.4", + "substra~=0.54.0a1", + "substratools~=0.22.0a2", "pydantic>=2.3.0,<3.0", "pip>=21.2", "tqdm", diff --git a/substrafl/remote/register/register.py b/substrafl/remote/register/register.py index ba6ceb06..61b60b83 100644 --- a/substrafl/remote/register/register.py +++ b/substrafl/remote/register/register.py @@ -27,7 +27,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 -MAXIMAL_PYTHON_VERSION = 11 # 3.11 +MAXIMAL_PYTHON_VERSION = 12 # 3.12 _DEFAULT_BASE_DOCKER_IMAGE = "python:{python_version}-slim"