diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-04-04 01:25:20 +0100 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-04-04 09:42:36 +0100 |
| commit | 0a836a3c2c8cb2f3a7b418f2c476b4b499cabdd1 (patch) | |
| tree | bec5e6be68e589f31f77f10d4f86794727abfd4b | |
| parent | ba7dc9eaa88131e7eab502a43c8e552de18b5319 (diff) | |
| download | python-setuptools-git-0a836a3c2c8cb2f3a7b418f2c476b4b499cabdd1.tar.gz | |
Fix dynamic readme
| -rw-r--r-- | setuptools/config/pyprojecttoml.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index d4024956..be812142 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -316,12 +316,17 @@ class _ConfigExpander: 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( |
