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)
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

0 commit comments

Comments
 (0)