forked from deepmodeling/deepmd-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
251 lines (221 loc) · 7.9 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
[build-system]
requires = [
# dynamic metadata API is still unstable
# TODO: unpin the upper bound when it is stable
"scikit-build-core>=0.5,<0.6",
"packaging",
]
build-backend = "backend.dp_backend"
backend-path = ["."]
[project]
name = "deepmd-kit"
dynamic = ["version", "optional-dependencies", "scripts", "readme"]
description = "A deep learning package for many-body potential energy representation and molecular dynamics"
authors = [
{name = "DeepModeling"},
{name = "Han Wang", email = "[email protected]"},
]
license = {file = "LICENSE"}
classifiers = [
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Development Status :: 5 - Production/Stable",
"Programming Language :: C",
"Programming Language :: C++",
"Programming Language :: Python :: 3 :: Only",
"Environment :: GPU :: NVIDIA CUDA :: 11.8",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Chemistry",
"Environment :: Console",
]
dependencies = [
'numpy',
'scipy',
'pyyaml',
'dargs >= 0.4.1',
'python-hostlist >= 1.21',
'typing_extensions; python_version < "3.8"',
'importlib_metadata>=1.4; python_version < "3.8"',
'h5py',
'wcmatch',
'packaging',
]
requires-python = ">=3.7"
keywords = ["deepmd"]
[project.entry-points."lammps.plugins"]
deepmd = "deepmd.lmp:get_op_dir"
[project.entry-points."dpgui"]
"DeePMD-kit" = "deepmd.utils.argcheck:gen_args"
[project.urls]
Homepage = "https://github.com/deepmodeling/deepmd-kit"
documentation = "https://docs.deepmodeling.com/projects/deepmd"
repository = "https://github.com/deepmodeling/deepmd-kit"
[tool.setuptools_scm]
[tool.scikit-build]
experimental = true
minimum-version = "0.5"
cmake.source-dir = "source"
sdist.include = [
"/deepmd/_version.py",
]
sdist.exclude = [
"/source/tests",
"/source/api_c/tests",
"/source/api_cc/tests",
"/source/lib/tests",
"/source/lmp/tests",
"/doc",
"/examples",
"/data",
"/.github",
]
wheel.packages = [
"deepmd",
"deepmd_cli",
]
wheel.py-api = "py37"
build-dir = "build/{wheel_tag}"
[tool.scikit-build.metadata.version]
provider = "scikit_build_core.metadata.setuptools_scm"
[tool.scikit-build.metadata.optional-dependencies]
provider = "backend.dynamic_metadata"
provider-path = "backend"
[tool.scikit-build.metadata.scripts]
provider = "backend.dynamic_metadata"
provider-path = "backend"
[tool.scikit-build.metadata.readme]
provider = "scikit_build_core.metadata.fancy_pypi_readme"
[[tool.scikit-build.generate]]
path = "deepmd_cli/_version.py"
template = '''
version = "${version}"
'''
[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# links
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
replacement = '[\1](https://github.com/deepmodeling/deepmd-kit/tree/master/\g<2>)'
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
# image
pattern = '(srcset|src)="((?!https?://)\S+?)"'
replacement = '\1="https://github.com/deepmodeling/deepmd-kit/raw/master/\g<2>"'
[tool.cibuildwheel]
test-command = [
"python -m deepmd -h",
"dp -h",
"dp_ipi",
"pytest {project}/source/tests/test_lammps.py"
]
test-extras = ["cpu", "test", "lmp", "ipi"]
build = ["cp310-*"]
skip = ["*-win32", "*-manylinux_i686", "*-musllinux*"]
# TODO: bump to "latest" tag when CUDA supports GCC 12
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:2022-11-19-1b19e81"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:2022-11-19-1b19e81"
[tool.cibuildwheel.macos]
environment = { PIP_PREFER_BINARY="1", DP_LAMMPS_VERSION="stable_2Aug2023_update1", DP_ENABLE_IPI="1" }
before-all = [
"""if [[ "$CIBW_BUILD" != *macosx_arm64* ]]; then brew install mpich; fi""",
]
before-build = [
"""if [[ "$CIBW_BUILD" == *macosx_arm64* ]]; then python -m pip install "tensorflow-macos>=2.13.0rc0" --platform macosx_12_0_arm64 --no-deps --target=$RUNNER_TEMP/tensorflow; fi""",
]
repair-wheel-command = """if [[ "$CIBW_BUILD" == *macosx_arm64* ]]; then rm -rf $RUNNER_TEMP/tensorflow; fi && delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} --ignore-missing-dependencies"""
[tool.cibuildwheel.linux]
repair-wheel-command = "auditwheel repair --exclude libtensorflow_framework.so.2 --exclude libtensorflow_framework.so.1 --exclude libtensorflow_framework.so --exclude _pywrap_tensorflow_internal.so --exclude libtensorflow_cc.so.2 -w {dest_dir} {wheel}"
environment-pass = ["CIBW_BUILD", "DP_VARIANT"]
environment = { PIP_PREFER_BINARY="1", DP_LAMMPS_VERSION="stable_2Aug2023_update1", DP_ENABLE_IPI="1", MPI_HOME="/usr/lib64/mpich", PATH="/usr/lib64/mpich/bin:$PATH" }
before-all = [
"""{ if [ "$(uname -m)" = "x86_64" ] ; then yum config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo && yum install -y cuda-nvcc-11-8 cuda-cudart-devel-11-8; fi }""",
"yum install -y mpich-devel",
]
[tool.cibuildwheel.windows]
environment = { PIP_PREFER_BINARY="1" }
test-extras = ["cpu"]
test-command = [
"python -m deepmd -h",
"dp -h",
]
# One can run `tox` or `tox -e gpu`
# to run pytest in an isolated environment
# Use with pipx:
# $ pip install -U pipx
# $ pipx tox
[tool.tox]
legacy_tox_ini = """
[tox]
min_version = 4.0
[testenv]
extras =
test
cpu
commands = pytest source/tests
[testenv:gpu]
extras =
test
gpu
commands = pytest source/tests
setenv =
DP_VARIANT = cuda
"""
# selectively turn of lintner warnings, always include reasoning why any warning should
# be silenced
# W504 - line break after binary operator - there is conflict between W503 and W504 in
# some lintners. One recomends line bread after and one before binary operator so we
# swith W504 off and recomend this coding style:
# a = (b + -> instead of -> a = (b
# c) + c)
[tool.autopep8]
ignore = "W504"
# D413 - Missing blank line after last section - makes no sense only adds empy lines in
# docstrings
# D416 - Section name should end with a colon - only applicable to RST type docstrings,
# we are using numpy style
# D203 - 1 blank line required before class docstring - only adds unnecessary empty space
# D107 - Missing docstring in __init__ - Nupmy style documents __init__ parameters in
# class docstring
# D213 - Multi-line docstring summary should start at the second line - unnecessary waste
# of space, start on the first line
[tool.pydocstyle]
ignore = "D413, D416, D203, D107, D213"
[tool.isort]
profile = "black"
force_grid_wrap = 1
[tool.ruff]
select = [
"E", # errors
"F", # pyflakes
"D", # pydocstyle
"UP", # pyupgrade
"C4", # flake8-comprehensions
"RUF", # ruff
"NPY", # numpy
]
ignore = [
"E501", # line too long
"F841", # local variable is assigned to but never used
"E741", # ambiguous variable name
"E402", # module level import not at top of file
"D100", # TODO: missing docstring in public module
"D101", # TODO: missing docstring in public class
"D102", # TODO: missing docstring in public method
"D103", # TODO: missing docstring in public function
"D104", # TODO: missing docstring in public package
"D105", # TODO: missing docstring in magic method
"D205", # 1 blank line required between summary line and description
"D401", # TODO: first line should be in imperative mood
"D404", # TODO: first word of the docstring should not be This
]
ignore-init-module-imports = true
[tool.ruff.pydocstyle]
convention = "numpy"
[tool.pytest.ini_options]
markers = "run"