From 195f6ab32234cdf452e412baa5229c8df2c14add Mon Sep 17 00:00:00 2001 From: "Min W. Priest (they/them)" Date: Thu, 23 May 2024 10:11:31 -0700 Subject: [PATCH] removed deprecated setup.cfg build system. added pyproject.toml build system. inverted __version__ so that it reads from the build system rather than the other way around. --- MuyGPyS/__init__.py | 4 +- README.md | 10 ++--- pyproject.toml | 97 +++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 47 ---------------------- setup.py | 71 --------------------------------- 5 files changed, 104 insertions(+), 125 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/MuyGPyS/__init__.py b/MuyGPyS/__init__.py index 354c79c5..fafdb5d1 100644 --- a/MuyGPyS/__init__.py +++ b/MuyGPyS/__init__.py @@ -5,7 +5,9 @@ """Public MuyGPyS modules and functions.""" -__version__ = "0.8.2" +import importlib.metadata + +__version__ = importlib.metadata.version(__package__) from MuyGPyS._src.config import ( config as config, diff --git a/README.md b/README.md index 4c281244..70d07e4b 100644 --- a/README.md +++ b/README.md @@ -261,11 +261,10 @@ This repository includes several `extras_require` optional dependencies. - `tests` - install dependencies necessary to run [tests](tests/) - `docs` - install dependencies necessary to build the docs - `dev` - install dependencies for maintaining code style, running performance -benchmarks, linting, and packaging (includes all of the dependencies in `tests` -and `docs`). +benchmarks, linting, and packaging For example, follow these instructions to install from source for development -purposes with JAX support: +purposes with CPU JAX support: ``` $ git clone git@github.com:LLNL/MuyGPyS.git $ cd MuyGPyS @@ -273,8 +272,7 @@ $ pip install -e .[dev,jax_cpu] ``` If you would like to perform a GPU installation from source, you will need to -install the jax dependency directly instead of using the `jax_cuda` flag or -similar. +install the JAX dependency directly. Additionally check out the develop branch to access the latest features in between stable releases. @@ -293,7 +291,7 @@ parallel computation - `tests` - install dependencies necessary to run [tests](tests/) - `docs` - install dependencies necessary to build the [docs](docs/) - `dev` - install dependencies for maintaining code style, linting, and -packaging (includes all of the dependencies in `tests` and `docs`) +packaging ## Building Docs diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..fdd3b69c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,97 @@ +# Copyright 2021-2024 Lawrence Livermore National Security, LLC and other +# MuyGPyS Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: MIT + +build-backend = "setuptools.build_meta" +[build-system] +requires = ["setuptools >= 68.0.0"] + +[project] +name = "muygpys" +version = "0.9.0" +authors = [ + {name = "Min W. Priest" }, +] +description = "Scalable Approximate Gaussian Process using Sparse Kriging" +readme = "README.md" +license = { file = "LICENSE-MIT" } +requires-python = ">=3.10" +classifiers = [ + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: MIT License", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Development Status :: 3 - Alpha", +] +dependencies = [ + "numpy>=1.18.5", + "scipy>=1.9.0", + "scikit-learn>=0.23.2", + "bayesian-optimization>=1.4.2", +] + +[project.urls] +homepage = "https://github.com/LLNL/MuyGPyS" +source = "https://github.com/LLNL/MuyGPyS" +download = "https://pypi.org/project/muygpys" +documentation = "https://muygpys.readthedocs.io" +tracker = "https://github.com/LLNL/MuyGPyS/issues" + +[project.optional-dependencies] +test = [ + "absl-py>=0.13.0", + "matplotlib>=3.2.1", + "pandas==1.5.2", +] +dev = [ + "black>=21.1.0", + "build>=0.7.0", + "mypy>=0.910", + "twine>=3.7.1", + "h5py>=3.7.0", +] +docs = [ + "sphinx==6.2.1", + "sphinx-rtd-theme==1.2.2", + "sphinx-autodoc-typehints==1.22", + "matplotlib>=3.2.1", + "nbsphinx==0.9.2", + "pandas==1.5.2", + "pandoc==2.3.0", + "pandocfilters==1.5.0", + "ipython==7.30.1", + "ipykernel==6.6.0", + "torchvision>=0.14.1", + "cblind>=2.3.1", +] +hnswlib = [ + "pybind11>=2.5.0", + "hnswlib>=0.6.0", +] +jax_cpu = [ + "jax[cpu]>=0.2.26", + "tensorflow-probability[jax]>=0.16.0", +] +mpi = [ + "mpi4py==3.1.3", +] +torch = [ + "torch>=1.13.0", + "torchvision>=0.14.1", +] + +[tool.setuptools] +packages = ["MuyGPyS"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8c1cf57d..00000000 --- a/setup.cfg +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2021-2023 Lawrence Livermore National Security, LLC and other -# MuyGPyS Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: MIT - -[metadata] -name = muygpys -version = attr: MuyGPyS.__version__ -author = Benjamin W. Priest -author_email = priest2@llnl.gov -description = Scalable Approximate Gaussian Process using Local Kriging -long_description = file: README.md -long_description_content_type = text/markdown -license = MIT -url = https://github.com/LLNL/MuyGPyS -download_url = https://pypi.org/project/muygpys -project_urls = - Source Code = https://github.com/LLNL/MuyGPyS - Documentation = https://muygpys.readthedocs.io - Bug Tracker = https://github.com/LLNL/MuyGPyS/issues -classifiers = - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - License :: OSI Approved :: MIT License - Operating System :: MacOS - Operating System :: POSIX :: Linux - Topic :: Software Development - Topic :: Software Development :: Libraries - Topic :: Software Development :: Libraries :: Python Modules - Topic :: Scientific/Engineering - Topic :: Scientific/Engineering :: Mathematics - Topic :: Scientific/Engineering - Intended Audience :: Science/Research - Intended Audience :: Developers - Intended Audience :: Education - Development Status :: 3 - Alpha - -[options] -python_requires = >=3.7 -zip_safe = False -packages = find: -install_requires = - numpy>=1.18.5 - scipy>=1.9.0 - scikit-learn>=0.23.2 - bayesian-optimization>=1.4.2 diff --git a/setup.py b/setup.py deleted file mode 100644 index b8340292..00000000 --- a/setup.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2021-2023 Lawrence Livermore National Security, LLC and other -# MuyGPyS Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: MIT - -from setuptools import setup - - -TEST_REQUIRES = [ - "absl-py>=0.13.0", - "matplotlib>=3.2.1", - "pandas==1.5.2", -] - -DEV_REQUIRES = [ - "black>=21.1.0", - "build>=0.7.0", - "mypy>=0.910", - "twine>=3.7.1", - "h5py>=3.7.0", -] - -DOCS_REQUIRES = [ - "sphinx==6.2.1", - "sphinx-rtd-theme==1.2.2", - "sphinx-autodoc-typehints==1.22", - "matplotlib>=3.2.1", - "nbsphinx==0.9.2", - "pandas==1.5.2", - "pandoc==2.3.0", - "pandocfilters==1.5.0", - "ipython==7.30.1", - "ipykernel==6.6.0", - "torchvision>=0.14.1", - "cblind>=2.3.1", -] - -HNSWLIB_REQUIRES = [ - "pybind11>=2.5.0", - "hnswlib>=0.6.0", -] - -JAX_REQUIRES = [ - "tensorflow-probability[jax]>=0.16.0", -] - -JAX_CPU_REQUIRES = [ - "jax[cpu]>=0.2.26", -] - -MPI_REQUIRES = [ - "mpi4py==3.1.3", -] - -TORCH_REQUIRES = [ - "torch>=1.13.0", -] - -DOCS_REQUIRES += TORCH_REQUIRES - -setup( - extras_require={ - "dev": DEV_REQUIRES + TEST_REQUIRES + DOCS_REQUIRES, - "docs": DOCS_REQUIRES, - "tests": TEST_REQUIRES, - "hnswlib": HNSWLIB_REQUIRES, - "jax_cpu": JAX_CPU_REQUIRES + JAX_REQUIRES, - "mpi": MPI_REQUIRES, - "torch": TORCH_REQUIRES, - }, -)