Skip to content

cuda_core: fix SPDX identifiers and enforce Apache-2.0 headers#1897

Draft
rwgk wants to merge 2 commits intoNVIDIA:mainfrom
rwgk:cuda_core_license_fixes
Draft

cuda_core: fix SPDX identifiers and enforce Apache-2.0 headers#1897
rwgk wants to merge 2 commits intoNVIDIA:mainfrom
rwgk:cuda_core_license_fixes

Conversation

@rwgk
Copy link
Copy Markdown
Collaborator

@rwgk rwgk commented Apr 13, 2026

Summary

  • Correct the affected cuda_core/ SPDX-License-Identifier headers so they consistently use Apache-2.0.
  • Refactor toolshed/check_spdx.py so expected license identifiers can be enforced by path prefix, and require Apache-2.0 for files under cuda_core/.
  • Keep focused regression coverage in toolshed/test_check_spdx.py for the new cuda_core/ rule, path normalization, and the existing staged-file copyright autofix flow.

Validation

  • pre-commit run --all-files
  • pixi run --manifest-path "cuda_pathfinder" pytest toolshed/test_check_spdx.py -q
  • Output after locally and temporarily reverting commit 7738635:
$ pre-commit run --all-files
ruff check...............................................................Passed
ruff format..............................................................Passed
Check SPDX Headers.......................................................Failed
- hook id: check-spdx
- exit code: 1

INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graphdef.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_utils/driver_cu_result_explanations.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graphdef_lifetime.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_utils/clear_error_support.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/helpers/collection_interface_testers.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_utils/enum_explanations_helpers.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graphdef_integration.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graph_memory_resource.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_include/utility.hpp'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graph_builder_conditional.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/test_utils_enum_explanations_helpers.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/test_utils.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/test_optional_dependency_imports.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_device_launch.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_utils/runtime_cuda_error_explanations.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graphdef_errors.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/test_linker.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_utils/driver_cu_result_explanations_frozen.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/helpers/graph_kernels.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_utils/__init__.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/helpers/marks.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graphdef_mutation.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graph_builder.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_graph_update.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/test_cuda_utils.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/pytest.ini'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_utils/runtime_cuda_error_explanations_frozen.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/graph/test_options.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/cython/test_get_cuda_native_handle.pyx'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/cython/test_cython.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/test_program.py'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/cuda/core/_include/layout.hpp'
INVALID SPDX license identifier 'LicenseRef-NVIDIA-SOFTWARE-LICENSE' (expected 'Apache-2.0') in 'cuda_core/tests/test_helpers.py'

Prevent markdown files in docs/source directories....(no files to check)Skipped
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check docstring is first.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks................................................Passed
check toml...............................................................Passed
check yaml...............................................................Passed
debug statements (python)................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
rst ``code`` is two backticks............................................Passed
rst directives end with two colons.......................................Passed
rst ``inline code`` next to normal text..................................Passed
mypy-pathfinder..........................................................Passed
Lint GitHub Actions workflow files.......................................Passed
cython-lint..............................................................Passed

rwgk added 2 commits April 12, 2026 20:12
Refactor the SPDX checker so package-specific license rules can be enforced cleanly while preserving the existing autofix flow. Keep focused regression coverage alongside the toolshed script instead of in routine package test collection.

Made-with: Cursor
@rwgk rwgk added this to the cuda.core v1.0.0 milestone Apr 13, 2026
@rwgk rwgk self-assigned this Apr 13, 2026
@rwgk rwgk added bug Something isn't working P1 Medium priority - Should do cuda.core Everything related to the cuda.core module labels Apr 13, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot bot commented Apr 13, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rwgk
Copy link
Copy Markdown
Collaborator Author

rwgk commented Apr 13, 2026

/ok to test

@github-actions
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.core Everything related to the cuda.core module P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant