Skip to content

Update setup py #1856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

46 changes: 42 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import importlib.machinery as imm
import os
import shutil

from skbuild import setup
import skbuild

import versioneer

Expand Down Expand Up @@ -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
Expand All @@ -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(),
Expand All @@ -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=[
Expand All @@ -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,
)
Loading