Skip to content

Conversation

@wagenrace
Copy link

Pull Request Details

This will add the Apache-2.0 according to the SPDX standard and fixes #1156

@google-cla
Copy link

google-cla bot commented Oct 21, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@tkng
Copy link

tkng commented Oct 25, 2025

I noticed the same issue and came here. I'm glad to see that this pull request has already proposed a fix — thank you for working on this.

It seems that the addition of license information in this pull request follows an deprecated approach, according to the Python Packaging User Guide.

It would be better to update it in accordance with PEP 639, like this:

diff --git a/python/pyproject.toml b/python/pyproject.toml
index 4ec78b6..a646638 100644
--- a/python/pyproject.toml
+++ b/python/pyproject.toml
@@ -11,6 +11,8 @@ authors = [
 description = "Unsupervised text tokenizer and detokenizer."
 readme = "README.md"
 requires-python = ">=3.9"
+license = "Apache-2.0"
+license-files = ["../LICENSE"]
 urls = { "Homepage" = "https://github.com/google/sentencepiece" }
 classifiers = [
   "Programming Language :: Python :: 3",

What do you think about this change?

@wagenrace
Copy link
Author

@tkng that also works. I think that is an even clear methods but have to read up on the path of License file
You now have the path the License file within the repo
But might be you need to path the license within the module

@tkng
Copy link

tkng commented Oct 26, 2025

@wagenrace I built a wheel file after applying the patch above, extracted its contents, and confirmed that the license file exists at sentencepiece-0.2.2.dist-info/licenses/LICENSE. Hence, we can use the notation license-files = ["../LICENSE"].

@wagenrace
Copy link
Author

wagenrace commented Oct 26, 2025

@tkng Great, I updated it
Good to know for myself too 😸

@tkng
Copy link

tkng commented Oct 28, 2025

Sorry, when I tried building with python -m build using the latest setuptools, I got the following warning:

/tmp/build-env-ki0ozy_3/lib/python3.12/site-packages/setuptools/dist.py:483: SetuptoolsDeprecationWarning: Pattern '../LICENSE' cannot contain '..'
!!

        ********************************************************************************
        Please ensure the files specified are contained by the root
        of the Python package (normally marked by `pyproject.toml`).

        By 2026-Mar-20, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://packaging.python.org/en/latest/specifications/glob-patterns/ for details.
        ********************************************************************************

Currently, the notation “../LICENSE” is allowed, but will not be allowed in the future... 😢 It seems better to have a symbolic link to the top level LICENSE file, as this made the warning disappear.

@wagenrace
Copy link
Author

@tkng ironically, a deprecation warning of SetupTools is what brought me here in the first place.
I had to update my tool license_scanner to remove SetupTools and was testing it on the 1000 most downloaded Python packages. That is how I found this typo in SentencePiece 😆

@wagenrace
Copy link
Author

pypa/setuptools#2339
It seems like setuptools is not really supporting file from the top level.
I see 2 options:

  • Copy the LICENSE file into the Python folder
  • Set the build location to the root of the repo and change the manifist.in to use only the Python except for the license

Personally, I think option 1 is clearer

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.

Python package does not have license

2 participants