Visitar URL original
License missing on PyPI · Issue #457 · python-semver/python-semver · GitHub
Skip to content

License missing on PyPI #457

Closed
Closed

Description

@RobPasMue

Which version of Python is the problem with?

3.10

What semver version are you using?

3.0.3

What OS are you using? (Add more in the Environment section)

Linux

Situation

Looks like on PyPI, the new release does not ship properly the license type as part of its metadata:

https://pypi.org/project/semver/3.0.3/

It might be necessary to pass it as a classifier or explicitly set its input in the license entry. See other BSD-3 type packages:

https://pypi.org/project/scikit-bio/0.6.3/
https://github.com/scikit-bio/scikit-bio/blob/69468b98be09885519970d1d53510c1a83495750/setup.py#L121
https://github.com/scikit-bio/scikit-bio/blob/69468b98be09885519970d1d53510c1a83495750/setup.py#L222

Some tools are verifying compliance for Python package usage based on the license metadata shipped for a certain package, making this information critical for continuing the usage of the semver package.

How to reproduce

No need

Expected behavior

It should show up as:

Image

in PyPI and not as:

Image

Environment

No response

Activity

  1. added
    BugError, flaw or fault to produce incorrect or unexpected results
    InfraAll about infrastructure (GitHub Action, project build etc.)
    on Jan 20, 2025
  2. tomschr commented on Jan 20, 2025

    @tomschr
    Member

    Thank you for your issue.

    I've noticed that some things seems not to work as I switched to a uv workflow and also disabled the classifier. Probably that was the culprit. Need to investigate it further.

  3. RobPasMue commented on Jan 20, 2025

    @RobPasMue
    Author

    Might have to do it this way now? (based on https://peps.python.org/pep-0639/#project-source-metadata). license requires an SPDX identifier (in this case https://spdx.org/licenses/BSD-3-Clause.html) and you can pass the license-file now as well.

    [project]
    license= "BSD-3-Clause"
    license-file= "LICENSE.txt"

    Thanks for the quick response in any case!

  4. tomschr commented on Jan 20, 2025

    @tomschr
    Member

    Thanks, I've tried that out, but it didn't work with uv and the upload to (Test)PyPI failed. The error message was about a mismatch in metadata version (2.2 versus 2.4).

    To my (limited) understanding, it was also that PEP-0639 was partial(?) implemented in setuptools which caused this issue.

    For the time being, I think it's related to this diff which I disabled:

    -    # "License :: OSI Approved :: BSD License",
    +    "License :: OSI Approved :: BSD License",
  5. tomschr commented on Jan 20, 2025

    @tomschr
    Member

    If I use your above change with the license and license-file in pyproject.toml and run run tox r -e prepare-dist in Python 3.11, I get this error message:

    $ uv venv -p 3.11
    $ source .venv/bin/activate
    $ tox r -e prepare-dist
    [...]
    ValueError: invalid pyproject.toml config: `project`.
    configuration error: `project` must not contain {'license-file', 'licence'} properties
    
    ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist
    prepare-dist: exit 1 (0.95 seconds) /home/toms/repos/GH/tomschr/python-semver> pyproject-build pid=14213
      prepare-dist: FAIL code 1 (22.61=setup[21.66]+cmd[0.95] seconds)
      evaluation failed :( (23.04 seconds)
    
  6. RobPasMue commented on Jan 20, 2025

    @RobPasMue
    Author

    Yeah.. looks like the support for pep 639 might be halfway through the entire ecosystem making it not possible to adapt yet (probably?). Sorry the suggestion didn't work out and thanks for trying it out :)

  7. added 2 commits that reference this issue on Jan 20, 2025
    2eeb660
    64ad57c
  8. tomschr commented on Jan 20, 2025

    @tomschr
    Member

    Yeah.. looks like the support for pep 639 might be halfway through the entire ecosystem making it not possible to adapt yet (probably?). Sorry the suggestion didn't work out and thanks for trying it out :)

    No problem. 🙂 I appreciate your help! 👍

  9. tomschr commented on Jan 20, 2025

    @tomschr
    Member

    Found the issue for setuptools: pypa/setuptools#4759

  10. tomschr commented on Jan 22, 2025

    @tomschr
    Member

    @RobPasMue If you look at https://test.pypi.org/project/semver/3.0.4.dev1/, it shows as

    Meta
    License: BSD License (Copyright (c) 2013, Konstantine Rybnikov
    All rights reserved. Redistribution and use in source and ...)
    

    I think that should be sufficient.

  11. RobPasMue commented on Jan 23, 2025

    @RobPasMue
    Author

    Yep that works! Thanks @tomschr !

  12. added 2 commits that reference this issue on Jan 24, 2025
    8ae0417
    bae0b7c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugError, flaw or fault to produce incorrect or unexpected resultsInfraAll about infrastructure (GitHub Action, project build etc.)

Type

No type

Fields

SIze

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions