-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetup.py
More file actions
185 lines (158 loc) · 5.2 KB
/
Copy pathsetup.py
File metadata and controls
185 lines (158 loc) · 5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import glob
from setuptools import Command
from setuptools import setup
from setuptools.command.build import build # setuptools >= 62.4
try:
from setuptools.command.develop import develop
except ImportError: # pragma: no cover
develop = None
def _read_long_description():
try:
with open("README.md", encoding="utf-8") as f:
return f.read()
except FileNotFoundError:
return ""
def _generate_protos():
"""Generate *_pb2*.py from every .proto under the repo root."""
try:
from grpc_tools import command
except ImportError as exc: # pragma: no cover
raise SystemExit(
"grpcio-tools is required to build openfl-x's gRPC stubs.\n"
"Install it and build without isolation:\n"
" pip install 'grpcio-tools~=1.73.0'\n"
" pip install . --no-build-isolation"
) from exc
command.build_package_protos(".")
class BuildGrpc(Command):
"""Generate gRPC/protobuf Python stubs from .proto files."""
description = "generate gRPC *_pb2*.py stubs from openfl/protocols/*.proto"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
_generate_protos()
def get_source_files(self):
return glob.glob("openfl/protocols/*.proto")
def get_outputs(self):
return []
def get_output_mapping(self):
return {}
class BuildWithGrpc(build):
"""Standard build with proto generation prepended as a sub-command."""
sub_commands = [("build_grpc", None)] + build.sub_commands
cmdclass = {
"build": BuildWithGrpc,
"build_grpc": BuildGrpc,
}
if develop is not None:
class DevelopGrpc(develop):
"""Legacy editable install path: generate stubs before linking."""
def run(self):
self.run_command("build_grpc")
super().run()
cmdclass["develop"] = DevelopGrpc
setup(
name="openfl-x",
version="1.4.0.dev4",
author="Gianluca Mittone",
description="Model-agnostic federated learning",
long_description=_read_long_description(),
long_description_content_type="text/markdown",
url="https://github.com/alpha-unito/OpenFL-extended",
license="Apache-2.0",
python_requires=">=3.10,<3.14",
packages=[
"openfl",
"openfl.component",
"openfl.interface.aggregation_functions",
"openfl.interface.aggregation_functions.core",
"openfl.interface.aggregation_functions.experimental",
"openfl.component.aggregator",
"openfl.component.assigner",
"openfl.component.ca",
"openfl.component.collaborator",
"openfl.component.director",
"openfl.component.envoy",
"openfl.component.straggler_handling_functions",
"openfl.cryptography",
"openfl.databases",
"openfl.databases.utilities",
"openfl.federated",
"openfl.federated.data",
"openfl.federated.plan",
"openfl.federated.task",
"openfl.interface",
"openfl.interface.interactive_api",
"openfl.native",
"openfl.pipelines",
"openfl.plugins",
"openfl.plugins.frameworks_adapters",
"openfl.plugins.interface_serializer",
"openfl.plugins.processing_units_monitor",
"openfl.protocols",
"openfl.transport",
"openfl.transport.grpc",
"openfl.utilities",
"openfl.utilities.data_splitters",
"openfl.utilities.fedcurv",
"openfl.utilities.fedcurv.torch",
"openfl.utilities.optimizers.keras",
"openfl.utilities.optimizers.numpy",
"openfl.utilities.optimizers.torch",
"openfl-docker",
"openfl-gramine",
"openfl-tutorials",
"openfl-workspace",
],
include_package_data=True,
install_requires=[
"Click>=8.1,<9",
"PyYAML>=6.0",
"cloudpickle",
"cryptography>=42.0",
"dill",
"docker",
"dynaconf>=3.2,<4",
"flatten_json",
"grpcio>=1.73,<2.0",
"protobuf>=5.28,<7",
"ipykernel",
"jupyterlab",
"numpy",
"pandas",
"requests",
"rich",
"scikit-learn",
"tensorboard",
"tensorboardX",
"tqdm",
"wandb",
],
setup_requires=["grpcio-tools~=1.73.0"],
entry_points={
"console_scripts": ["fx=openfl.interface.cli:entry"],
},
project_urls={
"Source Code": "https://github.com/alpha-unito/OpenFL-extended",
},
classifiers=[
"Environment :: Console",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: System :: Distributed Computing",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
],
cmdclass=cmdclass,
)