Skip to content

Commit

Permalink
Merge pull request #12 from fusion-energy/updated_to_setup
Browse files Browse the repository at this point in the history
more modern package setup
  • Loading branch information
shimwell authored Jul 11, 2022
2 parents d16613d + 18903af commit 1eea6a4
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 27 deletions.
File renamed without changes.
15 changes: 15 additions & 0 deletions openmc_source_plotter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
try:
# this works for python 3.7 and lower
from importlib.metadata import version, PackageNotFoundError
except (ModuleNotFoundError, ImportError):
# this works for python 3.8 and higher
from importlib_metadata import version, PackageNotFoundError
try:
__version__ = version("openmc_source_plotter")
except PackageNotFoundError:
from setuptools_scm import get_version

__version__ = get_version(root="..", relative_to=__file__)

__all__ = ["__version__"]

from .utils import get_particle_data
from .utils import create_initial_particles
from .core import plot_source_direction
Expand Down
5 changes: 5 additions & 0 deletions openmc_source_plotter/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = "0.2.1.dev1+g15fa018"
__version_tuple__ = version_tuple = (0, 2, 1, "dev1", "g15fa018")
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[build-system]
requires = [
"setuptools >= 46.4.0",
"wheel",
"setuptools_scm[toml] >= 6.3.1",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "openmc_source_plotter/_version.py"
36 changes: 36 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[metadata]
name = openmc_source_plotter
version = attr: openmc_source_plotter.__version__
author = The openmc_source_plotter Development Team
author_email = mail@jshimwell.com
description = Extract data and create plots of OpenMC particle sources
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/fusion-energy/openmc_source_plotter
license = MIT
license_file = LICENSE.txt
classifiers =
Natural Language :: English
Topic :: Scientific/Engineering
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
License :: OSI Approved :: MIT License
Operating System :: OS Independent
project_urls =
Source = https://github.com/fusion-energy/openmc_source_plotter
Tracker = https://github.com/fusion-energy/openmc_source_plotter/issues

[options]
packages = find:
python_requires= >=3.6
install_requires=
numpy >= 1.21.1
plotly >= 5.1.0
h5py
# openmc is also required but can't yet be installed by pip

[flake8]
per-file-ignores = __init__.py:F401
29 changes: 2 additions & 27 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="openmc_source_plotter",
version="develop",
author="The Fusion Energy Development Team",
author_email="mail@jshimwell.com",
description="Extract data and create plots of OpenMC particle sources",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/fusion-energy/openmc_source_plotter",
packages=setuptools.find_packages(),
classifiers=[
"Natural Language :: English",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
install_requires=["plotly>=5.1.0", "numpy>=1.21.1", "h5py"],
)
if __name__ == "__main__":
setuptools.setup()

0 comments on commit 1eea6a4

Please sign in to comment.