Skip to content

Initial version of pre-commit "Check SPDX-License-Identifier" #625

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

Merged
merged 16 commits into from
May 14, 2025
Merged
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
3 changes: 3 additions & 0 deletions .github/copy-pr-bot.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
# SPDX-License-Identifier: Apache-2.0

# Configuration file for `copy-pr-bot` GitHub App
# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/

Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ repos:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format

- repo: local
hooks:
- id: check-spdx
name: Check SPDX-License-Identifier
entry: python ./toolshed/check_spdx.py
language: python
additional_dependencies:
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl

- repo: https://github.com/PyCQA/bandit
rev: 8ff25e07e487f143571cc305e56dd0253c60bc7b #v1.8.3
hooks:
Expand Down
13 changes: 13 additions & 0 deletions .spdx-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
LICENSE
*.html
*.json
*.md
*.png
.gitattributes
.gitignore
.github/BACKPORT_BRANCH
requirements*.txt
cuda_bindings/examples/*

# Vendored
cuda_core/cuda/core/experimental/dlpack.h
3 changes: 3 additions & 0 deletions cuda_bindings/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

recursive-include cuda/ *.pyx *.pxd *.pxi
# at least with setuptools 75.0.0 this folder was added erroneously
# to the payload, causing file copying to the build environment failed
Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/benchmarks/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

import numpy as np
import pytest

Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/benchmarks/kernels.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

kernel_string = """\
#define ITEM_PARAM(x, T) T x
#define REP1(x, T) , ITEM_PARAM(x, T)
Expand Down
3 changes: 3 additions & 0 deletions cuda_bindings/benchmarks/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) 2021-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

[pytest]
required_plugins = pytest-benchmark
addopts = --benchmark-skip
8 changes: 2 additions & 6 deletions cuda_bindings/benchmarks/test_cupy.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

import ctypes

import pytest
Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/benchmarks/test_launch_latency.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

import ctypes

import pytest
Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/benchmarks/test_numba.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

import numpy as np
import pytest

Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/benchmarks/test_pointer_attributes.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

import random

import pytest
Expand Down
7 changes: 1 addition & 6 deletions cuda_bindings/cuda/bindings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# Copyright 2024 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

from cuda.bindings._version import __version__
9 changes: 2 additions & 7 deletions cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
from cuda.bindings.cydriver cimport *

Expand Down
12 changes: 2 additions & 10 deletions cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
{{if 'Windows' == platform.system()}}
import os
import site
import struct
import win32api
from pywintypes import error
{{else}}
cimport cuda.bindings._lib.dlfcn as dlfcn
{{endif}}

from libc.stdint cimport intptr_t
import os
import sys
Expand Down
9 changes: 2 additions & 7 deletions cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
from cuda.bindings.cynvrtc cimport *

Expand Down
10 changes: 2 additions & 8 deletions cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
{{if 'Windows' == platform.system()}}
import os
Expand All @@ -15,7 +10,6 @@ cimport cuda.bindings._lib.dlfcn as dlfcn
from libc.stdint cimport uintptr_t
{{endif}}
from cuda.bindings import path_finder

from libc.stdint cimport intptr_t

cdef bint __cuPythonInit = False
Expand Down
9 changes: 2 additions & 7 deletions cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
include "../cyruntime_types.pxi"

Expand Down
9 changes: 2 additions & 7 deletions cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
include "../cyruntime_functions.pxi"

Expand Down
9 changes: 2 additions & 7 deletions cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pxd.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
cdef extern from "":
"""
Expand Down
9 changes: 2 additions & 7 deletions cuda_bindings/cuda/bindings/_bindings/cyruntime_ptds.pyx.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 12.9.0. Do not modify it directly.
cdef extern from "":
"""
Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/cuda/bindings/_bindings/loader.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
//
// Please refer to the NVIDIA end user license agreement (EULA) associated
// with this source code for terms and conditions that govern your use of
// this software. Any use, reproduction, disclosure, or distribution of
// this software and related documentation outside the terms of the EULA
// is strictly prohibited.
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

#include <stdio.h>
#include <stdlib.h>
#include <cstring>
Expand Down
1 change: 1 addition & 0 deletions cuda_bindings/cuda/bindings/_bindings/loader.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
//
// Please refer to the NVIDIA end user license agreement (EULA) associated
// with this source code for terms and conditions that govern your use of
Expand Down
9 changes: 2 additions & 7 deletions cuda_bindings/cuda/bindings/_bindings/loader.pxd
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@

# Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

cdef extern from "loader.h":
int getCUDALibraryPath(char *libPath, bint isBit64)
8 changes: 2 additions & 6 deletions cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

from cuda.bindings.cyruntime cimport *

# These graphics API are the reimplemented version of what's supported by CUDA Runtime.
Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

from cuda.bindings.cyruntime cimport *
from cuda.bindings._lib.cyruntime.utils cimport *
from libc.string cimport memset
Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

from cuda.bindings.cyruntime cimport *
cimport cuda.bindings._bindings.cydriver as cydriver

Expand Down
8 changes: 2 additions & 6 deletions cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2025 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

import cython
from cuda.bindings.cyruntime cimport *
from libc.string cimport memset
Expand Down
10 changes: 3 additions & 7 deletions cuda_bindings/cuda/bindings/_lib/dlfcn.pxd
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
#
# Please refer to the NVIDIA end user license agreement (EULA) associated
# with this source code for terms and conditions that govern your use of
# this software. Any use, reproduction, disclosure, or distribution of
# this software and related documentation outside the terms of the EULA
# is strictly prohibited.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

cdef extern from "<dlfcn.h>" nogil:
void *dlopen(const char *, int)
char *dlerror()
Expand All @@ -15,4 +11,4 @@ cdef extern from "<dlfcn.h>" nogil:
RTLD_LAZY
RTLD_NOW
RTLD_GLOBAL
RTLD_LOCAL
RTLD_LOCAL
8 changes: 2 additions & 6 deletions cuda_bindings/cuda/bindings/_lib/param_packer.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
//
// Please refer to the NVIDIA end user license agreement (EULA) associated
// with this source code for terms and conditions that govern your use of
// this software. Any use, reproduction, disclosure, or distribution of
// this software and related documentation outside the terms of the EULA
// is strictly prohibited.
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

#include <Python.h>
#include "param_packer.h"

Expand Down
1 change: 1 addition & 0 deletions cuda_bindings/cuda/bindings/_lib/param_packer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2021-2024 NVIDIA Corporation. All rights reserved.
// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
//
// Please refer to the NVIDIA end user license agreement (EULA) associated
// with this source code for terms and conditions that govern your use of
Expand Down
Loading