You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there are different ways to set package metadata (pyproject.toml, setup.py and setup.cfg).
pip prefers pyproject.toml over setup.py because it is the new standardized format to describe project metadata declaratively, introduced with PEP 621. It's easier to work with and allows for shared configuration between different tools.
the problem is, if you package your project with pyproject.toml instead of setup.py, then metadata.home_page will not be filled. it is always None.
there is a discussion in the pip-development team (pypa/pip#11221)
when you still want to use the homepage as an application_id for pup, then somethin like this could solve this issue:
from collections import OrderedDict
def _homepage(self):
_urls = OrderedDict()
if self.src_metadata.home_page:
_urls["Homepage"] = self.src_metadata.home_page
if self.src_metadata.download_url:
_urls["Download"] = self.src_metadata.download_url
purls = {pair.split(", ")[0]: pair.split(", ")[1] for pair in self.src_metadata.project_urls}
for name, url in purls.items():
# avoid duplicating homepage/download links in case the same
# url is specified in the pkginfo twice (in the Home-page
# or Download-URL field and again in the Project-URL fields)
comp_name = name.casefold().replace("-", "").replace("_", "")
if comp_name == "homepage" and url == _urls.get("Homepage"):
continue
if comp_name == "downloadurl" and url == _urls.get("Download"):
continue
_urls[name] = url
return next(iter(_urls.values()))
in create_msi.py and context.py you could use self._homepage() instead of self.src_metadata.home_page
THOUGHT:
The text was updated successfully, but these errors were encountered: