From ede357cefc4506915aa9631148fee85222615a88 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Thu, 29 Sep 2022 17:22:01 +0100 Subject: [PATCH 1/2] adopted latest py packaging approach --- dagmc_geometry_slice_plotter/__init__.py | 15 ++++---- pyproject.toml | 43 ++++++++++++++++++++--- setup.cfg | 44 ------------------------ setup.py | 4 --- 4 files changed, 44 insertions(+), 62 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/dagmc_geometry_slice_plotter/__init__.py b/dagmc_geometry_slice_plotter/__init__.py index 3be41ee..e3d04ab 100644 --- a/dagmc_geometry_slice_plotter/__init__.py +++ b/dagmc_geometry_slice_plotter/__init__.py @@ -1,13 +1,10 @@ -try: - from importlib.metadata import version, PackageNotFoundError -except (ModuleNotFoundError, ImportError): - from importlib_metadata import version, PackageNotFoundError -try: - __version__ = version("dagmc_geometry_slice_plotter") -except PackageNotFoundError: - from setuptools_scm import get_version +from importlib.metadata import version#, PackageNotFoundError +# try: +__version__ = version("dagmc_geometry_slice_plotter") +# except PackageNotFoundError: +# from setuptools_scm import get_version - __version__ = get_version(root="..", relative_to=__file__) +# __version__ = get_version(root="..", relative_to=__file__) __all__ = ["__version__"] diff --git a/pyproject.toml b/pyproject.toml index b213cd8..c5a3257 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,43 @@ [build-system] -requires = [ - "setuptools >= 45", - "wheel", - "setuptools_scm[toml] >= 6.2", -] +requires = ["setuptools >= 65.4.0", "setuptools_scm[toml]>=7.0.5"] build-backend = "setuptools.build_meta" +[project] +name = "dagmc_geometry_slice_plotter" +authors = [ + { name="Jonathan Shimwell", email="mail@jshimwell.com" }, +] +license = {file = "LICENSE.txt"} +description = "A minimal Python package for creating plots of slices through DAGMC geometry" +readme = "README.md" +requires-python = ">=3.8" +keywords = ["dagmc", "geometry", "plot", "slice"] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + "matplotlib", + "trimesh", + "shapely", + "scipy", + "meshio", + "h5py" +] +dynamic = ["version"] + + [tool.setuptools_scm] write_to = "dagmc_geometry_slice_plotter/_version.py" + + +[project.optional-dependencies] +tests = [ + "pytest", + "pytest-cov" +] + +[project.urls] +"Homepage" = "https://github.com/fusion-energy/dagmc_geometry_slice_plotter" +"Bug Tracker" = "https://github.com/fusion-energy/dagmc_geometry_slice_plotter/issues" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 04be1b9..0000000 --- a/setup.cfg +++ /dev/null @@ -1,44 +0,0 @@ -[metadata] -name = dagmc_geometry_slice_plotter -author = The Fusion Energy Development Team -author_email = mail@jshimwell.com -description = A minimal Python package for creating plots of slices through DAGMC geometry -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/fusion-energy/dagmc_geometry_slice_plotter -license = MIT -license_file = LICENSE.txt -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 - Programming Language :: Python :: 3.10 - License :: OSI Approved :: MIT License - Operating System :: OS Independent -project_urls = - Source = https://github.com/fusion-energy/dagmc_geometry_slice_plotter - Tracker = https://github.com/fusion-energy/dagmc_geometry_slice_plotter/issues - -[options] -packages = find: -python_requires= >=3.6 -install_requires= - matplotlib >= 3.4.2 - trimesh - shapely - scipy - meshio - h5py - setuptools_scm # not sure why this is needed, other codes using this setup.cfg don't need setuptools_scm here - -[options.extras_require] -tests = - pytest >= 5.4.3 - pytest-cov>=2.12.1 - -[flake8] -per-file-ignores = __init__.py:F401 diff --git a/setup.py b/setup.py deleted file mode 100644 index 1abbd06..0000000 --- a/setup.py +++ /dev/null @@ -1,4 +0,0 @@ -import setuptools - -if __name__ == "__main__": - setuptools.setup() From 86de3828ae4ede355c5644b1ee79a6b9c97dfc30 Mon Sep 17 00:00:00 2001 From: shimwell Date: Thu, 29 Sep 2022 16:23:03 +0000 Subject: [PATCH 2/2] [skip ci] Apply formatting changes --- dagmc_geometry_slice_plotter/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dagmc_geometry_slice_plotter/__init__.py b/dagmc_geometry_slice_plotter/__init__.py index e3d04ab..39b8596 100644 --- a/dagmc_geometry_slice_plotter/__init__.py +++ b/dagmc_geometry_slice_plotter/__init__.py @@ -1,4 +1,5 @@ -from importlib.metadata import version#, PackageNotFoundError +from importlib.metadata import version # , PackageNotFoundError + # try: __version__ = version("dagmc_geometry_slice_plotter") # except PackageNotFoundError: