diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..f80a592dad --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,104 @@ +[build-system] +requires = ["setuptools>=64"] +build-backend = "setuptools.build_meta" + +[project] +name = "dace" +dynamic = ["version"] +description = "Data-Centric Parallel Programming Framework" +readme = "README.md" +requires-python = ">=3.10, <3.15" +license = {text = "BSD-3-Clause"} +authors = [ + {name = "SPCL @ ETH Zurich", email = "talbn@inf.ethz.ch"}, +] +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", +] +dependencies = [ + "numpy", + "networkx>=2.5,<=3.5", + "astunparse", + "sympy>=1.9", + "pyyaml", + "ply", + "fparser>=0.1.3", + "dill", + "pyreadline; platform_system == 'Windows'", + "packaging", + "typing-extensions", + "scikit-build", + "cmake", +] + +[project.optional-dependencies] +ml = ["onnx", "torch", "onnxsim", "onnxscript", "onnxruntime", "protobuf", "ninja"] +testing = [ + "coverage", + "pytest-cov", + "scipy", + "absl-py", + "opt_einsum", + "pymlir", + "click", + "ipykernel", + "nbconvert", + "pytest-timeout", +] +ml-testing = [ + "coverage", + "pytest-cov", + "scipy", + "absl-py", + "opt_einsum", + "pymlir", + "click", + "ipykernel", + "nbconvert", + "pytest-timeout", + "transformers==4.50", + "jax<=0.6.2", + "efficientnet_pytorch", +] +docs = ["jinja2<3.2.0", "sphinx-autodoc-typehints", "sphinx-rtd-theme>=0.5.1"] +linting = ["pre-commit==4.1.0", "yapf==0.43.0"] + +[project.scripts] +dacelab = "dace.cli.dacelab:main" +sdfv = "dace.cli.sdfv:main" +sdfgcc = "dace.cli.sdfgcc:main" +sdfg-diff = "dace.cli.sdfg_diff:main" +fcfd = "dace.cli.fcdc:main" +daceprof = "dace.cli.daceprof:main" +dace-external-transformation-registry = "dace.cli.external_transformation_registry:main" + +[project.urls] +Homepage = "https://github.com/spcl/dace" + +[tool.setuptools.dynamic] +version = {attr = "dace.version.__version__"} + +[tool.setuptools.packages.find] +exclude = ["*.tests", "*.tests.*", "tests.*", "tests"] + +[tool.setuptools.package-data] +dace = [ + "*.yml", + "codegen/CMakeLists.txt", + "codegen/tools/*.cpp", + "codegen/**/*.cmake", + "external/moodycamel/*.h", + "external/moodycamel/LICENSE.md", + "external/cub/cub/**/*", + "external/cub/LICENSE.TXT", + "runtime/include/**/*", + "libraries/**/include/**/*", + "viewer/webclient/dist/*.js", + "viewer/webclient/external_libs/**/*", + "viewer/webclient/*.css", + "viewer/webclient/*.html", + "viewer/templates/**/*", + "viewer/**/LICENSE", +] diff --git a/setup.py b/setup.py deleted file mode 100644 index 63678f89aa..0000000000 --- a/setup.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. -import glob -import os -import shutil -import subprocess - -from setuptools import find_packages, setup - -# Find runtime and external library files by obtaining the module path and -# trimming the absolute path of the resulting files. -dace_path = os.path.dirname(os.path.abspath(__file__)) + '/dace/' -runtime_files = [f[len(dace_path):] for f in glob.glob(dace_path + 'runtime/include/**/*', recursive=True)] -library_files = [f[len(dace_path):] for f in glob.glob(dace_path + 'libraries/**/include/**/*', recursive=True)] -cmake_files = [f[len(dace_path):] for f in glob.glob(dace_path + 'codegen/**/*.cmake', recursive=True)] -viewer_files = [ - f[len(dace_path):] for f in (glob.glob(dace_path + 'viewer/webclient/dist/*.js', recursive=True) + - glob.glob(dace_path + 'viewer/webclient/external_libs/**/*', recursive=True) + - glob.glob(dace_path + 'viewer/webclient/*.css', recursive=True) + - glob.glob(dace_path + 'viewer/webclient/*.html', recursive=True) + - glob.glob(dace_path + 'viewer/templates/**/*', recursive=True) + - glob.glob(dace_path + 'viewer/**/LICENSE', recursive=True)) -] -cub_files = [f[len(dace_path):] for f in glob.glob(dace_path + 'external/cub/cub/**/*', recursive=True) - ] + [dace_path + 'external/cub/LICENSE.TXT'] - -# See if CMake is available and if not, install as a dependency -cmake_requires = ['scikit-build', 'cmake'] -try: - cmake_path = shutil.which('cmake') - if cmake_path: - # CMake is available, check version - output = subprocess.check_output([cmake_path, '--version']).decode('utf-8') - cmake_version = tuple(int(t) for t in output.splitlines()[0].split(' ')[-1].split('.')) - # If version meets minimum requirements, CMake is not necessary - if cmake_version >= (3, 17): - cmake_requires = [] -except (subprocess.CalledProcessError, OSError, IndexError, ValueError): - # Any failure in getting the CMake version counts as "not found" - pass - -with open("README.md", "r") as fp: - long_description = fp.read() - -with open(os.path.join(dace_path, "version.py"), "r") as fp: - version = fp.read().strip().split(' ')[-1][1:-1] - -setup(name='dace', - version=version, - url='https://github.com/spcl/dace', - author='SPCL @ ETH Zurich', - author_email='talbn@inf.ethz.ch', - description='Data-Centric Parallel Programming Framework', - long_description=long_description, - long_description_content_type='text/markdown', - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: BSD License", - "Operating System :: OS Independent", - ], - python_requires='>=3.10, <3.15', - packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), - package_data={ - '': [ - '*.yml', 'codegen/CMakeLists.txt', 'codegen/tools/*.cpp', 'external/moodycamel/*.h', - 'external/moodycamel/LICENSE.md' - ] + runtime_files + cub_files + viewer_files + library_files + cmake_files - }, - include_package_data=True, - install_requires=[ - 'numpy', 'networkx >= 2.5, <= 3.5', 'astunparse', 'sympy >= 1.9', 'pyyaml', 'ply', 'fparser >= 0.1.3', 'dill', - 'pyreadline;platform_system=="Windows"', 'packaging', 'typing-extensions' - ] + cmake_requires, - extras_require={ - 'ml': ['onnx', 'torch', 'onnxsim', 'onnxscript', 'onnxruntime', 'protobuf', 'ninja'], - 'testing': [ - 'coverage', - 'pytest-cov', - 'scipy', - 'absl-py', - 'opt_einsum', - 'pymlir', - 'click', - 'ipykernel', - 'nbconvert', - 'pytest-timeout', - ], - 'ml-testing': [ - 'coverage', 'pytest-cov', 'scipy', 'absl-py', 'opt_einsum', 'pymlir', 'click', 'ipykernel', 'nbconvert', - 'pytest-timeout', 'transformers == 4.50', 'jax <= 0.6.2', 'efficientnet_pytorch' - ], - 'docs': ['jinja2<3.2.0', 'sphinx-autodoc-typehints', 'sphinx-rtd-theme>=0.5.1'], - 'linting': ['pre-commit==4.1.0', 'yapf==0.43.0'], - }, - entry_points={ - 'console_scripts': [ - 'dacelab = dace.cli.dacelab:main', - 'sdfv = dace.cli.sdfv:main', - 'sdfgcc = dace.cli.sdfgcc:main', - 'sdfg-diff = dace.cli.sdfg_diff:main', - 'fcfd = dace.cli.fcdc:main', - 'daceprof = dace.cli.daceprof:main', - 'dace-external-transformation-registry = dace.cli.external_transformation_registry:main', - ], - })