-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
313 lines (270 loc) · 10.6 KB
/
pyproject.toml
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# SPDX-FileCopyrightText: 2024 Benedikt Franke <[email protected]>
# SPDX-FileCopyrightText: 2024 Florian Heinrich <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
[project]
# This is the name of your project. The first time you publish this
# package, this name will be registered for you. It will determine how
# users can install this project, e.g.:
#
# $ pip install fl-demonstrator-mnist
#
# And where it will live on PyPI: https://pypi.org/project/fl-demonstrator-mnist/
#
# There are some restrictions on what makes a valid project name
# specification here:
# https://packaging.python.org/specifications/core-metadata/#name
name = "fl-demonstrator-mnist" # Required
# Versions should comply with PEP 440:
# https://www.python.org/dev/peps/pep-0440/
#
# For a discussion on single-sourcing the version, see
# https://packaging.python.org/guides/single-sourcing-package-version/
version = "1.0.0" # Required
# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
# https://packaging.python.org/specifications/core-metadata/#summary
description = "Federated Learning Demonstrator MNIST Example" # Optional
# This is an optional longer description of your project that represents
# the body of text which users will see when they visit PyPI.
#
# Often, this is the same as your README, so you can just read it in from
# that file directly (as we have already done above)
#
# This field corresponds to the "Description" metadata field:
# https://packaging.python.org/specifications/core-metadata/#description-optional
readme = "README.md" # Optional
# Specify which Python versions you support. In contrast to the
# 'Programming Language' classifiers above, 'pip install' will check this
# and refuse to install the project if the version does not match. See
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires
requires-python = ">=3.10"
# This is either text indicating the license for the distribution, or a file
# that contains the license
# https://packaging.python.org/en/latest/specifications/core-metadata/#license
license = {file = "LICENSES/Apache-2.0.txt"}
# This field adds keywords for your project which will appear on the
# project page. What does your project relate to?
#
# Note that this is a list of additional keywords, separated
# by commas, to be used to assist searching for the distribution in a
# larger catalog.
keywords = ["ai", "federated learning", "catena-x", "dlr", "demonstrator", "example"] # Optional
# This should be your name or the name of the organization who originally
# authored the project, and a valid email address corresponding to the name
# listed.
authors = [ # Optional
{name="Benedikt Franke", email="[email protected]"},
{name="Florian Heinrich", email="[email protected]"},
]
# This should be your name or the names of the organization who currently
# maintains the project, and a valid email address corresponding to the name
# listed.
maintainers = [ # Optional
# {name="Jane Doe", email="[email protected]"}
]
# Classifiers help users find your project by categorizing it.
#
# For a list of valid classifiers, see https://pypi.org/classifiers/
classifiers = [ # Optional
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
# Indicate who your project is intended for
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Operating System :: OS Independent",
# Pick your license as you wish
"License :: OSI Approved :: Apache Software License",
# Specify the Python versions you support here. In particular, ensure
# that you indicate you support Python 3. These classifiers are *not*
# checked by "pip install". See instead "python_requires" below.
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
]
# This field lists other packages that your project depends on to run.
# Any package you put here will be installed by pip when your project is
# installed, so they must be valid existing projects.
#
# For an analysis of this field vs pip's requirements files see:
# https://packaging.python.org/discussions/install-requires-vs-requirements/
dependencies = [ # Optional
"boto3~=1.28.2", # used for S3 storage # cspell:ignore boto
"fl-demonstrator-client @ git+https://github.com/DLR-KI/fl-demonstrator-client.git@main",
"dlr-logging @ git+https://github.com/DLR-KI/fl-logging-base.git@main",
"numpy~=1.24.3",
"tensorboard~=2.13.0",
"torch~=2.3",
"torcheval~=0.0.7",
"torchvision~=0.18",
]
# List additional groups of dependencies here (e.g. development
# dependencies). Users will be able to install these using the "extras"
# syntax, for example:
#
# $ pip install -e ".[all]"
#
# Similar to `dependencies` above, these must be valid existing
# projects.
[project.optional-dependencies] # Optional
dev = [
"pre-commit~=3.3.2",
"reuse~=4.0.3",
"tox~=4.5.1",
]
test = [
"autopep8~=2.0.2",
"coverage~=7.2.7",
"flake8~=6.0.0",
"flake8-pyproject~=1.2.3",
"licensecheck", # no version, install latest version
"mypy~=1.3.0",
#"pytest~=7.4.0",
"shellcheck-py~=0.9.0.6",
]
stubs = []
doc = [
"portray @ git+https://github.com/HeinrichAD/portray.git@develop",
#"plantuml-markdown~=3.9.2", # post-install: cp plantuml_markdown.py into markdown/extensions
]
all = ["fl-demonstrator-mnist[dev,test,stubs,doc]"]
# List URLs that are relevant to your project
#
# This field corresponds to the "Project-URL" and "Home-Page" metadata fields:
# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use
# https://packaging.python.org/specifications/core-metadata/#home-page-optional
#
# Examples listed include a pattern for specifying where the package tracks
# issues, where the source is hosted, where to say thanks to the package
# maintainers, and where to support the project financially. The key is
# what's used to render the link text on PyPI.
[project.urls] # Optional
"Homepage" = "https://github.com/DLR-KI/fl-demonstrator-mnist"
"Bug Tracker" = "https://github.com/DLR-KI/fl-demonstrator-mnist/issues"
#"Changelog" = ""https://github.com/DLR-KI/fl-demonstrator-mnist/blob/main/CHANGELOG.md"
#"Funding" = "https://donate.pypi.org"
#"Say Thanks!" = "http://saythanks.io/to/example"
"Source" = "https://github.com/DLR-KI/fl-demonstrator-mnist"
# The following would provide a command line executable called `fl-demonstrator-mnist`
# which executes the function `main` inside `__main__.py` from this package when invoked.
[project.scripts] # Optional
#fl-mnist = "src.__main__:main"
# This is configuration specific to the `setuptools` build backend.
# If you are using a different build backend, you will need to change this.
[tool.setuptools]
# If there are data files included in your packages that need to be
# installed, specify them here.
packages = ["src"]
package-data = {"src" = ["py.typed"]}
license-files = ["LICENSES/*.txt"]
[build-system]
# These are the assumed default build requirements from pip:
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
requires = ["setuptools>=43.0.0", "wheel"]
build-backend = "setuptools.build_meta"
#######################################################################################################################
# licensecheck
# https://github.com/FHPythonUtils/LicenseCheck/blob/master/README.md
[tool.licensecheck]
using = "PEP631"
#using = "PEP631:dev;test;stubs;doc"
zero = true
ignore_packages = [
# Intel oneAPI Math Kernel Library (mkl)
# Comes with PyTorch 2.3.0
# https://cdrdv2-public.intel.com/749362/intel-simplified-license-software-october-2022.pdf
# Note: - Usage and Redistribution is allowed. But Redistribution requires a copyright notice
# - The docker container do not include the mkl library (at the moment)
"mkl",
# https://docs.nvidia.com/cuda/eula/index.html
"nvidia-cublas-cu12",
"nvidia-cuda-cupti-cu12",
"nvidia-cuda-nvrtc-cu12",
"nvidia-cuda-runtime-cu12",
"nvidia-cudnn-cu12", # https://docs.nvidia.com/deeplearning/cudnn/sla/index.html
"nvidia-cufft-cu12",
"nvidia-curand-cu12",
"nvidia-cusolver-cu12",
"nvidia-cusparse-cu12", # https://docs.nvidia.com/cuda/cusparselt/license.html
"nvidia-nccl-cu12", # https://docs.nvidia.com/deeplearning/nccl/sla/index.html
"nvidia-nvjitlink-cu12",
"nvidia-nvtx-cu12", # https://docs.nvidia.com/nvtx/eula/index.html
]
#######################################################################################################################
# flake8
# https://flake8.pycqa.org/en/latest/user/configuration.html
[tool.flake8]
max-line-length = 120
per-file-ignores = [
"__init__.py: F401",
]
exclude = [
".git",
".github",
".*_cache",
".tox",
".venv",
".vscode",
"*.egg",
"*.egg-info",
"__pycache__",
"Interactive-1.interactive",
]
#select = "E,W,F"
#######################################################################################################################
# mypy
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
# Global options
no_implicit_optional = true
show_error_codes = true
#warn_return_any = true
#warn_unused_configs = true
#disallow_untyped_defs = true
# Per-module options
# Ignore missing imports (missing stubs or py.typed)
[[tool.mypy.overrides]]
module = [
"torchvision.*",
"setuptools.*",
]
ignore_missing_imports = true
#######################################################################################################################
# coverage
# https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
branch = true
source = "src"
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
"@overload",
# Don't complain about missing debug-only code:
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if Flase:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
"@(abc\\.)?abstractmethod",
]
ignore_errors = true
skip_empty = true
[tool.coverage.html]
title = "Coverage report for the MNIST example client"
#######################################################################################################################
# pytest
# https://docs.pytest.org/en/latest
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"