Skip to content

Commit e8a2fbe

Browse files
authored
migrate from setup.py to pyproject.toml (#366)
1 parent f81c168 commit e8a2fbe

File tree

5 files changed

+79
-88
lines changed

5 files changed

+79
-88
lines changed

README.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,8 @@ If a valence of 3 is detected on carbon, the formal charge will be assigned to -
259259

260260
# Plugins
261261

262-
One can follow [a simple example](plugin_example/) to add their own format by creating and installing plugins. It's critical to add the [Format](dpdata/format.py) class to `entry_points['dpdata.plugins']` in `setup.py`:
263-
```py
264-
entry_points={
265-
'dpdata.plugins': [
266-
'random=dpdata_random:RandomFormat'
267-
]
268-
},
262+
One can follow [a simple example](plugin_example/) to add their own format by creating and installing plugins. It's critical to add the [Format](dpdata/format.py) class to `entry_points['dpdata.plugins']` in [`pyproject.toml`](plugin_example/pyproject.toml):
263+
```toml
264+
[project.entry-points.'dpdata.plugins']
265+
random = "dpdata_random:RandomFormat"
269266
```

plugin_example/pyproject.toml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[build-system]
2+
requires = ["setuptools>=45"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "dpdata_random"
7+
version = "0.0.0"
8+
description = "An example for dpdata plugin"
9+
dependencies = [
10+
'numpy',
11+
'dpdata',
12+
]
13+
readme = "README.md"
14+
15+
[project.entry-points.'dpdata.plugins']
16+
random = "dpdata_random:RandomFormat"

plugin_example/setup.py

-12
This file was deleted.

pyproject.toml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[build-system]
2+
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "dpdata"
7+
dynamic = ["version"]
8+
description = "Manipulating data formats of DeePMD-kit, VASP, QE, PWmat, and LAMMPS, etc."
9+
authors = [
10+
{name = "DeepModeling"},
11+
{name = "Han Wang", email = "wang_han@iapcm.ac.cn"},
12+
]
13+
license = {file = "LICENSE"}
14+
classifiers = [
15+
"Programming Language :: Python :: 3.6",
16+
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
17+
]
18+
dependencies = [
19+
'numpy>=1.14.3',
20+
'monty',
21+
'scipy',
22+
'h5py',
23+
'wcmatch',
24+
'importlib_metadata>=1.4; python_version < "3.8"',
25+
]
26+
requires-python = ">=3.6"
27+
readme = "README.md"
28+
keywords = ["lammps", "vasp", "deepmd-kit"]
29+
30+
[project.urls]
31+
Homepage = "https://github.com/deepmodeling/dpdata"
32+
documentation = "https://docs.deepmodeling.com/projects/dpdata"
33+
repository = "https://github.com/deepmodeling/dpdata"
34+
35+
[project.entry-points.console_scripts]
36+
dpdata = "dpdata.cli:dpdata_cli"
37+
38+
[project.optional-dependencies]
39+
ase = ['ase']
40+
amber = ['parmed']
41+
pymatgen = ['pymatgen']
42+
docs = [
43+
'sphinx',
44+
'recommonmark',
45+
'sphinx_rtd_theme>=1.0.0rc1',
46+
'numpydoc',
47+
'm2r2',
48+
'deepmodeling-sphinx>=0.1.1',
49+
'sphinx-argparse',
50+
]
51+
52+
[tool.setuptools.packages.find]
53+
include = ["dpdata*"]
54+
55+
[tool.setuptools.package-data]
56+
dpdata = ['*.json']
57+
58+
[tool.setuptools_scm]
59+
write_to = "dpdata/_version.py"

setup.py

-69
This file was deleted.

0 commit comments

Comments
 (0)