From 003dd667899c113c3b84c74d8a40b8f9d85b6a8f Mon Sep 17 00:00:00 2001 From: Ian Harrison Date: Tue, 7 Apr 2026 15:24:58 +0100 Subject: [PATCH] add pyproject.toml --- pyproject.toml | 43 +++++++++++++++++++++++++++++++++++++++ setup.py | 55 ++------------------------------------------------ 2 files changed, 45 insertions(+), 53 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b045155 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "cosmpower" +version = "0.2.0" +description = "Machine Learning - accelerated Bayesian inference" +readme = "README.md" +authors = [ + { name = "Alessio Spurio Mancini", email = "alessio.spuriomancini@rhul.ac.uk" } +] +license = { text = "GNU General Public License v3 (GPLv3)" } +requires-python = ">=3.8" +classifiers = [ + "Operating System :: OS Independent", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", +] +dependencies = [ + "numpy", + "astropy>=3.2", + "scikit-learn", + "tqdm", + "gdown", + "jupyter", + "mkdocs-material", + "mkdocstrings", + "matplotlib", + "pytest", + "pyDOE", + "h5py", + "tensorflow>=2.18", + "tensorflow_probability>=0.24", + "tf-keras" +] + +[project.urls] +homepage = "https://alessiospuriomancini.github.io/cosmopower/" + +[tool.setuptools.packages.find] +where = ["."] + diff --git a/setup.py b/setup.py index 6f79b99..fc1f76c 100644 --- a/setup.py +++ b/setup.py @@ -1,54 +1,3 @@ -#!/usr/bin/env python +from setuptools import setup -from setuptools import setup, find_packages -import sys -import os -import shutil - -thelibFolder = os.path.dirname(os.path.realpath(__file__)) -requirementPath = thelibFolder + '/requirements.txt' -install_requires = [] -if os.path.isfile(requirementPath): - with open(requirementPath) as f: - install_requires = f.read().splitlines() - -def read_file(file): - with open(file) as f: - return f.read() - -long_description = read_file("README.md") - -# Determine whether the system is M1/M2 Mac -# if 'arm' in os.uname().machine: -# tensorflow = 'tensorflow-metal' -# else: -# tensorflow = 'tensorflow<2.14' - -tensorflow = 'tensorflow' - -setup(classifiers=['Operating System :: OS Independent', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research' - ], - name='cosmopower', - version='v0.2.0', - description='Machine Learning - accelerated Bayesian inference', - long_description_content_type = "text/markdown", - long_description = long_description, - author='Alessio Spurio Mancini', - author_email='alessio.spuriomancini@rhul.ac.uk', - license='GNU General Public License v3 (GPLv3)', - url='https://github.com/alessiospuriomancini/cosmopower', - packages=find_packages(), - install_requires=[tensorflow, install_requires], - ) - -# cd to parent dir of setup.py -os.chdir(os.path.dirname(os.path.abspath(__file__))) -shutil.rmtree("dist", True) - -# Clean up -shutil.rmtree("build", True) -shutil.rmtree("cosmopower.egg-info", True) -shutil.rmtree("__pycache__", True) -shutil.rmtree(".pytest_cache", True) +setup() \ No newline at end of file