Getting Started (for Contributors)¶
Prerequisites¶
Python 3.7 or above
Poetry 1.0 or above
(Optional) pyenv
(Optional) pyenv-virtualenv
Flower uses pyproject.toml
to manage dependencies and configure
development tools (the ones which support it). Poetry is a build tool which
supports PEP 517.
Developer Machine Setup¶
First, clone the Flower repository from GitHub:
$ git clone git@github.com:adap/flower.git
$ cd flower
Second, create a virtual environment (and activate it). If you chose to use
pyenv
(with the pyenv-virtualenv
plugin), you can use the
following convenience script:
$ ./dev/venv-create.sh
Third, install the Flower package in development mode (think
pip install -e
) along with all necessary dependencies:
(flower-3.7.9) $ ./dev/bootstrap.sh
Convenience Scripts¶
The Flower repository contains a number of convenience scripts to make
recurring development tasks easier and less error-prone. See the /dev
subdirectory for a full list. The following scripts are amonst the most
important ones:
Create/Delete Virtual Environment¶
$ ./dev/venv-create.sh
$ ./dev/venv-delete.sh
Compile ProtoBuf Definitions¶
$ python -m flwr_tool.protoc
Auto-Format Code¶
$ ./dev/format.sh
Run Linters and Tests¶
$ ./dev/test.sh
Build Release¶
Flower uses Poetry to build releases. The necessary command is wrapped in a simple script:
$ ./dev/build.sh
The resulting .whl
and .tar.gz
releases will be stored in the
/dist
subdirectory.