Make license declarations explicit - #68
Merged
Merged
Conversation
Previously the build defaulted to Apache-2.0 when no `__license__` was declared. Treat license selection as a positive signal instead: omit the License-Expression metadata (and the injected LICENSE file) entirely when no license is indicated. Declare Apache-2.0 for coherent.build itself. Ref #67 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The first `>>> declared_license()` example ran in the repo's own directory, which now declares __license__, so it returned 'Apache-2.0' instead of None. chdir into a clean tmp_path before exercising the no-license case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
|
I really don't love how making licenses optional adds so much branchy logic. In three different places, it made one liners turn into two-liners. The code was so much more elegant when a license could be assumed. I'm slightly tempted to go back to a model where a license is required and simply fail to build if no license is indicated. |
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.
Closes #67 (build-system portion).
Previously the build applied an
Apache-2.0license by default when no license was declared. Per #67, license selection should be a positive signal with no default — a package without a declared license simply has no license indicated in the metadata.Changes
metadata.py: omitLicense-Expressionfrom METADATA andlicensefrom the generatedpyproject.tomlwhen no__license__is declared.flit.py: only inject theLICENSEfile into the sdist when a license is declared.__init__.py: declare__license__ = 'Apache-2.0'for coherent.build itself (per Make license declarations explicit #67's directive to make coherent.* projects explicit).The remaining parts of #67 — licensing guidance in the coherent-oss/system README and Apache-2.0 declarations in the other coherent.* projects — are handled separately.
🤖 Generated with Claude Code