Skip to content

Commit

Permalink
Fix dynamic readme
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Apr 4, 2022
1 parent ba7dc9e commit 0a836a3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions setuptools/config/pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,17 @@ def _obtain_version(self, dist: "Distribution", package_dir: Mapping[str, str]):
return None

def _obtain_readme(self, dist: "Distribution") -> Optional[Dict[str, str]]:
if "readme" in self.dynamic:
dynamic_cfg = self.dynamic_cfg
if "readme" not in self.dynamic:
return None

dynamic_cfg = self.dynamic_cfg
if "readme" in dynamic_cfg:
return {
"text": self._obtain(dist, "readme", {}),
"content-type": dynamic_cfg["readme"].get("content-type", "text/x-rst"),
}

self._ensure_previously_set(dist, "readme")
return None

def _obtain_entry_points(
Expand Down

0 comments on commit 0a836a3

Please sign in to comment.