Skip to content

Commit

Permalink
pyproject.toml to use poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
sambit-giri committed Dec 30, 2024
1 parent 3ff9f6f commit 7fecad9
Show file tree
Hide file tree
Showing 5 changed files with 919 additions and 289 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build
dist
*.egg-info
tests/__pycache__*
*.lock



19 changes: 19 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from setuptools import Extension, setup
from Cython.Build import cythonize
import numpy as np

# Define Cython extension modules
extensions = [
Extension(
'tools21cm.ViteBetti_cython',
['src/tools21cm/ViteBetti_cython.pyx'],
language="c++",
include_dirs=[np.get_include()]
),
]

def build(setup_kwargs):
setup_kwargs.update({
'ext_modules': cythonize(extensions, language_level=3),
'include_dirs': [np.get_include()],
})
52 changes: 28 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
[build-system]
requires = ["setuptools>=42", "wheel", "cython", "numpy"]
requires = [
"setuptools>=42",
"wheel",
"Cython",
"numpy"
]
build-backend = "setuptools.build_meta"

[project]
[tool.poetry]
name = "tools21cm"
version = "2.2.6"
authors = [
{ name = "Sambit Giri", email = "sambit.giri@gmail.com" }
]
description = "A package providing tools to analyse cosmological simulations of reionization."
description = "A package providing tools to analyse cosmological simulations of reionization"
authors = ["Sambit Giri <sambit.giri@gmail.com>"]
license = "MIT"
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"numpy",
packages = [
{ include = "tools21cm", from = "src" }
]
include = ["src/tools21cm/input_data/*"]

[tool.setuptools]
packages = ["tools21cm"]
package-dir = { "" = "src" }
include-package-data = true

[tool.setuptools.package-data]
tools21cm = ["input_data/*"]
[tool.poetry.dependencies]
python = ">=3.8"
numpy = "^1.21"
cython = "^0.29"
scipy = "^1.7"
matplotlib = "^3.4"
astropy = "^4.0"
scikit-learn = "^0.24"
scikit-image = "^0.18"
tqdm = "^4.60"
joblib = "^1.0"
pandas = "^1.3"
pytest = "^6.2"

[tool.setuptools.ext-modules]
tools21cm.ViteBetti_cython = {
sources = ["src/tools21cm/ViteBetti_cython.pyx"],
language = "c++",
include_dirs = ["numpy.get_include()"],
}
[tool.poetry.dev-dependencies]
pytest = "^6.2" # If you want pytest to be part of development dependencies, but you already have it above too.

[tool.cythonize]
language_level = 3
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ numpy
scipy
matplotlib
astropy
# pyfftw
scikit-learn
scikit-image
## pyfits
tqdm
joblib
pandas
Expand Down
Loading

0 comments on commit 7fecad9

Please sign in to comment.