From 5500664554cc1868ff185af2c0d93fc478ac5896 Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Fri, 3 Nov 2023 15:12:44 -0700 Subject: [PATCH] Use pyproject for setuptools. Remove setup.py. --- pyproject.toml | 142 +++++++++++++++++++++++++++++++++---------------- setup.py | 47 ---------------- 2 files changed, 96 insertions(+), 93 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index d48cb36..2d138da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,6 +2,56 @@ requires = ["oldest-supported-numpy", "setuptools>=58.0.3"] build-backend = "setuptools.build_meta" +[project] +name = "matcalc" +authors = [ + + { name = "Eliott Liu", email = "elliottliu17@gmail.com" }, + { name = "Ji Qi", email = "j1qi@ucsd.edu" }, + { name = "Tsz Wai Ko", email = "t1ko@ucsd.edu" }, + { name = "Janosh Riebesell", email = "janosh@lbl.gov" }, + { name = "Shyue Ping Ong", email = "ongsp@ucsd.edu" }, +] +description = "Calculators for materials properties from the potential energy surface." +readme = "README.md" +requires-python = ">=3.9" +keywords = [ + "materials", + "interatomic potential", + "force field", + "science", + "property prediction", + "AI", + "machine learning", + "graph", + "deep learning", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Chemistry", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Scientific/Engineering :: Physics", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "ase", "pymatgen", "joblib", "phonopy" +] +version = "0.0.3" + +[project.optional-dependencies] +models = ["matgl", "chgnet"] + +[tool.setuptools] +packages = ["matcalc"] + + [tool.black] line-length = 120 target-version = ["py39"] @@ -10,42 +60,42 @@ target-version = ["py39"] target-version = "py39" line-length = 120 select = [ - "B", # flake8-bugbear - "C4", # flake8-comprehensions - "D", # pydocstyle - "E", # pycodestyle error - "EXE", # flake8-executable - "F", # pyflakes - "I", # isort - "ICN", # flake8-import-conventions - "ISC", # flake8-implicit-str-concat - "PD", # pandas-vet - "PERF", # perflint - "PIE", # flake8-pie - "PL", # pylint - "PT", # flake8-pytest-style - "PYI", # flakes8-pyi - "Q", # flake8-quotes - "RET", # flake8-return - "RSE", # flake8-raise - "RUF", # Ruff-specific rules - "SIM", # flake8-simplify - "SLOT", # flake8-slots - "TCH", # flake8-type-checking - "TID", # tidy imports - "TID", # flake8-tidy-imports - "UP", # pyupgrade - "W", # pycodestyle warning - "YTT", # flake8-2020 + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "D", # pydocstyle + "E", # pycodestyle error + "EXE", # flake8-executable + "F", # pyflakes + "I", # isort + "ICN", # flake8-import-conventions + "ISC", # flake8-implicit-str-concat + "PD", # pandas-vet + "PERF", # perflint + "PIE", # flake8-pie + "PL", # pylint + "PT", # flake8-pytest-style + "PYI", # flakes8-pyi + "Q", # flake8-quotes + "RET", # flake8-return + "RSE", # flake8-raise + "RUF", # Ruff-specific rules + "SIM", # flake8-simplify + "SLOT", # flake8-slots + "TCH", # flake8-type-checking + "TID", # tidy imports + "TID", # flake8-tidy-imports + "UP", # pyupgrade + "W", # pycodestyle warning + "YTT", # flake8-2020 ] ignore = [ - "B019", # functools.lru_cache on methods can lead to memory leaks - "D105", # Missing docstring in magic method - "D205", # 1 blank line required between summary line and description - "D212", # Multi-line docstring summary should start at the first line - "PLR", # pylint refactor - "PLW0603", # Using the global statement to update variables is discouraged - "SIM105", # Use contextlib.suppress(OSError) instead of try-except-pass + "B019", # functools.lru_cache on methods can lead to memory leaks + "D105", # Missing docstring in magic method + "D205", # 1 blank line required between summary line and description + "D212", # Multi-line docstring summary should start at the first line + "PLR", # pylint refactor + "PLW0603", # Using the global statement to update variables is discouraged + "SIM105", # Use contextlib.suppress(OSError) instead of try-except-pass ] pydocstyle.convention = "google" isort.required-imports = ["from __future__ import annotations"] @@ -77,16 +127,16 @@ relative_files = true [tool.coverage.report] exclude_lines = [ - "@deprecated", - "def __repr__", - "except PackageNotFoundError:", - "if 0:", - "if TYPE_CHECKING:", - "if __name__ == .__main__.:", - "if self.debug:", - "if settings.DEBUG", - "input", - "pragma: no cover", - "raise AssertionError", - "raise NotImplementedError", + "@deprecated", + "def __repr__", + "except PackageNotFoundError:", + "if 0:", + "if TYPE_CHECKING:", + "if __name__ == .__main__.:", + "if self.debug:", + "if settings.DEBUG", + "input", + "pragma: no cover", + "raise AssertionError", + "raise NotImplementedError", ] diff --git a/setup.py b/setup.py deleted file mode 100644 index 7beba61..0000000 --- a/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -"""Setup script for matcalc.""" - -from __future__ import annotations - -from setuptools import find_packages, setup - -setup( - name="matcalc", - version="0.0.3", - author="Eliott Liu, Ji Qi, Tsz Wai Ko, Janosh Riebesell, Shyue Ping Ong", - author_email="ongsp@ucsd.edu", - maintainer="Shyue Ping Ong", - maintainer_email="ongsp@ucsd.edu", - description="Calculators for materials properties from the potential energy surface.", - long_description=open("README.md").read(), # noqa: SIM115 - long_description_content_type="text/markdown", - keywords=[ - "materials", - "interatomic potential", - "force field", - "science", - "property prediction", - "AI", - "machine learning", - "graph", - "deep learning", - ], - packages=find_packages(), - python_requires=">=3.8", - package_data={}, - install_requires=("ase", "pymatgen", "joblib", "phonopy"), - extras_require={"models": ["matgl", "chgnet"]}, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3", - "Topic :: Scientific/Engineering :: Chemistry", - "Topic :: Scientific/Engineering :: Information Analysis", - "Topic :: Scientific/Engineering :: Physics", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -)