Skip to content

Commit

Permalink
migrate from setup.py to pyproject.toml (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Oct 13, 2022
1 parent f81c168 commit e8a2fbe
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 88 deletions.
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,8 @@ If a valence of 3 is detected on carbon, the formal charge will be assigned to -

# Plugins

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`:
```py
entry_points={
'dpdata.plugins': [
'random=dpdata_random:RandomFormat'
]
},
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):
```toml
[project.entry-points.'dpdata.plugins']
random = "dpdata_random:RandomFormat"
```
16 changes: 16 additions & 0 deletions plugin_example/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[build-system]
requires = ["setuptools>=45"]
build-backend = "setuptools.build_meta"

[project]
name = "dpdata_random"
version = "0.0.0"
description = "An example for dpdata plugin"
dependencies = [
'numpy',
'dpdata',
]
readme = "README.md"

[project.entry-points.'dpdata.plugins']
random = "dpdata_random:RandomFormat"
12 changes: 0 additions & 12 deletions plugin_example/setup.py

This file was deleted.

59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"

[project]
name = "dpdata"
dynamic = ["version"]
description = "Manipulating data formats of DeePMD-kit, VASP, QE, PWmat, and LAMMPS, etc."
authors = [
{name = "DeepModeling"},
{name = "Han Wang", email = "[email protected]"},
]
license = {file = "LICENSE"}
classifiers = [
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
]
dependencies = [
'numpy>=1.14.3',
'monty',
'scipy',
'h5py',
'wcmatch',
'importlib_metadata>=1.4; python_version < "3.8"',
]
requires-python = ">=3.6"
readme = "README.md"
keywords = ["lammps", "vasp", "deepmd-kit"]

[project.urls]
Homepage = "https://github.com/deepmodeling/dpdata"
documentation = "https://docs.deepmodeling.com/projects/dpdata"
repository = "https://github.com/deepmodeling/dpdata"

[project.entry-points.console_scripts]
dpdata = "dpdata.cli:dpdata_cli"

[project.optional-dependencies]
ase = ['ase']
amber = ['parmed']
pymatgen = ['pymatgen']
docs = [
'sphinx',
'recommonmark',
'sphinx_rtd_theme>=1.0.0rc1',
'numpydoc',
'm2r2',
'deepmodeling-sphinx>=0.1.1',
'sphinx-argparse',
]

[tool.setuptools.packages.find]
include = ["dpdata*"]

[tool.setuptools.package-data]
dpdata = ['*.json']

[tool.setuptools_scm]
write_to = "dpdata/_version.py"
69 changes: 0 additions & 69 deletions setup.py

This file was deleted.

0 comments on commit e8a2fbe

Please sign in to comment.