Skip to content

Make license declarations explicit - #68

Merged
jaraco merged 2 commits into
mainfrom
feature/explicit-license-declarations
Jul 17, 2026
Merged

Make license declarations explicit#68
jaraco merged 2 commits into
mainfrom
feature/explicit-license-declarations

Conversation

@jaraco

@jaraco jaraco commented Jul 17, 2026

Copy link
Copy Markdown
Member

Closes #67 (build-system portion).

Previously the build applied an Apache-2.0 license 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: omit License-Expression from METADATA and license from the generated pyproject.toml when no __license__ is declared.
  • flit.py: only inject the LICENSE file 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

jaraco and others added 2 commits July 17, 2026 11:56
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>
@jaraco

jaraco commented Jul 17, 2026

Copy link
Copy Markdown
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.

@jaraco
jaraco merged commit 9bae082 into main Jul 17, 2026
28 checks passed
@jaraco
jaraco deleted the feature/explicit-license-declarations branch July 17, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make license declarations explicit

1 participant