diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml index 14a391de..7e61145d 100644 --- a/.github/workflows/check-formatting.yml +++ b/.github/workflows/check-formatting.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.11", "3.13", "3.14"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 0dbf51ad..04fea2c7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -59,14 +59,6 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: | ${{ env.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_HUB_REPOSITORY }}:python-slim - - name: Build and push pytorch1.13.1-cu116 version - uses: docker/build-push-action@v7 - with: - context: . - file: ./pytorch1.13.1-cu116.Dockerfile - push: ${{ github.event_name != 'pull_request' }} - tags: | - ${{ env.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_HUB_REPOSITORY }}:pytorch1.13.1-cu116 - name: Build and push pytorch2-latest version uses: docker/build-push-action@v7 with: diff --git a/.github/workflows/docs-test-publish.yml b/.github/workflows/docs-test-publish.yml index 85641684..f208f6ab 100644 --- a/.github/workflows/docs-test-publish.yml +++ b/.github/workflows/docs-test-publish.yml @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml index c8e662f5..e26836d8 100644 --- a/.github/workflows/run-pytest.yml +++ b/.github/workflows/run-pytest.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10", "3.11"] + python-version: ["3.11", "3.13", "3.14"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-apfl.yml b/.github/workflows/test-apfl.yml index 7a189733..e3d07dc8 100644 --- a/.github/workflows/test-apfl.yml +++ b/.github/workflows/test-apfl.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-ditto.yml b/.github/workflows/test-ditto.yml index e3b2af79..672f33d7 100644 --- a/.github/workflows/test-ditto.yml +++ b/.github/workflows/test-ditto.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-fedcr.yml b/.github/workflows/test-fedcr.yml index fe297aff..1f730159 100644 --- a/.github/workflows/test-fedcr.yml +++ b/.github/workflows/test-fedcr.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-feddc.yml b/.github/workflows/test-feddc.yml index 963acccf..4d3d9a0f 100644 --- a/.github/workflows/test-feddc.yml +++ b/.github/workflows/test-feddc.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-feddr.yml b/.github/workflows/test-feddr.yml index 51061b9d..068e982e 100644 --- a/.github/workflows/test-feddr.yml +++ b/.github/workflows/test-feddr.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-feddyn.yml b/.github/workflows/test-feddyn.yml index 156943e5..2ce7ae57 100644 --- a/.github/workflows/test-feddyn.yml +++ b/.github/workflows/test-feddyn.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-fedopt.yml b/.github/workflows/test-fedopt.yml index 488f56ce..a9951d51 100644 --- a/.github/workflows/test-fedopt.yml +++ b/.github/workflows/test-fedopt.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-fedpd.yml b/.github/workflows/test-fedpd.yml index 897bf888..1063ae15 100644 --- a/.github/workflows/test-fedpd.yml +++ b/.github/workflows/test-fedpd.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-fedprox.yml b/.github/workflows/test-fedprox.yml index 1d3a208c..cb759fc6 100644 --- a/.github/workflows/test-fedprox.yml +++ b/.github/workflows/test-fedprox.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-fedsplit.yml b/.github/workflows/test-fedsplit.yml index b891373b..2b478c36 100644 --- a/.github/workflows/test-fedsplit.yml +++ b/.github/workflows/test-fedsplit.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-fpfc.yml b/.github/workflows/test-fpfc.yml index 86c05a27..a9d05025 100644 --- a/.github/workflows/test-fpfc.yml +++ b/.github/workflows/test-fpfc.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-ifca.yml b/.github/workflows/test-ifca.yml index 56a55696..d6534baa 100644 --- a/.github/workflows/test-ifca.yml +++ b/.github/workflows/test-ifca.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-pfedmac.yml b/.github/workflows/test-pfedmac.yml index 28df04e4..0f76219e 100644 --- a/.github/workflows/test-pfedmac.yml +++ b/.github/workflows/test-pfedmac.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-pfedme.yml b/.github/workflows/test-pfedme.yml index 68270d8b..84334e75 100644 --- a/.github/workflows/test-pfedme.yml +++ b/.github/workflows/test-pfedme.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-proxskip.yml b/.github/workflows/test-proxskip.yml index 447547f7..39b464b0 100644 --- a/.github/workflows/test-proxskip.yml +++ b/.github/workflows/test-proxskip.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-scaffold.yml b/.github/workflows/test-scaffold.yml index 35526c83..95452aac 100644 --- a/.github/workflows/test-scaffold.yml +++ b/.github/workflows/test-scaffold.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] steps: - uses: actions/checkout@v7 diff --git a/.github/workflows/test-threads-executor.yml b/.github/workflows/test-threads-executor.yml index 9044b0b2..bf759a66 100644 --- a/.github/workflows/test-threads-executor.yml +++ b/.github/workflows/test-threads-executor.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.13"] algorithm: [fedopt, fedpd, apfl] steps: diff --git a/docs/requirements.txt b/docs/requirements.txt index 3a0a50ea..96f9db5a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,7 +7,7 @@ sphinx-design sphinx-emoji-favicon sphinx-intl sphinxcontrib-napoleon -sphinxcontrib-tikz +sphinxcontrib-tikz>=0.4.20 sphinxcontrib-bibtex sphinxcontrib-proof sphinxcontrib-pseudocode2 diff --git a/docs/source/install.rst b/docs/source/install.rst index b4650d60..d76ddb72 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -1,7 +1,7 @@ Installation instructions ^^^^^^^^^^^^^^^^^^^^^^^^^ -:code:`fl-sim` requires **Python 3.10+** and is available through pip: +:code:`fl-sim` requires **Python 3.11+** and is available through pip: .. code-block:: bash diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/install.po b/docs/source/locale/zh_CN/LC_MESSAGES/install.po index e5d766c3..1a0d3fef 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/install.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/install.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: fl-sim\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-10-06 01:22+0800\n" +"POT-Creation-Date: 2026-11-01 15:54+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: zh \n" @@ -17,23 +17,26 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"Generated-By: Babel 2.16.0\n" +"Generated-By: Babel 2.18.0\n" #: ../../source/install.rst:2 msgid "Installation instructions" msgstr "安装说明" #: ../../source/install.rst:4 -msgid ":code:`fl-sim` requires **Python 3.10+** and is available through pip:" -msgstr ":code:`fl-sim` 需要 **Python 3.10+** ,可通过 pip 安装:" +msgid ":code:`fl-sim` requires **Python 3.11+** and is available through pip:" +msgstr ":code:`fl-sim` 需要 **Python 3.11+** ,可通过 pip 安装:" #: ../../source/install.rst:10 msgid "or clone the repository and run" msgstr "或克隆仓库后运行" #: ../../source/install.rst:16 -msgid "Alternatively, one can use the Docker image `wenh06/fl-sim `_ to run the code. The image is built with the `Docker Image CI action `_. To pull the image, run the following command:" -msgstr "或者,可以使用 Docker 镜像 `wenh06/fl-sim `_ 来运行代码。镜像由 `Docker Image CI action `_ 构建。拉取镜像请运行以下命令:" +msgid "" +"Alternatively, one can use the Docker image `wenh06/fl-sim `_ to run the code. The image is built with the `Docker Image CI action " +"`_. To pull the image, run the following command:" +msgstr "" +"或者,可以使用 Docker 镜像 `wenh06/fl-sim `_ 来运行代码。镜像由 `Docker Image CI action `_ 构建。拉取镜像请运行以下命令:" #: ../../source/install.rst:24 msgid "For the usage (interactive mode), run the following command:" diff --git a/docs/source/locale/zh_CN/LC_MESSAGES/quickstart.po b/docs/source/locale/zh_CN/LC_MESSAGES/quickstart.po index 15c2540a..39b55aee 100644 --- a/docs/source/locale/zh_CN/LC_MESSAGES/quickstart.po +++ b/docs/source/locale/zh_CN/LC_MESSAGES/quickstart.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: fl-sim\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-10-28 23:45+0800\n" +"POT-Creation-Date: 2026-11-01 15:54+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: zh_CN \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"Generated-By: Babel 2.16.0\n" +"Generated-By: Babel 2.18.0\n" #: ../../source/quickstart.rst:4 msgid "Quickstart" @@ -38,8 +38,8 @@ msgid "Prerequisites" msgstr "准备条件" #: ../../source/quickstart.rst:17 -msgid "Install fl-sim following :doc:`install` (``pip install git+https://github.com/wenh06/fl-sim.git``). Python 3.10+ with PyTorch is required." -msgstr "按照 :doc:`install` 安装 fl-sim(``pip install git+https://github.com/wenh06/fl-sim.git``)。需要 Python 3.10+ 与 PyTorch。" +msgid "Install fl-sim following :doc:`install` (``pip install git+https://github.com/wenh06/fl-sim.git``). Python 3.11+ with PyTorch is required." +msgstr "按照 :doc:`install` 安装 fl-sim(``pip install git+https://github.com/wenh06/fl-sim.git``)。需要 Python 3.11+ 与 PyTorch。" #: ../../source/quickstart.rst:21 msgid "Train your first model" @@ -84,6 +84,7 @@ msgid "a ``.txt`` log with the human-readable console history;" msgstr "一个 ``.txt`` 日志,保存人类可读的控制台历史;" #: ../../source/quickstart.rst:65 +#, python-brace-format msgid "" "a ``.json`` log with the full metrics history, structured as ``{\"train\": {...}, \"val\": {\"Server\": [...], \"Client0\": [...], ...}}`` — one dict per evaluation, holding ``step``, ``acc``, " "``loss``, etc. This file is the input for visualization;" diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index 3ab01adf..c0d641e3 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -15,7 +15,7 @@ Prerequisites ------------- Install fl-sim following :doc:`install` (``pip install git+https://github.com/wenh06/fl-sim.git``). -Python 3.10+ with PyTorch is required. +Python 3.11+ with PyTorch is required. Train your first model ---------------------- diff --git a/pyproject.toml b/pyproject.toml index 0c5e5246..4230b676 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "A Simple Simulation Framework for Federated Learning Based on PyTorch" readme = "README.md" license = { file = "LICENSE" } -requires-python = ">=3.10" +requires-python = ">=3.11" authors = [ { name = "wenh06", email = "wenh06@gmail.com" }, ] @@ -17,10 +17,10 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] dependencies = [ "beautifulsoup4", diff --git a/python-slim.Dockerfile b/python-slim.Dockerfile index 44bff712..e8352178 100644 --- a/python-slim.Dockerfile +++ b/python-slim.Dockerfile @@ -1,6 +1,6 @@ # FROM pytorch/pytorch:1.8.0-cuda11.1-cudnn8-devel # FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-runtime -FROM python:3.10-slim +FROM python:3.13-slim ## The MAINTAINER instruction sets the author field of the generated images. LABEL maintainer="wenh06@gmail.com" diff --git a/pytorch1.13.1-cu116.Dockerfile b/pytorch1.13.1-cu116.Dockerfile deleted file mode 100644 index 8d5be35d..00000000 --- a/pytorch1.13.1-cu116.Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# https://hub.docker.com/r/pytorch/pytorch -FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime -# NOTE: -# pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime has python version 3.10.8, system version Ubuntu 18.04.6 LTS -# pytorch/pytorch:1.10.1-cuda11.3-cudnn8-runtime has python version 3.7.x -# pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime has python version 3.10.11, system version Ubuntu 20.04.6 LTS -# FROM python/python:3.8-slim - -# set the environment variable to avoid interactive installation -# which might stuck the docker build process -ENV DEBIAN_FRONTEND=noninteractive -# The base image is Ubuntu 18.04 based (glibc 2.27). The latest versions of -# some dependencies only ship manylinux_2_28 (glibc >= 2.28) wheels and would -# fall back to source builds that need a Rust/C toolchain (e.g. the newest -# pyarrow pulls in libcst, which needs Rust). Prefer the newest versions that -# ship compatible wheels instead. -ENV PIP_PREFER_BINARY=1 - -## The MAINTAINER instruction sets the author field of the generated images. -LABEL maintainer="wenh06@gmail.com" - -RUN mkdir /fl_sim -COPY ./ /fl_sim -WORKDIR /fl_sim - - -## Install your dependencies here using apt install, etc. - -RUN apt update && apt upgrade -y && apt clean -RUN apt install ffmpeg libsm6 libxext6 tar unzip wget vim nano git -y - -# RUN apt install python3-pip -RUN ln -s /usr/bin/python3 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip -# RUN pip install --upgrade pip - -# http://mirrors.aliyun.com/pypi/simple/ -# http://pypi.douban.com/simple/ -# RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple -## Include the following line if you have a requirements.txt file. -# datasets >= 4.1 requires pyarrow >= 21, whose wheels are manylinux_2_28-only -# (glibc >= 2.28, incompatible with this Ubuntu 18.04-based image); pin the -# last versions that ship wheels compatible with the older glibc. -# (PIP_PREFER_BINARY alone is not enough here: the version floor keeps the -# resolver on the sdist, whose build needs a Rust compiler for libcst.) -RUN pip install -r requirements-no-torch.txt "datasets<4.1" "pyarrow<21" -RUN pip install -r requirements-viz.txt -# RUN pip install torch==1.13.1+cu116 -f https://download.pytorch.org/whl/torch_stable.html -RUN pip install torchvision==0.14.1+cu116 --no-deps -f https://download.pytorch.org/whl/torch_stable.html -RUN pip install torch-optimizer --no-deps -RUN python -m pip cache purge - - -RUN python -m pip install . - -# RUN python docker_test.py diff --git a/test/test_custom.py b/test/test_custom.py index 427e2e08..bca313c9 100644 --- a/test/test_custom.py +++ b/test/test_custom.py @@ -6,10 +6,15 @@ **NOT** in the test directory with `pytest -s -v test_custom.py`. """ +import sys + from fl_sim.utils.misc import execute_cmd def test_custom_dataset_algorithm(): - cmd = "fl-sim test-files/custom_conf.yml" + # invoke the module entry point through the running interpreter instead + # of the `fl-sim` console script, so the test does not depend on the + # script directory being on PATH + cmd = f"'{sys.executable}' -m fl_sim.cli test-files/custom_conf.yml" exitcode, _ = execute_cmd(cmd) assert exitcode == 0