mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Moving most of setup.py to pyproject.toml (#3074)
Co-authored-by: Jon Shimwell <jon@proximafusion.com> Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
cbec1ab035
commit
2107af5e2f
5 changed files with 80 additions and 82 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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 openmc.model import Model
|
|||
from . import examples
|
||||
|
||||
|
||||
__version__ = '0.15.1-dev'
|
||||
__version__ = importlib.metadata.version("openmc")
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
67
setup.py
67
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()]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue