Skip to content
Snippets Groups Projects
Commit 803bbe6b authored by Kakay, Dr. Attila (FWIN) - 9524's avatar Kakay, Dr. Attila (FWIN) - 9524 :smiling_imp:
Browse files

setup.py deleted for testing toml.

parent 74420ea2
No related branches found
No related tags found
2 merge requests!88Release of 2.0.0,!87Replacing setup.py with pyproject.toml
from __future__ import annotations
import os
# import sys
import platform
from pathlib import Path
from setuptools import Extension, dist, find_packages, setup
dist.Distribution().fetch_build_eggs(["cython>=3.0.11", "numpy>=2.1.3"])
import numpy as np
from Cython.Build import cythonize
MODULE_DIR = os.path.dirname(os.path.abspath(__file__))
LOCAL_DIR = os.path.join(MODULE_DIR, "local")
LIB_DIR = os.path.join(LOCAL_DIR, "lib")
LIB_DIR64 = os.path.join(LOCAL_DIR, "lib64")
fem_core_path = Path("tetrax/sample/mesh/fem_core").resolve()
with open("README.md", "r") as fh:
long_description = fh.read()
c_sourcefiles = [
str(fem_core_path / p)
for p in [
"dense2D_onthefly.c",
"bessel_K1.c",
"akmag.c",
"rotation_mat.c",
"matutils.c",
"sorting.c",
"utils.c",
"bnd2d.c",
"opmatspm.c",
"galerkin.c",
"fempreproc.c",
"hotriang.c",
"dense3D.c",
"integration_of_functions.c",
]
]
compiler_extra_args = ["-O3", "-Wno-cpp", "-Wno-unused-function", "-Wall"]
if platform.system() == "Windows":
compiler_extra_args = []
# compiler_extra_args.append("-fopenmp")
compiler_extra_args.append("-std=c99")
compiler_extra_links = ["-Wl,-rpath,{},-rpath,{}".format(LIB_DIR, LIB_DIR64)]
# com_link.append('-fopenmp')
extensions = [
Extension(
"tetrax.sample.mesh.fem_core.cythoncore",
[*c_sourcefiles, "tetrax/sample/mesh/fem_core/cythoncore.pyx"],
libraries=[],
library_dirs=[],
include_dirs=[str(fem_core_path), "main", np.get_include()],
extra_compile_args=compiler_extra_args,
extra_link_args=compiler_extra_links,
)
]
__version__ = ""
with open("tetrax/_version.py") as version_file:
exec(version_file.read()) # noqa: S102
setup(
name="TetraX",
version=__version__,
entry_points={"console_scripts": ["TetraX=fem_core:main"]},
packages=find_packages(),
ext_modules=cythonize(extensions, language_level=3),
py_modules=["tetrax"],
author="Lukas Körber, Attila Kákay",
author_email="l.koerber@hzdr.de, a.kakay@hzdr.de",
url="https://www.tetrax.software",
description="Finite-element micromagnetic modeling package.",
long_description=long_description,
long_description_content_type="text/markdown",
license="GNU GPLv3",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Cython",
"Programming Language :: C",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Mathematics",
],
install_requires=[
"Cython>=3.0.11",
"k3d>=2.16.1",
"meshio>=5.3.5",
"numpy>=2.1.3",
"pandas>=2.2.3",
"plotly>=5.1.0",
"pygmsh>=7.1.14",
"scipy>=1.14.1",
"setuptools",
"tqdm>=4.66.6",
"bibtexparser>=1.4.2",
"joblib>=1.4.2",
"tabulate>=0.9.0",
"matplotlib>=3.9.2",
"pooch==1.8.2",
"wheel>=0.44.0",
],
extras_require={
"dev": [
"sphinx>=7",
"pydata_sphinx_theme",
"nbsphinx",
"numpydoc",
"sphinx_copybutton",
]
},
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment