diff --git a/sky/setup_files/setup.py b/sky/setup_files/setup.py
index 8a3b04ad03f..eaa1ca98025 100644
--- a/sky/setup_files/setup.py
+++ b/sky/setup_files/setup.py
@@ -47,11 +47,19 @@ def find_version(*filepath):
raise RuntimeError('Unable to find version string.')
-def parse_footnote(readme: str) -> str:
- """Parse the footnote from the README.md file."""
+def parse_readme(readme: str) -> str:
+ """Parse the README.md file to be pypi compatible."""
+ # Replace the footnotes.
readme = readme.replace('', '#')
footnote_re = re.compile(r'\[\^([0-9]+)\]')
- return footnote_re.sub(r'[\1]', readme)
+ readme = footnote_re.sub(r'[\1]', readme)
+
+ # Remove the dark mode switcher
+ mode_re = re.compile(
+ r'[\n ]*[\n ]*
[\n ]*',
+ re.MULTILINE)
+ readme = mode_re.sub(r'
', readme)
+ return readme
install_requires = [
@@ -113,7 +121,7 @@ def parse_footnote(readme: str) -> str:
# README. Skip the description for that case.
if os.path.exists(readme_filepath):
long_description = io.open(readme_filepath, 'r', encoding='utf-8').read()
- long_description = parse_footnote(long_description)
+ long_description = parse_readme(long_description)
setuptools.setup(
# NOTE: this affects the package.whl wheel name. When changing this (if