diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 98ca8b581da..b7b69f9fe59 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -3,11 +3,14 @@ version: 2 build: os: "ubuntu-20.04" tools: - python: "3.9" + python: "3.10" sphinx: configuration: docs/source/conf.py python: install: - - requirements: docs/requirements-rtd.txt + - method: pip + path: . + extra_requirements: + - docs diff --git a/docs/requirements-rtd.txt b/docs/requirements-rtd.txt deleted file mode 100644 index df033351705..00000000000 --- a/docs/requirements-rtd.txt +++ /dev/null @@ -1,13 +0,0 @@ -sphinx==5.0.2 -sphinx_rtd_theme==1.0.0 -sphinx-numfig -jupyter -sphinxcontrib-katex -sphinxcontrib-svg2pdfconverter -numpy -scipy -h5py -pandas -uncertainties -matplotlib -lxml diff --git a/openmc/__init__.py b/openmc/__init__.py index e589d35efc9..566d287068f 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -1,3 +1,4 @@ +import importlib.metadata from openmc.arithmetic import * from openmc.bounding_box import * from openmc.cell import * @@ -40,4 +41,4 @@ from . import examples -__version__ = '0.15.1-dev' +__version__ = importlib.metadata.version("openmc") diff --git a/pyproject.toml b/pyproject.toml index d5970617a74..ca646323b24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,74 @@ [build-system] requires = ["setuptools", "wheel", "numpy", "cython"] + +[project] +name = "openmc" +authors = [ + {name = "The OpenMC Development Team", email = "openmc@anl.gov"}, +] +description = "OpenMC" +version = "0.15.1-dev" +requires-python = ">=3.10" +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Topic :: Scientific/Engineering", + "Programming Language :: C++", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [ + "numpy", + "h5py", + "scipy", + "ipython", + "matplotlib", + "pandas", + "lxml", + "uncertainties", + "setuptools", +] + +[project.optional-dependencies] +depletion-mpi = ["mpi4py"] +docs = [ + "sphinx==5.0.2", + "sphinxcontrib-katex", + "sphinx-numfig", + "jupyter", + "sphinxcontrib-svg2pdfconverter", + "sphinx-rtd-theme==1.0.0" +] +test = ["pytest", "pytest-cov", "colorama", "openpyxl"] +vtk = ["vtk"] + +[project.urls] +Homepage = "https://openmc.org" +Documentation = "https://docs.openmc.org" +Repository = "https://github.com/openmc-dev/openmc" +Issues = "https://github.com/openmc-dev/openmc/issues" + +[tool.setuptools.packages.find] +include = ['openmc*', 'scripts*'] +exclude = ['tests*'] + +[tool.setuptools.package-data] +"openmc.data.effective_dose" = ["*.txt"] +"openmc.data" = ["*.txt", "*.DAT", "*.json", "*.h5"] +"openmc.lib" = ["libopenmc.dylib", "libopenmc.so"] + +[project.scripts] +openmc-ace-to-hdf5 = "scripts.openmc_ace_to_hdf5:main" +openmc-plot-mesh-tally = "scripts.openmc_plot_mesh_tally:main" +openmc-track-combine = "scripts.openmc_track_combine:main" +openmc-track-to-vtk = "scripts.openmc_track_to_vtk:main" +openmc-update-inputs = "scripts.openmc_update_inputs:main" +openmc-update-mgxs = "scripts.openmc_update_mgxs:main" +openmc-voxel-to-vtk = "scripts.openmc_voxel_to_vtk:main" diff --git a/setup.py b/setup.py index de87e1490ad..4e24f48a123 100755 --- a/setup.py +++ b/setup.py @@ -1,76 +1,11 @@ #!/usr/bin/env python -import glob -import sys import numpy as np - -from setuptools import setup, find_packages +from setuptools import setup from Cython.Build import cythonize -# Determine shared library suffix -if sys.platform == 'darwin': - suffix = 'dylib' -else: - suffix = 'so' - -# Get version information from __init__.py. This is ugly, but more reliable than -# using an import. -with open('openmc/__init__.py', 'r') as f: - version = f.readlines()[-1].split()[-1].strip("'") - kwargs = { - 'name': 'openmc', - 'version': version, - 'packages': find_packages(exclude=['tests*']), - 'scripts': glob.glob('scripts/openmc-*'), - - # Data files and libraries - 'package_data': { - 'openmc.lib': ['libopenmc.{}'.format(suffix)], - 'openmc.data': ['mass_1.mas20.txt', 'BREMX.DAT', 'half_life.json', '*.h5'], - 'openmc.data.effective_dose': ['*.txt'] - }, - - # Metadata - 'author': 'The OpenMC Development Team', - 'author_email': 'openmc@anl.gov', - 'description': 'OpenMC', - 'url': 'https://openmc.org', - 'download_url': 'https://github.com/openmc-dev/openmc/releases', - 'project_urls': { - 'Issue Tracker': 'https://github.com/openmc-dev/openmc/issues', - 'Documentation': 'https://docs.openmc.org', - 'Source Code': 'https://github.com/openmc-dev/openmc', - }, - 'classifiers': [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: End Users/Desktop', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Topic :: Scientific/Engineering' - 'Programming Language :: C++', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - ], - - # Dependencies - 'python_requires': '>=3.10', - 'install_requires': [ - 'numpy>=1.9', 'h5py', 'scipy', 'ipython', 'matplotlib', - 'pandas', 'lxml', 'uncertainties', 'setuptools' - ], - 'extras_require': { - 'depletion-mpi': ['mpi4py'], - 'docs': ['sphinx', 'sphinxcontrib-katex', 'sphinx-numfig', 'jupyter', - 'sphinxcontrib-svg2pdfconverter', 'sphinx-rtd-theme'], - 'test': ['pytest', 'pytest-cov', 'colorama', 'openpyxl'], - 'vtk': ['vtk'], - }, # Cython is used to add resonance reconstruction and fast float_endf 'ext_modules': cythonize('openmc/data/*.pyx'), 'include_dirs': [np.get_include()]