chore: switch to SPDX license headers#4533
Merged
lzchen merged 16 commits intoopen-telemetry:mainfrom May 7, 2026
Merged
Conversation
Replace the Apache 2.0 license header with the 2-line SPDX equivalent across all Python files. Add a CI check to enforce the header on new files going forward. Closes open-telemetry#4521 Assisted-by: Claude Opus 4.6
Assisted-by: Claude Opus 4.6
Assisted-by: Claude Opus 4.6
The generate script template already adds a newline after the header, so the template file must not end with one. Assisted-by: Claude Opus 4.6
tammy-baylis-swi
approved these changes
May 5, 2026
Contributor
tammy-baylis-swi
left a comment
There was a problem hiding this comment.
Thanks!
This duplicates #4532 but also includes a workflow update. Not sure how you'd like to proceed, @MikeGoldsmith !
10 tasks
tammy-baylis-swi
approved these changes
May 5, 2026
Assisted-by: Claude Opus 4.6
lzchen
approved these changes
May 6, 2026
GitHub uses this file to hide bulk formatting commits from blame views. The SHA may need updating if this PR is squash-merged. Assisted-by: Claude Opus 4.6
…mike/spdx-license-headers
…mike/spdx-license-headers
lmolkova
approved these changes
May 7, 2026
Files added to main after the initial migration. Assisted-by: Claude Opus 4.6
…mike/spdx-license-headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
# SPDX-License-Identifier: Apache-2.0) across all Python filesscripts/check_license_header.pyenforcement script andlint-license-header-checktox env to catch missing headers in CIscripts/license_header.txttemplate to use SPDX format.git-blame-ignore-revsfile to hide this bulk change from GitHub blame views590 files had their existing Apache header replaced with the SPDX equivalent. During the migration, 85 files were found with missing headers and 15 files had non-standard header variants:
Copyright 2020, OpenTelemetry Authors) — normalized toCopyright The OpenTelemetry AuthorsAll now have the correct SPDX header. Third-party copyrights (Google LLC, Amazon) are preserved with SPDX on line 2.
Motivation
Other OTel SDKs and the Python core SDK have already adopted SPDX headers:
Closes #4521
Notes
__init__.pyfiles are excluded from the check# Copyrightline (to support third-party copyrights like Google LLC, Amazon) followed by# SPDX-License-Identifier: Apache-2.0Follow-up
.git-blame-ignore-revsis included with a placeholder — a follow-up PR will update it with the squash-merge commit SHA once this PR is merged.