Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/actions/bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ inputs:
default: 3.10.19
pip-version:
description: "Version of pip to be installed using pip"
default: 25.3
default: 26.0.1
setuptools-version:
description: "Version of setuptools to be installed using pip"
default: 80.9.0
default: 82.0.0
poetry-version:
description: "Version of poetry to be installed using pip"
default: 2.1.3
description: "Version of poetry to be installed using pipx"
default: 2.3.2
poetry-skip:
description: "Option to skip the poetry installation"
required: false
Expand All @@ -39,11 +39,14 @@ runs:
python-version: ${{ inputs.python-version }}
- name: Install build tools
run: |
python -m pip install -U pip==${{ inputs.pip-version }}
python -m pip install -U setuptools==${{ inputs.setuptools-version }}

if ${{ inputs.poetry-skip == 'false' }}; then
python -m pip install -U pip==${{ inputs.pip-version }}
python -m pip install -U setuptools==${{ inputs.setuptools-version }}
python -m pip install -U poetry==${{ inputs.poetry-version }}
python -m poetry config virtualenvs.create false
python -m pip install -U pipx
python -m pipx install --force poetry==${{ inputs.poetry-version }}
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/poetry" config virtualenvs.create false
fi
shell: bash
- id: versions
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-deploy-non-framework-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- name: Install docs dependencies
run: |
cd framework
python -m poetry add ../datasets
python -m poetry install
poetry install
python -m pip install ../datasets
- name: Update HTML theme options
run: python dev/update-html-themes.py
- name: Build baselines docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/datasets-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install dependencies (mandatory only)
run: |
cd datasets
python -m poetry install --all-extras
poetry install --all-extras
- name: Cache Hugging Face datasets
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deprecated-baselines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
python -m poetry install
poetry install
- name: Lint + Test (isort/black/mypy/pylint/pytest)
run: ./dev/test.sh
2 changes: 1 addition & 1 deletion .github/workflows/framework-devtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
- name: Install dependencies (mandatory + optional)
run: |
cd framework
python -m poetry install
poetry install
- name: Lint + Test (isort/black/mypy/pylint/pytest)
run: ./framework/dev/test-tool.sh
4 changes: 2 additions & 2 deletions .github/workflows/framework-docs-update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
- name: Install dependencies
run: |
cd framework
python -m poetry install
pip install sphinx==7.4.7
poetry install
python -m pip install sphinx==7.4.7

- name: Install pandoc
uses: nikeee/setup-pandoc@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/framework-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Install Flower Framework
run: |
cd framework
python -m poetry install
poetry install
- name: Sync required docs build assets from main for release branches
if: ${{ startsWith(github.ref, 'refs/heads/release/framework-') || (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release/framework-')) || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/framework-')) }}
run: |
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/framework-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
- name: Install dependencies (mandatory only)
run: |
cd framework
python -m poetry install --all-extras
python -m pip install -U setuptools==80.9.0
poetry install --all-extras
- name: Build wheel
run: ./framework/dev/build.sh
- name: Test wheel
Expand Down Expand Up @@ -209,7 +208,7 @@ jobs:
- name: Install build tools
if: ${{ needs.changes.outputs.framework == 'true' }}
run: |
python -m pip install -U pip==23.3.1
python -m pip install -U pip==26.0.1
shell: bash
# Using approach described here for Python location caching:
# https://blog.allenai.org/python-caching-in-github-actions-e9452698e98d
Expand Down Expand Up @@ -285,7 +284,7 @@ jobs:
- name: Install dependencies
if: ${{ needs.changes.outputs.framework == 'true' }}
run: |
python -m poetry install
poetry install
- name: Install Flower wheel from artifact store
if: ${{ needs.changes.outputs.framework == 'true' && github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
run: |
Expand Down Expand Up @@ -344,8 +343,8 @@ jobs:
sed -i 's/"flwr\[[^]]*\][^"]*", *//g' pyproject.toml
# Replace tensorflow with tensorflow-cpu to avoid GPU warnings in CI
sed -i 's/"tensorflow\([^"]*\)"/"tensorflow-cpu\1"/g' pyproject.toml
pip install flwr[simulation]
pip install . --extra-index-url https://download.pytorch.org/whl/cpu
python -m pip install flwr[simulation]
python -m pip install . --extra-index-url https://download.pytorch.org/whl/cpu
- name: Run project
if: ${{ needs.changes.outputs.framework == 'true' }}
working-directory: examples/${{ matrix.example }}
Expand Down Expand Up @@ -385,7 +384,7 @@ jobs:
run: |
flwr new @$ACCOUNT/$APP_NAME
cd $APP_NAME
pip install .
python -m pip install .
- name: Run project
if: ${{ needs.changes.outputs.framework == 'true' }}
run: |
Expand Down Expand Up @@ -510,7 +509,7 @@ jobs:
python-version: '3.10'
- name: Install build tools
if: ${{ needs.changes.outputs.framework == 'true' }}
run: python -m pip install -U pip==23.3.1
run: python -m pip install -U pip==26.0.1
- name: Install dependencies
if: ${{ needs.changes.outputs.framework == 'true' }}
run: |
Expand Down Expand Up @@ -544,7 +543,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install build tools
run: python -m pip install -U pip==23.3.1
run: python -m pip install -U pip==26.0.1
- name: Overwrite ping interval and patience
run: |
sed -i 's/\(HEARTBEAT_DEFAULT_INTERVAL *= *\).*/\120/' framework/py/flwr/common/constant.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/framework-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
curl $wheel_url --output dist/$wheel_name
curl $tar_url --output dist/$tar_name

python -m poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN_RELEASE_FLWR }}
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN_RELEASE_FLWR }}

