diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index c4f51f7c8b52..000000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -global-exclude *.cpp -include dpnp/backend/include/*.hpp diff --git a/setup.py b/setup.py index 7ee870b0a32e..bb0f943f1d49 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,8 @@ import importlib.machinery as imm import os +import shutil -from skbuild import setup +import skbuild import versioneer @@ -34,10 +35,10 @@ def _get_cmdclass(): Programming Language :: Cython Programming Language :: Python Programming Language :: Python :: 3 -Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 +Programming Language :: Python :: 3.12 Programming Language :: Python :: Implementation :: CPython Topic :: Software Development Topic :: Scientific/Engineering @@ -46,7 +47,35 @@ def _get_cmdclass(): Operating System :: Unix """ -setup( +def _patched_copy_file( + src_file, dest_file, hide_listing=True, preserve_mode=True +): + """Copy ``src_file`` to ``dest_file`` ensuring parent directory exists. + + By default, message like `creating directory /path/to/package` and + `copying directory /src/path/to/package -> path/to/package` are displayed + on standard output. Setting ``hide_listing`` to False avoids message from + being displayed. + + NB: Patched here to not follows symbolic links + """ + # Create directory if needed + dest_dir = os.path.dirname(dest_file) + if dest_dir != "" and not os.path.exists(dest_dir): + if not hide_listing: + print("creating directory {}".format(dest_dir)) + skbuild.utils.mkdir_p(dest_dir) + + # Copy file + if not hide_listing: + print("copying {} -> {}".format(src_file, dest_file)) + shutil.copyfile(src_file, dest_file, follow_symlinks=False) + shutil.copymode(src_file, dest_file, follow_symlinks=False) + + +skbuild.setuptools_wrap._copy_file = _patched_copy_file + +skbuild.setup( name="dpnp", version=__version__, cmdclass=_get_cmdclass(), @@ -57,6 +86,7 @@ def _get_cmdclass(): classifiers=[_f for _f in CLASSIFIERS.split("\n") if _f], keywords="sycl numpy python3 intel mkl oneapi gpu dpcpp", platforms=["Linux", "Windows"], + python_requires=">=3.9", author="Intel Corporation", url="https://github.com/IntelPython/dpnp", packages=[ @@ -67,12 +97,20 @@ def _get_cmdclass(): "dpnp.linalg", "dpnp.random", ], + package_dir={"dpnp": "", + "dpnp.tests": ""}, package_data={ "dpnp": [ + "dpnp/backend/include/*.hpp", "libdpnp_backend_c.so", "dpnp_backend_c.lib", "dpnp_backend_c.dll", + ], + "dpnp.tests": [ + ".*" + "third_party/cupy/*.py", + "third_party/cupy/*/*.py", ] }, - include_package_data=True, + include_package_data=False, )