2

see also https://github.com/pypa/hatch/discussions/763

This question is for the WolfgangFahl/py-3rdparty-mediawiki#92 for which https://github.com/WolfgangFahl/py-3rdparty-mediawiki/blob/master/pyproject.toml was created as shown below. The Summary, Home-Page, Author and License entries in pip show are empty for pip 22.1.2. as shown below.

How can the entries be made visible/configured?

[build-system]
# we use the hatch build system
# https://hatch.pypa.io/latest/config/build/
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "py-3rdparty-mediawiki"
authors = [
  {name = "Wolfgang Fahl", email = "wf@bitplan.com"},
  {name = "Tim Holzheim", email = "tim.holzheim@rwth-aachen.de"}
]
maintainers = [
  { name = "Wolfgang Fahl", email = "wf@bitplan.com" },
  {name = "Tim Holzheim", email = "tim.holzheim@rwth-aachen.de"}
]
readme = "README.md"
license= "Apache-2.0"
dependencies = [
    # https://pypi.org/project/GitPython/
    'gitpython',
    # https://pypi.org/project/Jinja2/
    'jinja2',
    # https://pypi.org/project/pywikibot/
    'pywikibot>=7.3',
    # https://pypi.org/project/pycryptodome/
    'pycryptodome>=3.15.0',
    # https://pypi.org/project/mwclient/
    'mwclient>=0.10.1',
    # https://pypi.org/project/mwparserfromhell/
    'mwparserfromhell>=0.6.4',
    # https://pypi.org/project/wikitextparser/
    'wikitextparser>=0.47.5',
    # https://pypi.org/project/pylodstorage/
    'pylodstorage>0.4.7'
]

requires-python = ">=3.8"
classifiers=[
    "Development Status :: 5 - Production/Stable",
    "Environment :: Web Environment",
    "Programming Language :: Python :: 3 :: Only",
    "Programming Language :: Python :: 3.8",
    "Programming Language :: Python :: 3.9",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Operating System :: OS Independent",
    "Topic :: Software Development :: Libraries :: Python Modules",
    "Intended Audience :: Developers",
    "License :: OSI Approved :: Apache Software License"
    ]
dynamic = ["version", "description"]
[tool.hatch.version]
path = "wikibot3rd/__init__.py"

[project.urls]
Home = "https://wiki.bitplan.com/index.php/Py-3rdparty-mediawiki"
Documentation = "https://wiki.bitplan.com/index.php/Py-3rdparty-mediawiki"
Source = "https://wiki.bitplan.com/index.php/Py-3rdparty-mediawiki"

[project.optional-dependencies]
test = [
  "green",
]

[tool.hatch.build.targets.wheel]
packages = [
  "wikibot3rd",
]

[project.scripts]
wikibackup = "wikibot3rd.wikipush:mainBackup"
wikiedit = "wikibot3rd.wikipush:mainEdit"
wikinuke = "wikibot3rd.wikipush:mainNuke"
wikipush = "wikibot3rd.wikipush:mainPush"
wikiquery = "wikibot3rd.wikipush:mainQuery"
wikiupload = "wikibot3rd.wikipush:mainUpload"
wikirestore = "wikibot3rd.wikipush:mainRestore"
wikiuser = "wikibot3rd.wikiuser:main"
pip show py-3rdparty-mediawiki
Name: py-3rdparty-mediawiki
Version: 0.9.0
Summary: 
Home-page: 
Author: 
Author-email: Wolfgang Fahl <wf@bitplan.com>, Tim Holzheim <tim.holzheim@rwth-aachen.de>
License: 
Location: /Users/wf/Library/Python/3.10/lib/python/site-packages
Requires: gitpython, jinja2, mwclient, mwparserfromhell, pycryptodome, pywikibot, wikitextparser
Required-by: py-yprinciple-gen, pymediawikidocker, pyMetaModel, pyOnlineSpreadsheetEditing, pysotsog, pyWikiCMS, scan

i was able to fix the description problem myself by removing "description" from the dynamic part and explicitly entering it.

For the other three fields i didn't find a proper answer in https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata

Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
  • 1
    Nothing you are doing wrong. There is a mismatch between (1) the `[project]` specification (2) the Python packaging "*Core Metadata*" (3) the output of `pip show` (4) what gets shown on _PyPI_. It is out of your hands. You can maybe mitigate a bit, but I am not sure it is worth the trouble. – sinoroc Feb 26 '23 at 11:51
  • Some related links: https://github.com/pypa/packaging-problems/issues/645 -- https://github.com/pypa/pip/issues/11138 -- https://github.com/pypa/pip/issues/11138 -- https://github.com/pypa/pip/issues/10799 – sinoroc Feb 26 '23 at 11:56
  • 1
    Actually, for the license, it should be `license = {text = "Apache-2.0"}` – sinoroc Feb 26 '23 at 14:38

1 Answers1

1

I ran across the same problems as you did and the links provided in the comments under your question helped a lot, but I think it'll still be better to summarize everything in a separate comment.

  1. For the authors the rules are the following:
  • If only name is provided, the value goes in Author or Maintainer as appropriate.
  • If only email is provided, the value goes in Author-email or Maintainer-email as appropriate.
  • If both email and name are provided, the value goes in Author-email or Maintainer-email as appropriate, with the format {name} <{email}>.

So if you want the author and email be on separate fields, you can specify it as follows:

authors = [
  { name="YOUR_NAME"},
  { email="YOUR@E.MAIL" },
]
  1. License must be specified in the following way:
license = {text = "YOUR_LICENSE"}
  1. Summary is under the description entry:
description = "YOUR_DESCRIPTION"
  1. Home-page can be filled by creating a separate file setup.cfg with the following contents:
[metadata]
url = https://github.com/YOUR_URL
gtristan
  • 355
  • 2
  • 10