From 08a93283901b7068bbf7e0b53eee32b2a7aea5f8 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 22 Nov 2022 14:31:43 -0800 Subject: [PATCH] move to hatch-based build --- opencl_fdtd/LICENSE.md | 1 + opencl_fdtd/README.md | 1 + opencl_fdtd/VERSION.py | 4 ---- opencl_fdtd/__init__.py | 3 +-- pyproject.toml | 46 +++++++++++++++++++++++++++++++++++++++++ setup.py | 32 ---------------------------- 6 files changed, 49 insertions(+), 38 deletions(-) create mode 120000 opencl_fdtd/LICENSE.md create mode 120000 opencl_fdtd/README.md delete mode 100644 opencl_fdtd/VERSION.py create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/opencl_fdtd/LICENSE.md b/opencl_fdtd/LICENSE.md new file mode 120000 index 0000000..7eabdb1 --- /dev/null +++ b/opencl_fdtd/LICENSE.md @@ -0,0 +1 @@ +../LICENSE.md \ No newline at end of file diff --git a/opencl_fdtd/README.md b/opencl_fdtd/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/opencl_fdtd/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/opencl_fdtd/VERSION.py b/opencl_fdtd/VERSION.py deleted file mode 100644 index 202c26a..0000000 --- a/opencl_fdtd/VERSION.py +++ /dev/null @@ -1,4 +0,0 @@ -""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """ -__version__ = ''' -0.4 -'''.strip() diff --git a/opencl_fdtd/__init__.py b/opencl_fdtd/__init__.py index 9bdf6e0..f6596ad 100644 --- a/opencl_fdtd/__init__.py +++ b/opencl_fdtd/__init__.py @@ -1,6 +1,5 @@ from .simulation import Simulation, type_to_C __author__ = 'Jan Petykiewicz' - -from .VERSION import __version__ +__vesion__ = '0.4' version = __version__ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..91160b8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,46 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "opencl_fdtd" +description = "OpenCL FDTD solver" +readme = "README.md" +license = { file = "LICENSE.md" } +authors = [ + { name="Jan Petykiewicz", email="jan@mpxd.net" }, + ] +homepage = "https://mpxd.net/code/jan/opencl_fdtd" +repository = "https://mpxd.net/code/jan/opencl_fdtd" +keywords = [ + "FDTD", + "finite", + "difference", + "time", + "domain", + "simulation", + "optics", + "electromagnetic", + "dielectric", + ] +classifiers = [ + "Programming Language :: Python :: 3", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Manufacturing", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Topic :: Scientific/Engineering", + ] +requires-python = ">=3.8" +dynamic = ["version"] +dependencies = [ + "numpy~=1.21", + "pyopencl", + "jinja2", + "meanas>=0.3", + ] + +[tool.hatch.version] +path = "opencl_fdtd/__init__.py" + diff --git a/setup.py b/setup.py deleted file mode 100644 index e2802e8..0000000 --- a/setup.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 - -from setuptools import setup, find_packages - -with open('README.md', 'r') as f: - long_description = f.read() - -with open('opencl_fdtd/VERSION.py', 'rt') as f: - version = f.readlines()[2].strip() - -setup(name='opencl_fdtd', - version=version, - description='OpenCL FDTD solver', - long_description=long_description, - long_description_content_type='text/markdown', - author='Jan Petykiewicz', - author_email='jan@mpxd.net', - url='https://mpxd.net/code/jan/opencl_fdtd', - packages=find_packages(), - package_data={ - 'opencl_fdfd': ['kernels/*'] - }, - install_requires=[ - 'numpy', - 'pyopencl', - 'jinja2', - 'meanas>=0.3', - ], - extras_require={ - }, - ) -