Skip to content

Commit

Permalink
Merge pull request #97 from BoothGroup/pyproject
Browse files Browse the repository at this point in the history
Update setup configuration for PEP 518
  • Loading branch information
cjcscott committed Jun 20, 2023
2 parents ed985e4 + d1324d1 commit 5627e55
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 110 deletions.
23 changes: 0 additions & 23 deletions .coveragerc

This file was deleted.

4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
include MANIFEST.in
include README.md setup.py CHANGELOG LICENSE
include README.md pyproject.toml setup.py CHANGELOG LICENSE

global-exclude *.py[cod]
prune vayesta/libs/build

recursive-include vayesta *.dat
recursive-include vayesta/misc/gmtkn55 *
include vayesta/libs/*.so

# MacOS dynamic libraries
Expand Down
114 changes: 114 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
[project]
name = "Vayesta"
description = "A toolkit for quantum embedding methods"
keywords = [
"embedding",
"quantum", "chemistry",
"material", "science",
"electronic", "structure",
"dmet", "rpa"
]
authors = [
{name="M. Nusspickel", email="vayesta.embedding@gmail.com"},
{name="O. J. Backhouse", email="vayesta.embedding@gmail.com"},
{name="B. Ibrahim", email="vayesta.embedding@gmail.com"},
{name="A. Santana-Bonilla", email="vayesta.embedding@gmail.com"},
{name="C. J. C. Scott", email="vayesta.embedding@gmail.com"},
{name="A. Khedkar", email="vayesta.embedding@gmail.com"},
{name="G. H. Booth", email="vayesta.embedding@gmail.com"},
]
license = {file = "LICENSE"}
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: C",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
]
dependencies = [
"numpy>=1.19.0",
"scipy>=1.1.0",
"h5py>=2.7",
"cvxpy>=1.1",
"pyscf @ git+https://github.com/pyscf/pyscf@master",
]
dynamic = ["version"]

[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[tools.setuptools]
license-files = ["LICENSE"]

[tools.setuptools.dynamic]
version = {attr = "vayesta.__version__"}

[project.optional-dependencies]
dmet = [
"cvxpy>=1.1",
]
mpi = [
"mpi4py>=3.0.0",
]
dyson = [
"dyson @ git+https://github.com/BoothGroup/dyson@master",
]
ebcc = [
"ebcc @ git+https://github.com/BoothGroup/ebcc@master",
]
dev = [
"cvxpy>=1.1",
"mpi4py>=3.0.0",
"dyson @ git+https://github.com/BoothGroup/dyson@master",
"ebcc @ git+https://github.com/BoothGroup/ebcc@master",
"pytest",
"pytest-cov",
]

[tool.coverage.run]
branch = true
source = ["vayesta"]
omit = [
"*/libs/*",
"*/tests/*",
"*/tools/*",
"*/core/DEL/*",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise RuntimeError",
"raise NotImplementedError",
"raise AssertionError",
"raise ValueError",
"raise AbstractMethodError",
"except ImportError",
"pass",
"if __name__ == .__main__.:",
"def __repr__",
"def __str__",
"log.error",
"log.critical",
]

[tool.pytest.ini_options]
addopts = "--import-mode=importlib -k 'not veryslow'"
testpaths = ["vayesta/tests"]
markers = [
"fast",
"slow",
"veryslow",
]
5 changes: 0 additions & 5 deletions pytest.ini

This file was deleted.

6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

71 changes: 0 additions & 71 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

setup_src = os.path.dirname(os.path.realpath(__file__))

# TODO: mpi4py as optional extra


class CMakeExtension(Extension):
"""Initialise the name of a CMake extension.
Expand Down Expand Up @@ -124,83 +122,14 @@ def run_tests(self):
[c for c in build.sub_commands if c[0] != 'build_ext'])


# Get the version from the __init__.py:
with open(os.path.join(setup_src, "vayesta", "__init__.py"), "r") as f:
for line in f.readlines():
if line.startswith("__version__ = "):
version = line.strip("__version__ = ")
version = version.replace("\'", "")
version = version.replace("\"", "")


setup(
name="Vayesta",
version=version,
description="A toolkit for quantum embedding methods",
url="https://vayesta.github.io",
download_url="https://github.com/BoothGroup/Vayesta",
keywords=[
"embedding",
"quantum", "chemistry",
"material", "science",
"electronic", "structure",
"dmet", "rpa",
],
author=", ".join([
"M. Nusspickel",
"O. J. Backhouse",
"B. Ibrahim",
"A. Santana-Bonilla",
"C. J. C. Scott",
"A. Khedkar",
"G. H. Booth",
]),
author_email="vayesta.embedding@gmail.com",
license="Apache License 2.0",
platforms=[
"Linux",
"Mac OS-X",
],
python_requires=">=3.7",
classifiers=[
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: C",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
],
packages=find_packages(exclude=["*examples*"]),
include_package_data=True,
install_requires=[
"wheel",
"numpy>=1.19.0",
"scipy>=1.1.0",
"h5py>=2.7",
"pyscf @ git+https://github.com/pyscf/pyscf@master",
],
extras_require={
"dmet": ["cvxpy>=1.1"],
"mpi": ["mpi4py>=3.0.0"],
"ebcc": ["ebcc @ git+https://github.com/BoothGroup/ebcc@master"],
},
ext_modules=[CMakeExtension("vayesta/libs")],
cmdclass={
"build_ext": CMakeBuild,
"test": DiscoverTests,
"clean": CleanCommand,
},
tests_require=[
"pytest",
"pytest-cov",
],
zip_safe=False,
)

0 comments on commit 5627e55

Please sign in to comment.