• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IntelPython / numba-dpex / 9216941854

24 May 2024 12:55AM UTC coverage: 86.575% (+0.08%) from 86.5%
9216941854

push

github

web-flow
Merge pull request #1464 from IntelPython/fix/dpnp_mp

Remove versioneer, organize dpnp monkey patch

664 of 748 branches covered (88.77%)

Branch coverage included in aggregate %.

43 of 52 new or added lines in 4 files covered. (82.69%)

1 existing line in 1 file now uncovered.

5456 of 6321 relevant lines covered (86.32%)

0.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/setup.py
1
# SPDX-FileCopyrightText: 2020 - 2023 Intel Corporation
2
#
3
# SPDX-License-Identifier: Apache-2.0
4

5

NEW
6
import os
×
UNCOV
7
import re
×
8

9
import versioneer
×
10
from setuptools import find_namespace_packages, find_packages
×
11
from skbuild import setup
×
12

13
"""Top level setup.py file. Uses scikit-build.
×
14

15
    This will build the numba_dpex project. There are two ways to run this file.
16
    First command line argument is `install` and the other is `develop`. The
17
    argument `install` will build the _dpexrt_runtime target and install all the
18
    python modules into _skbuild build directory, where `develop` will just
19
    build the _dpexrt_runtime target and will not copy any python module into
20
    _skbuild.
21

22
    `install` command:
23
        ~$ python setup.py install
24

25
    `develop` command:
26
        ~$ python setup.py develop
27

28
    To uninstall:
29
        ~$ pip uninstall numba-dpex
30

31
    NOTE: This script doesn't support pypa/build, pypa/installer or other
32
    standards-based tools like pip, yet.
33

34
    TODO: Support `pip install`
35
"""
36

37

38
def to_cmake_format(version: str):
×
39
    """Convert pep440 version string into a cmake compatible string."""
40
    # cmake version just support up to 4 numbers separated by dot.
41
    # https://peps.python.org/pep-0440/
42
    # https://cmake.org/cmake/help/latest/command/project.html
43

44
    match = re.search(r"^\d+(?:\.\d+(?:\.\d+(?:\.\d+)?)?)?", version)
×
45
    if not match:
×
46
        raise Exception("Unsupported version")
×
47

48
    return match.group(0)
×
49

50

51
# Get the project version
52
__version__ = versioneer.get_version()
×
53

54
# Keep same style as versioneer in case ve would want to switch back
NEW
55
with open(os.path.join("numba_dpex", "_version.py"), "w") as fh:
×
NEW
56
    print(
×
57
        "# SPDX-FileCopyrightText: 2024 Intel Corporation\n#\n"
58
        "# SPDX-License-Identifier: Apache-2.0\n\n\ndef get_versions():\n"
59
        '    return {"version": "' + __version__ + '"}',
60
        file=fh,
61
    )
62

63

64
# Main setup
65
setup(
×
66
    version=__version__,
67
    # https://github.com/pypa/pip/issues/11221
68
    url="https://github.com/IntelPython/numba-dpex",
69
    # Must be passed vis setup.py:
70
    # https://github.com/scikit-build/scikit-build/issues/864
71
    # TODO: switch to pyproject toml after switching to scikit-build-core
72
    packages=find_packages(".")
73
    + find_namespace_packages(".", include=["numba_dpex.examples.*"]),
74
    # Needs for examples.
75
    # TODO: change to false once move examples out of package.
76
    include_package_data=True,
77
    cmake_args=[
78
        "-DNUMBA_DPEX_VERSION:STRING={0:s}".format(
79
            to_cmake_format(str(__version__))
80
        ),
81
    ],
82
)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc