move to hatch-based build

This commit is contained in:
Jan Petykiewicz 2022-08-30 23:49:39 -07:00
parent c0bbc1f46d
commit e2ef6d1c8d
7 changed files with 57 additions and 54 deletions

View File

@ -1,2 +0,0 @@
include README.md
include LICENSE.md

1
meanas/LICENSE.md Symbolic link
View File

@ -0,0 +1 @@
../LICENSE.md

1
meanas/README.md Symbolic link
View File

@ -0,0 +1 @@
../README.md

View File

@ -1,4 +0,0 @@
""" VERSION defintion. THIS FILE IS MANUALLY PARSED BY setup.py and REQUIRES A SPECIFIC FORMAT """
__version__ = '''
0.7
'''.strip()

View File

@ -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

53
pyproject.toml Normal file
View File

@ -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"]

View File

@ -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',
],
)