From e2ef6d1c8dbb10c0ae16987a3b3c806eeb4c2f27 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 30 Aug 2022 23:49:39 -0700 Subject: [PATCH] move to hatch-based build --- MANIFEST.in | 2 -- meanas/LICENSE.md | 1 + meanas/README.md | 1 + meanas/VERSION.py | 4 ---- meanas/__init__.py | 5 ++--- pyproject.toml | 53 ++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 45 --------------------------------------- 7 files changed, 57 insertions(+), 54 deletions(-) delete mode 100644 MANIFEST.in create mode 120000 meanas/LICENSE.md create mode 120000 meanas/README.md delete mode 100644 meanas/VERSION.py create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index c28ab72..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include README.md -include LICENSE.md diff --git a/meanas/LICENSE.md b/meanas/LICENSE.md new file mode 120000 index 0000000..7eabdb1 --- /dev/null +++ b/meanas/LICENSE.md @@ -0,0 +1 @@ +../LICENSE.md \ No newline at end of file diff --git a/meanas/README.md b/meanas/README.md new file mode 120000 index 0000000..32d46ee --- /dev/null +++ b/meanas/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/meanas/VERSION.py b/meanas/VERSION.py deleted file mode 100644 index 7261d61..0000000 --- a/meanas/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.7 -'''.strip() diff --git a/meanas/__init__.py b/meanas/__init__.py index 8b9b300..3b426e3 100644 --- a/meanas/__init__.py +++ b/meanas/__init__.py @@ -6,13 +6,12 @@ See the readme or `import meanas; help(meanas)` for more info. import pathlib -from .VERSION import __version__ - +__version__ = '0.7' __author__ = 'Jan Petykiewicz' try: - with open(pathlib.Path(__file__).parent.parent / 'README.md', 'r') as f: + with open(pathlib.Path(__file__).parent / 'README.md', 'r') as f: __doc__ = f.read() except Exception: pass diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..fc66831 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,53 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "meanas" +description = "Electromagnetic simulation tools" +readme = "README.md" +license = { file = "LICENSE.md" } +authors = [ + { name="Jan Petykiewicz", email="jan@mpxd.net" }, + ] +homepage = "https://mpxd.net/code/jan/meanas" +repository = "https://mpxd.net/code/jan/meanas" +keywords = [ + "electromagnetic", + "photonics", + "simulation", + "FDTD", + "FDFD", + "finite", + "difference", + "Bloch", + "EME", + "mode", + "solver", + ] +classifiers = [ + "Programming Language :: Python :: 3", + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Topic :: Scientific/Engineering :: Physics", + ] +requires-python = ">=3.8" +include = [ + "LICENSE.md" + ] +dynamic = ["version"] +dependencies = [ + "numpy~=1.21", + "scipy", + ] + + +[tool.hatch.version] +path = "meanas/__init__.py" + +[project.optional-dependencies] +dev = ["pytest", "pdoc", "gridlock"] +examples = ["gridlock"] +test = ["pytest"] diff --git a/setup.py b/setup.py deleted file mode 100644 index fc7cbe7..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +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('meanas/VERSION.py', 'rt') as f: - version = f.readlines()[2].strip() - -setup(name='meanas', - version=version, - description='Electromagnetic simulation tools', - long_description=long_description, - long_description_content_type='text/markdown', - author='Jan Petykiewicz', - author_email='jan@mpxd.net', - url='https://mpxd.net/code/jan/meanas', - packages=find_packages(), - package_data={ - 'meanas': ['py.typed'] - }, - install_requires=[ - 'numpy', - 'scipy', - ], - extras_require={ - 'test': [ - 'pytest', - 'dataclasses', - ], - 'examples': [ - 'gridlock', - ], - }, - classifiers=[ - 'Programming Language :: Python :: 3', - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: GNU Affero General Public License v3', - 'Topic :: Scientific/Engineering :: Physics', - ], - )