parameters:
if: ${{ github.repository == 'adap/flower' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/framework-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
if: ${{ needs.changes.outputs.framework == 'true' || needs.changes.outputs.ex_bench == 'true' }}
run: |
cd framework
python -m poetry install --all-extras
poetry install --all-extras
- name: Check if protos need recompilation
if: ${{ needs.changes.outputs.framework == 'true' }}
run: ./framework/dev/check-protos.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/intelligence-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install dependencies (mandatory only)
run: |
cd dev
python -m poetry install --all-extras
poetry install --all-extras
- name: Check docs format
run: |
cd dev
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
run: |
cd framework
python -m poetry install --extras "simulation"
poetry install --extras "simulation"
- name: Download TS docs
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
uses: actions/download-artifact@v4
Expand Down
8 changes: 4 additions & 4 deletions dev/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../
./dev/rm-caches.sh

# Upgrade/install specific versions of `pip`, `setuptools`, and `poetry`
python -m pip install -U pip==25.3
python -m pip install -U setuptools==80.9.0
python -m pip install -U poetry==2.1.3
python -m pip install -U pip==26.0.1
python -m pip install -U setuptools==82.0.0
python -m pip install -U poetry==2.3.2

# Use `poetry` to install project dependencies
python -m poetry install --all-extras
poetry install --all-extras
72 changes: 37 additions & 35 deletions dev/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
[build-system]
requires = ["poetry-core>=2.1.3"]
requires = ["poetry-core>=2.3.1,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
[project]
name = "devtool"
version = "0.0.0"
description = "Tools for developers."
license = "Apache-2.0"
authors = ["The Flower Authors <hello@flower.ai>"]
packages = [{ include = "devtool", from = "./" }]
authors = [{ name = "The Flower Authors", email = "hello@flower.ai" }]
requires-python = ">=3.10,<4.0"
dependencies = [
"clang-format==17.0.6",
"isort==5.13.2",
"black==25.11.0",
"taplo==0.9.3",
"docformatter==1.7.5",
"rope==1.13.0",
"semver==3.0.2",
"sphinx==7.4.7",
"sphinx-intl==2.2.0",
"sphinx-click==6.0.0",
"myst-parser==3.0.1",
"sphinx-design==0.6.1",
"sphinx-copybutton==0.5.2",
"sphinxcontrib-mermaid==0.9.2",
"sphinxcontrib-youtube==1.4.1",
"furo==2024.8.6",
"sphinx-reredirects==0.1.5",
"nbsphinx==0.9.5",
"nbstripout==0.6.1",
"sphinx-argparse==0.4.0",
"mdformat==1.0.0",
"mdformat-gfm==1.0.0",
"mdformat-frontmatter==2.0.10",
"mdformat-beautysh==1.0.0",
"beautysh==6.4.2",
"GitPython==3.1.32",
"sphinx-substitution-extensions==2022.02.16",
"sphinxext-opengraph==0.9.1",
"docstrfmt @ git+https://github.com/charlesbvll/docstrfmt.git@patch-2 ; python_version >= '3.10' and python_version < '4.0'",
]

[tool.poetry.dependencies]
python = "^3.10"
clang-format = "==17.0.6"
isort = "==5.13.2"
black = { version = "==25.11.0" }
taplo = "==0.9.3"
docformatter = "==1.7.5"
rope = "==1.13.0"
semver = "==3.0.2"
sphinx = "==7.4.7"
sphinx-intl = "==2.2.0"
sphinx-click = "==6.0.0"
myst-parser = "==3.0.1"
sphinx-design = "==0.6.1"
sphinx-copybutton = "==0.5.2"
sphinxcontrib-mermaid = "==0.9.2"
sphinxcontrib-youtube = "==1.4.1"
furo = "==2024.8.6"
sphinx-reredirects = "==0.1.5"
nbsphinx = "==0.9.5"
nbstripout = "==0.6.1"
sphinx-argparse = "==0.4.0"
mdformat = "==1.0.0"
mdformat-gfm = "==1.0.0"
mdformat-frontmatter = "==2.0.10"
mdformat-beautysh = "==1.0.0"
beautysh = "==6.4.2"
GitPython = "==3.1.32"
sphinx-substitution-extensions = "2022.02.16"
sphinxext-opengraph = "==0.9.1"
docstrfmt = { git = "https://github.com/charlesbvll/docstrfmt.git", branch = "patch-2", python = ">=3.10,<4.0.0" }
[tool.poetry]
packages = [{ include = "devtool", from = "./" }]

[tool.docstrfmt]
extend_exclude = [
Expand Down
2 changes: 1 addition & 1 deletion framework/dev/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../

python -m poetry build
poetry build
4 changes: 2 additions & 2 deletions framework/dev/publish-nightly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../
if [[ $(git log --since="24 hours ago" --pretty=oneline) ]]; then
sed -i -E "s/^name = \"(.+)\"/name = \"\1-nightly\"/" pyproject.toml
sed -i -E "s/^version = \"(.+)\"/version = \"\1.dev$(date '+%Y%m%d')\"/" pyproject.toml
python -m poetry build
python -m poetry publish -u __token__ -p $PYPI_TOKEN
poetry build
poetry publish -u __token__ -p $PYPI_TOKEN
else
echo "There were no commits in the last 24 hours."
fi
4 changes: 2 additions & 2 deletions framework/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
.. The SuperLink Docker image digest is version-independent and does not necessarily track |stable_flwr_version|.
.. |stable_flwr_superlink_docker_digest| replace:: 4b317d5b6030710b476f4dbfab2c3a33021ad40a0fcfa54d7edd45e0c51d889c
.. |ubuntu_version| replace:: 24.04
.. |setuptools_version| replace:: 80.9.0
.. |pip_version| replace:: 25.3
.. |setuptools_version| replace:: 82.0.0
.. |pip_version| replace:: 26.0.1
.. |python_version| replace:: 3.10
.. |python_full_version| replace:: 3.10.19
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ dependencies. After installing Poetry you simply create a virtual environment wi

.. code-block:: shell

poetry shell
poetry install

If you open a new terminal you can activate the previously created virtual environment
with the following command:

.. code-block:: shell

source $(poetry env info --path)/bin/activate
eval "$(poetry env activate)"

**************************
Virtualenv with Anaconda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
***************

- `Python 3.10 <https://docs.python.org/3.10/>`_ or above
- `Poetry 1.3 <https://python-poetry.org/>`_ or above
- `Poetry 2.3 <https://python-poetry.org/>`_ or above
- (Optional) `pyenv <https://github.com/pyenv/pyenv>`_
- (Optional) `pyenv-virtualenv <https://github.com/pyenv/pyenv-virtualenv>`_

Expand Down Expand Up @@ -75,15 +75,15 @@ Create Flower Dev Environment

::

(your-env-name) $ pip install poetry==2.1.3
(your-env-name) $ pip install poetry==2.3.2

4. Navigate to the ``framework`` directory and install the Flower project in development
mode, including all optional dependencies:

::

(your-env-name) $ cd framework
(your-env-name) $ python -m poetry install --all-extras
(your-env-name) $ poetry install --all-extras

*********************
Convenience Scripts
Expand Down
12 changes: 7 additions & 5 deletions framework/e2e/strategies/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[build-system]
requires = ["poetry-core>=2.1.3"]
requires = ["poetry-core>=2.3.1,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
[project]
name = "quickstart_tensorflow"
version = "0.1.0"
description = "Keras Federated Learning Quickstart with Flower"
authors = ["The Flower Authors <hello@flower.ai>"]
authors = [{ name = "The Flower Authors", email = "hello@flower.ai" }]
requires-python = ">=3.10,<3.11"
dependencies = ["tensorflow-cpu>=2.18.0"]

[tool.poetry]
package-mode = false

[tool.poetry.dependencies]
python = ">=3.10,<3.11"
flwr = { path = "../../", develop = true, extras = ["simulation"] }
tensorflow-cpu = ">=2.18.0"
Loading
Loading