Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = ["."]

55 changes: 2 additions & 53 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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()