Skip to content

Add missing license files for re-used code#2590

Merged
Avasam merged 15 commits intomhammond:mainfrom
Avasam:Add-missing-licenses
Dec 15, 2025
Merged

Add missing license files for re-used code#2590
Avasam merged 15 commits intomhammond:mainfrom
Avasam:Add-missing-licenses

Conversation

@Avasam
Copy link
Copy Markdown
Collaborator

@Avasam Avasam commented Apr 29, 2025

Closes #1127

Considerations for a SPDX license expression for the distribution (PEP 639 – Improving License Clarity with Better Package Metadata) or SBOM (PEP 770 – Improving measurability of Python packages with Software Bill-of-Materials) are left as a different topic of discussion.

Comment thread Pythonwin/pywin/idle/CREDITS.txt Outdated
@@ -0,0 +1,246 @@
A. HISTORY OF THE SOFTWARE
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread SWIG/swig_lib/Copyright
@@ -0,0 +1,41 @@

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread com/win32comext/mapi/NOTICE.md Outdated
@Avasam Avasam marked this pull request as ready for review April 29, 2025 23:37
@Avasam Avasam requested a review from mhammond April 29, 2025 23:37
@Avasam Avasam changed the title Add missing licenses Add missing license files Oct 7, 2025
Comment thread setup.py
("pythonwin", (str(scintilla_licence_path),)),
("win32comext/mapi", (str(mapi_stubs_licence_path),)),
("win32com", ("com/License.txt",)),
("win32comext", ("com/License.txt",)),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't quite get the first arg here and why it's not specified below (or why win32com already did that :) But why is this even needed given the files added up above?

Copy link
Copy Markdown
Collaborator Author

@Avasam Avasam Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First element of the tuple args is the destination package (and its submodules if the path contains a /), second element is an iterable of sources

It's needed because win32com and win32comext end up as their own top-level packages, but License.txt is not found in either sources (would be com/win32com/License.txt and com/win32comext/License.txt) simply because it would be redundant (given that then entire com folder currently shares the same license information).

Hopefully this image helps visualize what I'm saying:
image

win32/License.txt doesn't need this treatment because their source and packaged locations match.


Sidenote: Using the same technique, win32/License.txt and com/License.txt could be deduplicated in source and moved to the root of the repository. But that may make things more confusing with the PSF SPDX identifier in the project root metadata and mentioned in the readme. My goal isn't to update any of that in this PR, just to add missing license information that should already apply to specific places.

Comment thread com/win32comext/mapi/NOTICE.md Outdated

This distributed package contains components under multiple licenses:

- `mapi.pyd` is licensed under the MIT License. See [com/win32comext/mapi/src/MAPIStubLibrary/LICENSE](https://github.com/mhammond/pywin32/blob/main/com/win32comext/mapi/src/MAPIStubLibrary/LICENSE) for details.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why that license compels mapi.pyd?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It takes some digging to find it but this matches my own analysis: Per the readme, mapi.pyd is built from headers downloaded from this Microsoft repo which is MIT-licensed.

Copy link
Copy Markdown
Collaborator Author

@Avasam Avasam Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more than just headers, I believe there's actual vendored code that gets compiled (I could be wrong), mapiStubLibrary.cpp and stubutils.cpp are declared as sources in setup.py. (I don't see it being used anywhere. Do we simply just re-expose the library code ?)

pywin32/setup.py

Lines 1429 to 1446 in e319b77

{mapi}/MAPIStubLibrary/library/mapiStubLibrary.cpp
{mapi}/MAPIStubLibrary/library/stubutils.cpp
""".format(**dirs)
).split(),
),
WinExt_win32com_mapi(
"exchange",
libraries="advapi32 legacy_stdio_definitions",
include_dirs=["{mapi}/MapiStubLibrary/include".format(**dirs)],
sources=(
"""
{mapi}/exchange.i {mapi}/exchange.cpp
{mapi}/PyIExchangeManageStore.i {mapi}/PyIExchangeManageStore.cpp
{mapi}/PyIExchangeManageStoreEx.i {mapi}/PyIExchangeManageStoreEx.cpp
{mapi}/mapiutil.cpp
{mapi}/exchangeguids.cpp
{mapi}/MAPIStubLibrary/library/mapiStubLibrary.cpp
{mapi}/MAPIStubLibrary/library/stubutils.cpp

If accurate, mapi.pyd and exchange.pyd are shipped containing MIT-licensed code.
If it was just the headers, then this wouldn't apply.

It would be more accurate to say that it contains MIT-licensed code. I've updated this.

Comment thread Pythonwin/pywin/idle/CREDITS.txt Outdated
@Avasam Avasam requested a review from mhammond October 11, 2025 02:59
@Avasam
Copy link
Copy Markdown
Collaborator Author

Avasam commented Dec 14, 2025

I'll note I'm also hesitant to add a license file at root (which would be picked-up by GitHub for display), at least for this PR where the goal is only to add clearly missing information for re-used code.

The current project metadata says PSF, as BSD-like license. But most of the actual code (under com/, win32/ and Pythonwin/) are BSD 3-clause. And reading #1127 (comment) , BSD vs PSF at root doesn't currently feel too committal yet.

So I'm leaving that as a discussion for another time.

@Avasam Avasam changed the title Add missing license files Add missing license files for re-used code Dec 14, 2025
Comment thread README.md
</details>

## Licenses

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this table is adding any value, and may even be detrimental as it becomes less accurate over time (eg, when new modules are added etc) - I think this section still makes sense and is useful if the table is omitted entirely?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can omit the table, it was still a valid exercise for me to triple check I didn't miss anything.

Copy link
Copy Markdown
Owner

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@Avasam Avasam merged commit f82ff77 into mhammond:main Dec 15, 2025
28 checks passed
@Avasam Avasam deleted the Add-missing-licenses branch December 15, 2025 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing license

3 participants