Skip to content

Commit d1072a2

Browse files
authored
Initial version of pre-commit "Check SPDX-License-Identifier" (#625)
* Initial version of pre-commit "Check SPDX-License-Identifier" * Use pathspec.PathSpec.from_lines("gitwildmatch", ...) to ignore all .md files. * Pull out most special files (e.g. LICENSE, vendored file) * Change has_spdx() → has_spdx_or_is_empty() * Add missing SPDX-License-Identifier lines in *.py files. * Add missing SPDX-License-Identifier lines in all files outside cuda_bindings/. * Add missing Copyright (and SPDX-License-Identifier) lines under cuda_bindings/ * Remove stray space * Add missing SPDX-License-Identifier lines in all files under cuda_bindings/. * Remove all EULA paragraphs (cuda_bindings/, cuda_core/) * Fix accident (lost #include <stdio.h>) * codegen changes overlooked in a recent prior update * Update after fixing codegen for driver * Pin pathspec==0.12.1 * Use direct PyPI URL for pathspec
1 parent 99ffe14 commit d1072a2

File tree

100 files changed

+276
-403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+276
-403
lines changed

.github/copy-pr-bot.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
# Configuration file for `copy-pr-bot` GitHub App
25
# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/
36

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ repos:
1919
- id: ruff
2020
args: [--fix, --show-fixes]
2121
- id: ruff-format
22+
23+
- repo: local
24+
hooks:
25+
- id: check-spdx
26+
name: Check SPDX-License-Identifier
27+
entry: python ./toolshed/check_spdx.py
28+
language: python
29+
additional_dependencies:
30+
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
31+
2232
- repo: https://github.com/PyCQA/bandit
2333
rev: 8ff25e07e487f143571cc305e56dd0253c60bc7b #v1.8.3
2434
hooks:

.spdx-ignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
LICENSE
2+
*.html
3+
*.json
4+
*.md
5+
*.png
6+
.gitattributes
7+
.gitignore
8+
.github/BACKPORT_BRANCH
9+
requirements*.txt
10+
cuda_bindings/examples/*
11+
12+
# Vendored
13+
cuda_core/cuda/core/experimental/dlpack.h

cuda_bindings/MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
14
recursive-include cuda/ *.pyx *.pxd *.pxi
25
# at least with setuptools 75.0.0 this folder was added erroneously
36
# to the payload, causing file copying to the build environment failed

cuda_bindings/benchmarks/conftest.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
import numpy as np
95
import pytest
106

cuda_bindings/benchmarks/kernels.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
kernel_string = """\
95
#define ITEM_PARAM(x, T) T x
106
#define REP1(x, T) , ITEM_PARAM(x, T)

cuda_bindings/benchmarks/pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) 2021-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
14
[pytest]
25
required_plugins = pytest-benchmark
36
addopts = --benchmark-skip

cuda_bindings/benchmarks/test_cupy.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
import ctypes
95

106
import pytest

cuda_bindings/benchmarks/test_launch_latency.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
import ctypes
95

106
import pytest

cuda_bindings/benchmarks/test_numba.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
import numpy as np
95
import pytest
106

cuda_bindings/benchmarks/test_pointer_attributes.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
import random
95

106
import pytest
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
# Copyright 2024 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
83

94
from cuda.bindings._version import __version__

cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
from cuda.bindings.cydriver cimport *
116

cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
{{if 'Windows' == platform.system()}}
116
import os
12-
import site
13-
import struct
147
import win32api
158
from pywintypes import error
169
{{else}}
1710
cimport cuda.bindings._lib.dlfcn as dlfcn
1811
{{endif}}
19-
2012
from libc.stdint cimport intptr_t
2113
import os
2214
import sys

cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
from cuda.bindings.cynvrtc cimport *
116

cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
{{if 'Windows' == platform.system()}}
116
import os
@@ -15,7 +10,6 @@ cimport cuda.bindings._lib.dlfcn as dlfcn
1510
from libc.stdint cimport uintptr_t
1611
{{endif}}
1712
from cuda.bindings import path_finder
18-
1913
from libc.stdint cimport intptr_t
2014

2115
cdef bint __cuPythonInit = False

cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
include "../cyruntime_types.pxi"
116

cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
include "../cyruntime_functions.pxi"
116

cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
cdef extern from "":
116
"""

cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
8-
#
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
# This code was automatically generated with version 12.9.0. Do not modify it directly.
105
cdef extern from "":
116
"""

cuda_bindings/cuda/bindings/_bindings/loader.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
2-
//
3-
// Please refer to the NVIDIA end user license agreement (EULA) associated
4-
// with this source code for terms and conditions that govern your use of
5-
// this software. Any use, reproduction, disclosure, or distribution of
6-
// this software and related documentation outside the terms of the EULA
7-
// is strictly prohibited.
2+
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
#include <stdio.h>
95
#include <stdlib.h>
106
#include <cstring>

cuda_bindings/cuda/bindings/_bindings/loader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
2+
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
23
//
34
// Please refer to the NVIDIA end user license agreement (EULA) associated
45
// with this source code for terms and conditions that govern your use of
Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
21
# Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
3-
#
4-
# Please refer to the NVIDIA end user license agreement (EULA) associated
5-
# with this source code for terms and conditions that govern your use of
6-
# this software. Any use, reproduction, disclosure, or distribution of
7-
# this software and related documentation outside the terms of the EULA
8-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
94
cdef extern from "loader.h":
105
int getCUDALibraryPath(char *libPath, bint isBit64)

cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
from cuda.bindings.cyruntime cimport *
95

106
# These graphics API are the reimplemented version of what's supported by CUDA Runtime.

cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
from cuda.bindings.cyruntime cimport *
95
from cuda.bindings._lib.cyruntime.utils cimport *
106
from libc.string cimport memset

cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
from cuda.bindings.cyruntime cimport *
95
cimport cuda.bindings._bindings.cydriver as cydriver
106

cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
import cython
95
from cuda.bindings.cyruntime cimport *
106
from libc.string cimport memset
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
2-
#
3-
# Please refer to the NVIDIA end user license agreement (EULA) associated
4-
# with this source code for terms and conditions that govern your use of
5-
# this software. Any use, reproduction, disclosure, or distribution of
6-
# this software and related documentation outside the terms of the EULA
7-
# is strictly prohibited.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
cdef extern from "<dlfcn.h>" nogil:
95
void *dlopen(const char *, int)
106
char *dlerror()
@@ -15,4 +11,4 @@ cdef extern from "<dlfcn.h>" nogil:
1511
RTLD_LAZY
1612
RTLD_NOW
1713
RTLD_GLOBAL
18-
RTLD_LOCAL
14+
RTLD_LOCAL

cuda_bindings/cuda/bindings/_lib/param_packer.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
2-
//
3-
// Please refer to the NVIDIA end user license agreement (EULA) associated
4-
// with this source code for terms and conditions that govern your use of
5-
// this software. Any use, reproduction, disclosure, or distribution of
6-
// this software and related documentation outside the terms of the EULA
7-
// is strictly prohibited.
2+
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
84
#include <Python.h>
95
#include "param_packer.h"
106

cuda_bindings/cuda/bindings/_lib/param_packer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
2+
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
23
//
34
// Please refer to the NVIDIA end user license agreement (EULA) associated
45
// with this source code for terms and conditions that govern your use of

0 commit comments

Comments
 (0)