Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added __version__ to Flower #952

Merged
merged 12 commits into from
Dec 28, 2021
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ python = "^3.6.2"
numpy = "^1.19.0"
grpcio = "^1.27.2"
google = "^2.0.3"
importlib-metadata = { version = "^1.0", python = "<3.8" }
protobuf = "^3.12.1"
dataclasses = { version = "==0.6", markers = "python_version < '3.7'" }
# Optional dependencies
Expand Down
10 changes: 10 additions & 0 deletions src/py/flwr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# ==============================================================================
"""Flower main package."""

import sys

from . import client, server, simulation

Expand All @@ -22,3 +23,12 @@
"server",
"simulation",
]

# pylint: disable=import-error, no-name-in-module
if sys.version_info < (3, 8):
import importlib_metadata
else:
import importlib.metadata as importlib_metadata
# pylint: enable=import-error, no-name-in-module

__version__ = importlib_metadata.version(__name__)