Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Published version is incorrectly pinned to pydata-sphinx-theme~=0.6.0 #428

Closed
kousu opened this issue Nov 11, 2021 · 3 comments
Closed

Published version is incorrectly pinned to pydata-sphinx-theme~=0.6.0 #428

kousu opened this issue Nov 11, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@kousu
Copy link
Contributor

kousu commented Nov 11, 2021

Describe the problem

If I pip install sphinx-book-theme it installs pydata-sphinx-theme-0.6.3 and sphinx-book-theme-0.1.6. This is very confusing, since while pypi says the latest sphinx-book-theme is 0.1.6, the latest pydata-sphinx-theme is 0.7.2, and your own source shows it should be pinned to 0.7.*:

"pydata-sphinx-theme~=0.7.1",

pip install sphinx-book-theme
$ mkdir t2
$ cd t2/
$ python3 -m venv .venv
$ . .venv/bin/activate
(.venv) $ pip install sphinx-book-theme
Collecting sphinx-book-theme
  Using cached sphinx_book_theme-0.1.6-py3-none-any.whl (92 kB)
Collecting docutils<0.17,>=0.15
  Using cached docutils-0.16-py2.py3-none-any.whl (548 kB)
Collecting sphinx<5,>=3
  Using cached Sphinx-4.3.0-py3-none-any.whl (3.1 MB)
Collecting pyyaml
  Using cached PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (661 kB)
Collecting beautifulsoup4<5,>=4.6.1
  Using cached beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
Collecting pydata-sphinx-theme~=0.6.0
  Using cached pydata_sphinx_theme-0.6.3-py3-none-any.whl (1.4 MB)
Collecting click~=7.1
  Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting soupsieve>1.2
  Using cached soupsieve-2.3-py3-none-any.whl (37 kB)
Collecting alabaster<0.8,>=0.7
  Using cached alabaster-0.7.12-py2.py3-none-any.whl (14 kB)
Collecting Pygments>=2.0
  Using cached Pygments-2.10.0-py3-none-any.whl (1.0 MB)
Collecting sphinxcontrib-htmlhelp>=2.0.0
  Using cached sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl (100 kB)
Collecting requests>=2.5.0
  Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting sphinxcontrib-qthelp
  Using cached sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl (90 kB)
Collecting packaging
  Using cached packaging-21.2-py3-none-any.whl (40 kB)
Collecting sphinxcontrib-devhelp
  Using cached sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl (84 kB)
Collecting imagesize
  Using cached imagesize-1.3.0-py2.py3-none-any.whl (5.2 kB)
Collecting snowballstemmer>=1.1
  Using cached snowballstemmer-2.1.0-py2.py3-none-any.whl (93 kB)
Collecting sphinxcontrib-serializinghtml>=1.1.5
  Using cached sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl (94 kB)
Collecting sphinxcontrib-jsmath
  Using cached sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl (5.1 kB)
Collecting Jinja2>=2.3
  Using cached Jinja2-3.0.3-py3-none-any.whl (133 kB)
Collecting sphinxcontrib-applehelp
  Using cached sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl (121 kB)
Collecting babel>=1.3
  Using cached Babel-2.9.1-py2.py3-none-any.whl (8.8 MB)
Requirement already satisfied: setuptools in ./.venv/lib/python3.9/site-packages (from sphinx<5,>=3->sphinx-book-theme) (57.4.0)
Collecting pytz>=2015.7
  Using cached pytz-2021.3-py2.py3-none-any.whl (503 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting urllib3<1.27,>=1.21.1
  Using cached urllib3-1.26.7-py2.py3-none-any.whl (138 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Collecting charset-normalizer~=2.0.0
  Using cached charset_normalizer-2.0.7-py3-none-any.whl (38 kB)
Collecting pyparsing<3,>=2.0.2
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Installing collected packages: urllib3, pytz, pyparsing, MarkupSafe, idna, charset-normalizer, certifi, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, soupsieve, snowballstemmer, requests, Pygments, packaging, Jinja2, imagesize, docutils, babel, alabaster, sphinx, beautifulsoup4, pyyaml, pydata-sphinx-theme, click, sphinx-book-theme
Successfully installed Jinja2-3.0.3 MarkupSafe-2.0.1 Pygments-2.10.0 alabaster-0.7.12 babel-2.9.1 beautifulsoup4-4.10.0 certifi-2021.10.8 charset-normalizer-2.0.7 click-7.1.2 docutils-0.16 idna-3.3 imagesize-1.3.0 packaging-21.2 pydata-sphinx-theme-0.6.3 pyparsing-2.4.7 pytz-2021.3 pyyaml-6.0 requests-2.26.0 snowballstemmer-2.1.0 soupsieve-2.3 sphinx-4.3.0 sphinx-book-theme-0.1.6 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 urllib3-1.26.7
WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
You should consider upgrading via the '/home/kousu/src/neuropoly/t2/.venv/bin/python3 -m pip install --upgrade pip' command.

If I try to force it to use 0.7.* like it should, pip tries to download every version of sphinx-book-theme until it finds one it's satisfied with, eventually picking pydata-sphinx-theme-0.7.2 and sphinx-book-theme-0.0.11, an ancient version.

...
  Downloading sphinx_book_theme-0.0.28-py3-none-any.whl (31 kB)
  Downloading sphinx_book_theme-0.0.27-py3-none-any.whl (31 kB)
  Downloading sphinx_book_theme-0.0.26-py3-none-any.whl (31 kB)
  Downloading sphinx_book_theme-0.0.25-py3-none-any.whl (30 kB)
...
pip install pydata-sphinx-theme~=0.7.1 sphinx-book-theme
(.venv) [kousu@requiem t2]$ pip uninstall -y pydata-sphinx-theme sphinx-book-theme
Found existing installation: pydata-sphinx-theme 0.6.3
Uninstalling pydata-sphinx-theme-0.6.3:
  Successfully uninstalled pydata-sphinx-theme-0.6.3
Found existing installation: sphinx-book-theme 0.1.6
Uninstalling sphinx-book-theme-0.1.6:
  Successfully uninstalled sphinx-book-theme-0.1.6
(.venv) [kousu@requiem t2]$ pip install pydata-sphinx-theme~=0.7.1 sphinx-book-theme
Collecting pydata-sphinx-theme~=0.7.1
  Downloading pydata_sphinx_theme-0.7.2-py3-none-any.whl (1.4 MB)
     |████████████████████████████████| 1.4 MB 2.4 MB/s 
Collecting sphinx-book-theme
  Using cached sphinx_book_theme-0.1.6-py3-none-any.whl (92 kB)
Requirement already satisfied: beautifulsoup4 in ./.venv/lib/python3.9/site-packages (from pydata-sphinx-theme~=0.7.1) (4.10.0)
Requirement already satisfied: docutils!=0.17.0 in ./.venv/lib/python3.9/site-packages (from pydata-sphinx-theme~=0.7.1) (0.16)
Requirement already satisfied: sphinx in ./.venv/lib/python3.9/site-packages (from pydata-sphinx-theme~=0.7.1) (4.3.0)
Requirement already satisfied: pyyaml in ./.venv/lib/python3.9/site-packages (from sphinx-book-theme) (6.0)
Requirement already satisfied: click~=7.1 in ./.venv/lib/python3.9/site-packages (from sphinx-book-theme) (7.1.2)
  Downloading sphinx_book_theme-0.1.5-py3-none-any.whl (92 kB)
     |████████████████████████████████| 92 kB 3.1 MB/s 
  Downloading sphinx_book_theme-0.1.4-py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 2.2 MB/s 
  Downloading sphinx_book_theme-0.1.3-py3-none-any.whl (88 kB)
     |████████████████████████████████| 88 kB 2.5 MB/s 
  Downloading sphinx_book_theme-0.1.2-py3-none-any.whl (88 kB)
     |████████████████████████████████| 88 kB 2.5 MB/s 
  Downloading sphinx_book_theme-0.1.1-py3-none-any.whl (88 kB)
     |████████████████████████████████| 88 kB 2.4 MB/s 
  Downloading sphinx_book_theme-0.1.0-py3-none-any.whl (87 kB)
     |████████████████████████████████| 87 kB 2.2 MB/s 
  Downloading sphinx_book_theme-0.0.42-py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 2.4 MB/s 
  Downloading sphinx_book_theme-0.0.41-py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 2.6 MB/s 
  Downloading sphinx_book_theme-0.0.40-py3-none-any.whl (89 kB)
     |████████████████████████████████| 89 kB 2.8 MB/s 
  Downloading sphinx_book_theme-0.0.39-py3-none-any.whl (86 kB)
     |████████████████████████████████| 86 kB 2.0 MB/s 
  Downloading sphinx_book_theme-0.0.38-py3-none-any.whl (84 kB)
     |████████████████████████████████| 84 kB 1.1 MB/s 
  Downloading sphinx_book_theme-0.0.37-py3-none-any.whl (84 kB)
     |████████████████████████████████| 84 kB 1.5 MB/s 
  Downloading sphinx_book_theme-0.0.36-py3-none-any.whl (31 kB)
  Downloading sphinx_book_theme-0.0.35-py3-none-any.whl (30 kB)
  Downloading sphinx_book_theme-0.0.34-py3-none-any.whl (30 kB)
  Downloading sphinx_book_theme-0.0.33-py3-none-any.whl (30 kB)
  Downloading sphinx_book_theme-0.0.32-py3-none-any.whl (30 kB)
  Downloading sphinx_book_theme-0.0.31-py3-none-any.whl (29 kB)
  Downloading sphinx_book_theme-0.0.30-py3-none-any.whl (29 kB)
  Downloading sphinx_book_theme-0.0.29-py3-none-any.whl (29 kB)
  Downloading sphinx_book_theme-0.0.28-py3-none-any.whl (31 kB)
  Downloading sphinx_book_theme-0.0.27-py3-none-any.whl (31 kB)
  Downloading sphinx_book_theme-0.0.26-py3-none-any.whl (31 kB)
  Downloading sphinx_book_theme-0.0.25-py3-none-any.whl (30 kB)
  Downloading sphinx_book_theme-0.0.24-py3-none-any.whl (23 kB)
  Downloading sphinx_book_theme-0.0.23-py3-none-any.whl (23 kB)
  Downloading sphinx_book_theme-0.0.22-py3-none-any.whl (23 kB)
  Downloading sphinx_book_theme-0.0.21-py3-none-any.whl (23 kB)
  Downloading sphinx_book_theme-0.0.20-py3-none-any.whl (22 kB)
  Downloading sphinx_book_theme-0.0.19-py3-none-any.whl (22 kB)
  Downloading sphinx_book_theme-0.0.18-py3-none-any.whl (22 kB)
Collecting libsass
  Downloading libsass-0.21.0-cp36-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.whl (9.4 MB)
     |████████████████████████████████| 9.4 MB 4.6 MB/s 
Requirement already satisfied: setuptools in ./.venv/lib/python3.9/site-packages (from sphinx-book-theme) (57.4.0)
Collecting sphinx-book-theme
  Downloading sphinx_book_theme-0.0.17-py3-none-any.whl (22 kB)
  Downloading sphinx_book_theme-0.0.16-py3-none-any.whl (21 kB)
  Downloading sphinx_book_theme-0.0.15-py3-none-any.whl (21 kB)
  Downloading sphinx_book_theme-0.0.14-py3-none-any.whl (21 kB)
  Downloading sphinx_book_theme-0.0.13-py3-none-any.whl (21 kB)
  Downloading sphinx_book_theme-0.0.12-py3-none-any.whl (21 kB)
  Downloading sphinx_book_theme-0.0.11-py3-none-any.whl (21 kB)
Requirement already satisfied: soupsieve>1.2 in ./.venv/lib/python3.9/site-packages (from beautifulsoup4->pydata-sphinx-theme~=0.7.1) (2.3)
Collecting six
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: sphinxcontrib-applehelp in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (1.0.2)
Requirement already satisfied: imagesize in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (1.3.0)
Requirement already satisfied: Jinja2>=2.3 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (3.0.3)
Requirement already satisfied: sphinxcontrib-jsmath in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (1.0.1)
Requirement already satisfied: sphinxcontrib-htmlhelp>=2.0.0 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (2.0.0)
Requirement already satisfied: alabaster<0.8,>=0.7 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (0.7.12)
Requirement already satisfied: Pygments>=2.0 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (2.10.0)
Requirement already satisfied: sphinxcontrib-devhelp in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (1.0.2)
Requirement already satisfied: babel>=1.3 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (2.9.1)
Requirement already satisfied: sphinxcontrib-serializinghtml>=1.1.5 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (1.1.5)
Requirement already satisfied: snowballstemmer>=1.1 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (2.1.0)
Requirement already satisfied: packaging in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (21.2)
Requirement already satisfied: sphinxcontrib-qthelp in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (1.0.3)
Requirement already satisfied: requests>=2.5.0 in ./.venv/lib/python3.9/site-packages (from sphinx->pydata-sphinx-theme~=0.7.1) (2.26.0)
Requirement already satisfied: pytz>=2015.7 in ./.venv/lib/python3.9/site-packages (from babel>=1.3->sphinx->pydata-sphinx-theme~=0.7.1) (2021.3)
Requirement already satisfied: MarkupSafe>=2.0 in ./.venv/lib/python3.9/site-packages (from Jinja2>=2.3->sphinx->pydata-sphinx-theme~=0.7.1) (2.0.1)
Requirement already satisfied: certifi>=2017.4.17 in ./.venv/lib/python3.9/site-packages (from requests>=2.5.0->sphinx->pydata-sphinx-theme~=0.7.1) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./.venv/lib/python3.9/site-packages (from requests>=2.5.0->sphinx->pydata-sphinx-theme~=0.7.1) (2.0.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.venv/lib/python3.9/site-packages (from requests>=2.5.0->sphinx->pydata-sphinx-theme~=0.7.1) (1.26.7)
Requirement already satisfied: idna<4,>=2.5 in ./.venv/lib/python3.9/site-packages (from requests>=2.5.0->sphinx->pydata-sphinx-theme~=0.7.1) (3.3)
Requirement already satisfied: pyparsing<3,>=2.0.2 in ./.venv/lib/python3.9/site-packages (from packaging->sphinx->pydata-sphinx-theme~=0.7.1) (2.4.7)
Installing collected packages: six, pydata-sphinx-theme, libsass, sphinx-book-theme
Successfully installed libsass-0.21.0 pydata-sphinx-theme-0.7.2 six-1.16.0 sphinx-book-theme-0.0.11
WARNING: You are using pip version 21.2.3; however, version 21.3.1 is available.
You should consider upgrading via the '/home/kousu/src/neuropoly/t2/.venv/bin/python3 -m pip install --upgrade pip' command.

What is going on??

If I download the wheel directly from pypi and examine it, I find that it's pinned to

Requires-Dist: pydata-sphinx-theme (~=0.6.0)

which must explain pip's weird behaviour.

curl sphinx-book-theme-0.1.6.whl | unzip
$ curl -JLO https://files.pythonhosted.org/packages/7e/8d/fd2d209e83ee5491b658d079a3f27f66ee444fb02d88a3c8f5e64f8d8fa5/sphinx_book_theme-0.1.6-py3-none-any.whl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 92129  100 92129    0     0   533k      0 --:--:-- --:--:-- --:--:--  535k
(.venv) $ unzip sphinx_book_theme-0.1.6-py3-none-any.whl 
Archive:  sphinx_book_theme-0.1.6-py3-none-any.whl
  inflating: sphinx_book_theme/__init__.py  
  inflating: sphinx_book_theme/footer.html  
  inflating: sphinx_book_theme/launch.py  
  inflating: sphinx_book_theme/layout.html  
  inflating: sphinx_book_theme/sidebar.html  
  inflating: sphinx_book_theme/theme.conf  
  inflating: sphinx_book_theme/topbar.html  
  inflating: sphinx_book_theme/_templates/prev-next.html  
  inflating: sphinx_book_theme/_templates/sbt-sidebar-footer.html  
  inflating: sphinx_book_theme/_templates/sbt-sidebar-nav.html  
  inflating: sphinx_book_theme/_templates/sidebar-logo.html  
  inflating: sphinx_book_theme/static/__init__.py  
  inflating: sphinx_book_theme/static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js  
  inflating: sphinx_book_theme/static/sphinx-book-theme.css  
  inflating: sphinx_book_theme/static/sphinx-book-theme.e2363ea40746bee74734a24ffefccd78.css  
  inflating: sphinx_book_theme/static/images/logo_binder.svg  
  inflating: sphinx_book_theme/static/images/logo_colab.png  
  inflating: sphinx_book_theme/static/images/logo_jupyterhub.svg  
  inflating: sphinx_book_theme/topbar/download.html  
  inflating: sphinx_book_theme/topbar/fullscreen.html  
  inflating: sphinx_book_theme/topbar/launchbuttons.html  
  inflating: sphinx_book_theme/topbar/repobuttons.html  
  inflating: sphinx_book_theme/translations/README.md  
  inflating: sphinx_book_theme/translations/__init__.py  
  inflating: sphinx_book_theme/translations/_convert.py  
  inflating: sphinx_book_theme/translations/locales/__init__.py  
  inflating: sphinx_book_theme/translations/locales/ar/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/bg/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/bn/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ca/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/cs/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/da/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/de/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/el/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/eo/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/es/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/et/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/fi/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/fr/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/hr/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/id/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/it/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/iw/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ja/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ko/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/lt/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/lv/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ml/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/mr/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ms/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/nl/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/no/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/pl/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/pt/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ro/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ru/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/sk/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/sl/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/sr/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/sv/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ta/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/te/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/tg/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/th/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/tl/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/tr/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/uk/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/ur/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/vi/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/zh-cn/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme/translations/locales/zh-tw/LC_MESSAGES/booktheme.mo  
  inflating: sphinx_book_theme-0.1.6.dist-info/LICENSE  
  inflating: sphinx_book_theme-0.1.6.dist-info/METADATA  
  inflating: sphinx_book_theme-0.1.6.dist-info/WHEEL  
  inflating: sphinx_book_theme-0.1.6.dist-info/entry_points.txt  
  inflating: sphinx_book_theme-0.1.6.dist-info/top_level.txt  
  inflating: sphinx_book_theme-0.1.6.dist-info/RECORD  
(.venv) $ cat sphinx_book_theme-0.1.6.dist-info/METADATA 
Metadata-Version: 2.1
Name: sphinx-book-theme
Version: 0.1.6
Summary: Jupyter Book: Create an online book with Jupyter Notebooks
Home-page: https://jupyterbook.org/
Author: Project Jupyter Contributors
Author-email: [email protected]
License: BSD
Project-URL: Documentation, https://jupyterbook.org
Project-URL: Funding, https://jupyter.org/about
Project-URL: Source, https://github.com/jupyter/jupyter-book/
Project-URL: Tracker, https://github.com/jupyter/jupyter-book/issues
Keywords: reproducible science environments scholarship notebook
Platform: UNKNOWN
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: beautifulsoup4 (<5,>=4.6.1)
Requires-Dist: click (~=7.1)
Requires-Dist: docutils (<0.17,>=0.15)
Requires-Dist: pydata-sphinx-theme (~=0.6.0)
Requires-Dist: pyyaml
Requires-Dist: sphinx (<5,>=3)
Requires-Dist: importlib-resources (<3.5,>=3.0) ; python_version < "3.7"
Provides-Extra: code_style
Requires-Dist: pre-commit (~=2.7.0) ; extra == 'code_style'
Provides-Extra: live-dev
Requires-Dist: sphinx-autobuild ; extra == 'live-dev'
Requires-Dist: web-compile (~=0.2.1) ; extra == 'live-dev'
Provides-Extra: sphinx
Requires-Dist: ablog (~=0.10.13) ; extra == 'sphinx'
Requires-Dist: ipywidgets ; extra == 'sphinx'
Requires-Dist: folium ; extra == 'sphinx'
Requires-Dist: numpy ; extra == 'sphinx'
Requires-Dist: matplotlib ; extra == 'sphinx'
Requires-Dist: myst-nb (~=0.13) ; extra == 'sphinx'
Requires-Dist: nbclient ; extra == 'sphinx'
Requires-Dist: pandas ; extra == 'sphinx'
Requires-Dist: plotly ; extra == 'sphinx'
Requires-Dist: sphinx (~=4.0) ; extra == 'sphinx'
Requires-Dist: sphinx-design ; extra == 'sphinx'
Requires-Dist: sphinx-copybutton ; extra == 'sphinx'
Requires-Dist: sphinx-togglebutton (>=0.2.1) ; extra == 'sphinx'
Requires-Dist: sphinx-thebe ; extra == 'sphinx'
Requires-Dist: sphinxcontrib-bibtex (~=2.2) ; extra == 'sphinx'
Requires-Dist: sphinxext-opengraph ; extra == 'sphinx'
Provides-Extra: testing
Requires-Dist: coverage ; extra == 'testing'
Requires-Dist: myst-nb (~=0.13) ; extra == 'testing'
Requires-Dist: pytest (~=6.0.1) ; extra == 'testing'
Requires-Dist: pytest-cov ; extra == 'testing'
Requires-Dist: pytest-regressions (~=2.0.1) ; extra == 'testing'
Requires-Dist: sphinx-thebe ; extra == 'testing'

# sphinx-book-theme

[![codecov][codecov-badge]][codecov-link] [![Documentation Status][rtd-badge]][rtd-link] [![PyPI][pypi-badge]][pypi-link]

**An interactive book theme for Sphinx**.

This is a lightweight Sphinx theme designed to mimic the look-and-feel of an
interactive book. It has the following primary features:

* **Bootstrap 4**
  for visual elements and functionality.
* **Flexible content layout** that is inspired by beautiful online books,
  such as [the Edward Tufte CSS guide](https://edwardtufte.github.io/tufte-css/)
* **Visual classes designed for Jupyter Notebooks**. Cell inputs, outputs,
  and interactive functionality are all supported.
* **Launch buttons for online interactivity**. For pages that are built with
  computational material, connect your site to an online BinderHub for interactive content.

## Get started

To get started with `sphinx-book-theme`, first install it with `pip`:

pip install sphinx-book-theme


then, activate the theme in your Sphinx configuration (`conf.py`):

...
html_theme = "sphinx_book_theme"
...


This will activate the Sphinx Book Theme for your documentation. Note that you may
need to change your `html_theme_options` configuration depending on your previous
theme. See the pages to the left for information about what you can configure with
`sphinx-book-theme`.

## Documentation

See [the Sphinx Book Theme documentation](https://sphinx-book-theme.readthedocs.io/en/latest/)
for more information.

[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-book-theme/branch/master/graph/badge.svg
[codecov-link]: https://codecov.io/gh/executablebooks/sphinx-book-theme

[rtd-badge]: https://readthedocs.org/projects/sphinx-book-theme/badge/?version=latest
[rtd-link]: https://sphinx-book-theme.readthedocs.io/en/latest/?badge=latest

[pypi-badge]: https://img.shields.io/pypi/v/sphinx-book-theme.svg
[pypi-link]: https://pypi.org/project/sphinx-book-theme


And if I examine the sdist I find indeed it declares that dep, and also that it is 0.1.6:

# setup.py
        "pydata-sphinx-theme~=0.6.0",
# __init__.py
__version__ = "0.1.6"
(.venv) $ curl -JLO https://files.pythonhosted.org/packages/84/65/2304f4100023a6008afe4e5a3520f180a0f9fe670e9f3f34c634434aa933/sphinx-book-theme-0.1.6.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 60390  100 60390    0     0   248k      0 --:--:-- --:--:-- --:--:--  249k
(.venv) [kousu@requiem t2]$ tar -zxvf sphinx-book-theme-0.1.6.tar.gz 
sphinx-book-theme-0.1.6/
sphinx-book-theme-0.1.6/CHANGELOG.md
sphinx-book-theme-0.1.6/CONTRIBUTING.md
sphinx-book-theme-0.1.6/LICENSE
sphinx-book-theme-0.1.6/MANIFEST.in
sphinx-book-theme-0.1.6/PKG-INFO
sphinx-book-theme-0.1.6/README.md
sphinx-book-theme-0.1.6/setup.cfg
sphinx-book-theme-0.1.6/setup.py
sphinx-book-theme-0.1.6/sphinx_book_theme/
sphinx-book-theme-0.1.6/sphinx_book_theme/__init__.py
sphinx-book-theme-0.1.6/sphinx_book_theme/_templates/
sphinx-book-theme-0.1.6/sphinx_book_theme/_templates/prev-next.html
sphinx-book-theme-0.1.6/sphinx_book_theme/_templates/sbt-sidebar-footer.html
sphinx-book-theme-0.1.6/sphinx_book_theme/_templates/sbt-sidebar-nav.html
sphinx-book-theme-0.1.6/sphinx_book_theme/_templates/sidebar-logo.html
sphinx-book-theme-0.1.6/sphinx_book_theme/footer.html
sphinx-book-theme-0.1.6/sphinx_book_theme/launch.py
sphinx-book-theme-0.1.6/sphinx_book_theme/layout.html
sphinx-book-theme-0.1.6/sphinx_book_theme/sidebar.html
sphinx-book-theme-0.1.6/sphinx_book_theme/static/
sphinx-book-theme-0.1.6/sphinx_book_theme/static/__init__.py
sphinx-book-theme-0.1.6/sphinx_book_theme/static/images/
sphinx-book-theme-0.1.6/sphinx_book_theme/static/images/logo_binder.svg
sphinx-book-theme-0.1.6/sphinx_book_theme/static/images/logo_colab.png
sphinx-book-theme-0.1.6/sphinx_book_theme/static/images/logo_jupyterhub.svg
sphinx-book-theme-0.1.6/sphinx_book_theme/static/sphinx-book-theme.12a9622fbb08dcb3a2a40b2c02b83a57.js
sphinx-book-theme-0.1.6/sphinx_book_theme/static/sphinx-book-theme.css
sphinx-book-theme-0.1.6/sphinx_book_theme/static/sphinx-book-theme.e2363ea40746bee74734a24ffefccd78.css
sphinx-book-theme-0.1.6/sphinx_book_theme/theme.conf
sphinx-book-theme-0.1.6/sphinx_book_theme/topbar/
sphinx-book-theme-0.1.6/sphinx_book_theme/topbar/download.html
sphinx-book-theme-0.1.6/sphinx_book_theme/topbar/fullscreen.html
sphinx-book-theme-0.1.6/sphinx_book_theme/topbar/launchbuttons.html
sphinx-book-theme-0.1.6/sphinx_book_theme/topbar/repobuttons.html
sphinx-book-theme-0.1.6/sphinx_book_theme/topbar.html
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/README.md
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/__init__.py
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/_convert.py
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/__init__.py
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ar/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ar/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ar/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/bg/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/bg/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/bg/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/bn/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/bn/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/bn/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ca/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ca/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ca/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/cs/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/cs/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/cs/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/da/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/da/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/da/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/de/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/de/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/de/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/el/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/el/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/el/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/eo/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/eo/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/eo/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/es/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/es/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/es/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/et/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/et/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/et/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/fi/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/fi/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/fi/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/fr/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/fr/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/fr/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/hr/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/hr/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/hr/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/id/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/id/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/id/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/it/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/it/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/it/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/iw/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/iw/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/iw/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ja/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ja/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ja/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ko/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ko/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ko/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/lt/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/lt/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/lt/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/lv/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/lv/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/lv/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ml/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ml/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ml/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/mr/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/mr/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/mr/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ms/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ms/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ms/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/nl/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/nl/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/nl/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/no/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/no/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/no/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/pl/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/pl/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/pl/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/pt/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/pt/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/pt/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ro/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ro/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ro/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ru/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ru/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ru/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sk/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sk/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sk/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sl/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sl/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sl/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sr/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sr/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sr/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sv/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sv/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/sv/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ta/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ta/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ta/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/te/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/te/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/te/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tg/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tg/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tg/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/th/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/th/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/th/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tl/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tl/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tl/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tr/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tr/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/tr/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/uk/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/uk/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/uk/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ur/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ur/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/ur/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/vi/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/vi/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/vi/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/zh-cn/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/zh-cn/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/zh-cn/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/zh-tw/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/zh-tw/LC_MESSAGES/
sphinx-book-theme-0.1.6/sphinx_book_theme/translations/locales/zh-tw/LC_MESSAGES/booktheme.mo
sphinx-book-theme-0.1.6/sphinx_book_theme.egg-info/
sphinx-book-theme-0.1.6/sphinx_book_theme.egg-info/PKG-INFO
sphinx-book-theme-0.1.6/sphinx_book_theme.egg-info/SOURCES.txt
sphinx-book-theme-0.1.6/sphinx_book_theme.egg-info/dependency_links.txt
sphinx-book-theme-0.1.6/sphinx_book_theme.egg-info/entry_points.txt
sphinx-book-theme-0.1.6/sphinx_book_theme.egg-info/requires.txt
sphinx-book-theme-0.1.6/sphinx_book_theme.egg-info/top_level.txt
sphinx-book-theme-0.1.6/web-compile-config.yml
(.venv) $ cat sphinx-book-theme-0.1.6/setup.py 
from setuptools import setup, find_packages
from pathlib import Path

lines = Path("sphinx_book_theme").joinpath("__init__.py")
for line in lines.read_text().split("\n"):
    if line.startswith("__version__ ="):
        version = line.split(" = ")[-1].strip('"')
        break

setup(
    name="sphinx-book-theme",
    version=version,
    python_requires=">=3.6",
    author="Project Jupyter Contributors",
    author_email="[email protected]",
    url="https://jupyterbook.org/",
    project_urls={
        "Documentation": "https://jupyterbook.org",
        "Funding": "https://jupyter.org/about",
        "Source": "https://github.com/jupyter/jupyter-book/",
        "Tracker": "https://github.com/jupyter/jupyter-book/issues",
    },
    # this should be a whitespace separated string of keywords, not a list
    keywords="reproducible science environments scholarship notebook",
    description="Jupyter Book: Create an online book with Jupyter Notebooks",
    long_description=Path("./README.md").read_text(),
    long_description_content_type="text/markdown",
    license="BSD",
    packages=find_packages(),
    install_requires=[
        "beautifulsoup4>=4.6.1,<5",
        "click~=7.1",
        "docutils>=0.15,<0.17",
        'importlib-resources>=3.0,<3.5; python_version < "3.7"',
        "pydata-sphinx-theme~=0.6.0",
        "pyyaml",
        "sphinx>=3,<5",
    ],
    extras_require={
        "code_style": ["pre-commit~=2.7.0"],
        "sphinx": [
            "ablog~=0.10.13",
            "ipywidgets",
            "folium",
            "numpy",
            "matplotlib",
            "myst-nb~=0.13",
            "nbclient",
            "pandas",
            "plotly",
            "sphinx~=4.0",  # Force Sphinx to be the latest version
            "sphinx-design",
            "sphinx-copybutton",
            "sphinx-togglebutton>=0.2.1",
            "sphinx-thebe",
            "sphinxcontrib-bibtex~=2.2",
            "sphinxext-opengraph",
        ],
        "testing": [
            "coverage",
            "myst_nb~=0.13",
            "pytest~=6.0.1",
            "pytest-cov",
            "pytest-regressions~=2.0.1",
            "sphinx_thebe",
        ],
        "live-dev": ["sphinx-autobuild", "web-compile~=0.2.1"],
    },
    entry_points={"sphinx.html_themes": ["sphinx_book_theme = sphinx_book_theme"]},
    include_package_data=True,
)
(.venv) $ cat sphinx-book-theme-0.1.6/sphinx_book_theme/__init__.py 
"""A lightweight book theme based on the pydata sphinx theme."""
import os
from pathlib import Path

try:
    import importlib.resources as resources
except ImportError:
    # python < 3.7
    import importlib_resources as resources

from bs4 import BeautifulSoup as bs
from docutils.parsers.rst.directives.body import Sidebar
from docutils import nodes
from sphinx.application import Sphinx
from sphinx.locale import get_translation
from sphinx.util import logging

from .launch import add_hub_urls
from . import static as theme_static

__version__ = "0.1.6"
"""sphinx-book-theme version"""

SPHINX_LOGGER = logging.getLogger(__name__)
MESSAGE_CATALOG_NAME = "booktheme"


def get_html_theme_path():
    """Return list of HTML theme paths."""
    theme_path = os.path.abspath(Path(__file__).parent)
    return theme_path


def add_static_paths(app):
    """Ensure CSS/JS is loaded."""
    app.env.book_theme_resources_changed = False

    output_static_folder = Path(app.outdir) / "_static"
    theme_static_files = resources.contents(theme_static)

    if (
        app.config.html_theme_options.get("theme_dev_mode", False)
        and output_static_folder.exists()
    ):
        # during development, the JS/CSS may change, if this is the case,
        # we want to remove the old files and ensure that the new files are loaded
        for path in output_static_folder.glob("sphinx-book-theme*"):
            if path.name not in theme_static_files:
                app.env.book_theme_resources_changed = True
                path.unlink()
        # note sphinx treats theme css different to regular css
        # (it is specified in theme.conf), so we don't directly use app.add_css_file
        for fname in resources.contents(theme_static):
            if fname.endswith(".css"):
                if not (output_static_folder / fname).exists():
                    (output_static_folder / fname).write_bytes(
                        resources.read_binary(theme_static, fname)
                    )
                    app.env.book_theme_resources_changed = True

    # add javascript
    for fname in resources.contents(theme_static):
        if fname.endswith(".js"):
            app.add_js_file(fname)


def update_all(app, env):
    """During development, if CSS/JS has changed, all files should be re-written,
    to load the correct resources.
    """
    if (
        app.config.html_theme_options.get("theme_dev_mode", False)
        and env.book_theme_resources_changed
    ):
        return list(env.all_docs.keys())


def add_to_context(app, pagename, templatename, context, doctree):

    # TODO: remove this whenever the nav collapsing functionality is in the PST
    def sbt_generate_nav_html(
        level=1,
        include_item_names=False,
        with_home_page=False,
        prev_section_numbers=None,
        show_depth=1,
    ):
        # Config stuff
        config = app.env.config
        if isinstance(with_home_page, str):
            with_home_page = with_home_page.lower() == "true"

        # Convert the pydata toctree html to beautifulsoup
        toctree = context["generate_nav_html"](
            startdepth=level - 1,
            kind="sidebar",
            maxdepth=4,
            collapse=False,
            includehidden=True,
            titles_only=True,
        )
        toctree = bs(toctree, "html.parser")

        # Add the master_doc page as the first item if specified
        if with_home_page:
            # Pull metadata about the master doc
            master_doc = config["master_doc"]
            master_doctree = app.env.get_doctree(master_doc)
            master_url = context["pathto"](master_doc)
            master_title = list(master_doctree.traverse(nodes.title))
            if len(master_title) == 0:
                raise ValueError(f"Landing page missing a title: {master_doc}")
            master_title = master_title[0].astext()
            li_class = "toctree-l1"
            if context["pagename"] == master_doc:
                li_class += " current"
            # Insert it into our toctree
            ul_home = bs(
                f"""
            <ul class="nav bd-sidenav">
                <li class="{li_class}">
                    <a href="{master_url}" class="reference internal">{master_title}</a>
                </li>
            </ul>""",
                "html.parser",
            )
            toctree.insert(0, ul_home("ul")[0])

        # Open the navbar to the proper depth
        for ii in range(int(show_depth)):
            for checkbox in toctree.select(
                f"li.toctree-l{ii} > input.toctree-checkbox"
            ):
                checkbox.attrs["checked"] = None

        return toctree.prettify()

    context["sbt_generate_nav_html"] = sbt_generate_nav_html

    # Update the page title because HTML makes it into the page title occasionally
    if pagename in app.env.titles:
        title = app.env.titles[pagename]
        context["pagetitle"] = title.astext()

    # Add a shortened page text to the context using the sections text
    if doctree:
        description = ""
        for section in doctree.traverse(nodes.section):
            description += section.astext().replace("\n", " ")
        description = description[:160]
        context["page_description"] = description

    # Add the author if it exists
    if app.config.author != "unknown":
        context["author"] = app.config.author

    # Add HTML context variables that the pydata theme uses that we configure elsewhere
    # For some reason the source_suffix sometimes isn't there even when doctree is
    if doctree and context.get("page_source_suffix"):
        config_theme = app.config.html_theme_options
        repo_url = config_theme.get("repository_url", "")
        # Only add the edit button if `repository_url` is given
        if repo_url:
            branch = config_theme.get("repository_branch")
            if not branch:
                # Explicitly check in cae branch is ""
                branch = "master"
            relpath = config_theme.get("path_to_docs", "")
            org, repo = repo_url.strip("/").split("/")[-2:]
            context.update(
                {
                    "github_user": org,
                    "github_repo": repo,
                    "github_version": branch,
                    "doc_path": relpath,
                }
            )
    else:
        # Disable using the button so we don't get errors
        context["theme_use_edit_page_button"] = False

    # Make sure the context values are bool
    btns = [
        "theme_use_edit_page_button",
        "theme_use_repository_button",
        "theme_use_issues_button",
        "theme_use_download_button",
        "theme_use_fullscreen_button",
    ]
    for key in btns:
        if key in context:
            context[key] = _string_or_bool(context[key])

    translation = get_translation(MESSAGE_CATALOG_NAME)
    context["translate"] = translation
    # this is set in the html_theme
    context["theme_search_bar_text"] = translation(
        context.get("theme_search_bar_text", "Search the docs ...")
    )


def update_thebe_config(app, env, docnames):
    """Update thebe configuration with SBT-specific values"""
    theme_options = env.config.html_theme_options
    if theme_options.get("launch_buttons", {}).get("thebe") is True:
        if not hasattr(env.config, "thebe_config"):
            SPHINX_LOGGER.warning(
                (
                    "Thebe is activated but not added to extensions list. "
                    "Add `sphinx_thebe` to your site's extensions list."
                )
            )
            return
        # Will be empty if it doesn't exist
        thebe_config = env.config.thebe_config
    else:
        return

    if not theme_options.get("launch_buttons", {}).get("thebe"):
        return

    # Update the repository branch and URL
    # Assume that if there's already a thebe_config, then we don't want to over-ride
    if "repository_url" not in thebe_config:
        thebe_config["repository_url"] = theme_options.get("repository_url")
    if "repository_branch" not in thebe_config:
        branch = theme_options.get("repository_branch")
        if not branch:
            # Explicitly check in case branch is ""
            branch = "master"
        thebe_config["repository_branch"] = branch

    # Update the selectors to find thebe-enabled cells
    selector = thebe_config.get("selector", "") + ",.cell"
    thebe_config["selector"] = selector.lstrip(",")

    selector_input = (
        thebe_config.get("selector_input", "") + ",.cell_input div.highlight"
    )
    thebe_config["selector_input"] = selector_input.lstrip(",")

    selector_output = thebe_config.get("selector_output", "") + ",.cell_output"
    thebe_config["selector_output"] = selector_output.lstrip(",")

    env.config.thebe_config = thebe_config


def _string_or_bool(var):
    if isinstance(var, str):
        return var.lower() == "true"
    elif isinstance(var, bool):
        return var
    else:
        return var is None


class Margin(Sidebar):
    """Goes in the margin to the right of the page."""

    optional_arguments = 1
    required_arguments = 0

    def run(self):
        """Run the directive."""
        if not self.arguments:
            self.arguments = [""]
        nodes = super().run()
        nodes[0].attributes["classes"].append("margin")

        # Remove the "title" node if it is empty
        if not self.arguments:
            nodes[0].children.pop(0)
        return nodes


def setup(app: Sphinx):
    app.connect("env-before-read-docs", update_thebe_config)

    # Configuration for Juypter Book
    app.connect("html-page-context", add_hub_urls)

    app.connect("builder-inited", add_static_paths)
    app.connect("env-updated", update_all)

    # add translations
    package_dir = os.path.abspath(os.path.dirname(__file__))
    locale_dir = os.path.join(package_dir, "translations", "locales")
    app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir)

    app.add_html_theme("sphinx_book_theme", get_html_theme_path())
    app.connect("html-page-context", add_to_context)

    app.add_directive("margin", Margin)

    # Update templates for sidebar
    app.config.templates_path.append(os.path.join(package_dir, "_templates"))

    return {
        "parallel_read_safe": True,
        "parallel_write_safe": True,
    }

Link to your repository or website

No response

Steps to reproduce

pip install sphinx-book-theme

The version of Python you're using

3.9.7

Your operating system

ArchLinux

Versions of your packages

No response

Additional context

No response

@kousu kousu added the bug Something isn't working label Nov 11, 2021
kousu added a commit to kousu/sphinx-book-theme that referenced this issue Nov 11, 2021
Fixes executablebooks#427. Or..it should..but I'm not sure because executablebooks#428 makes me think what's in this repo is not making it out to pypi.
@chrisjsewell
Copy link
Member

chrisjsewell commented Nov 11, 2021

Heya, the upgraded to pydata-sphinx-theme 0.7, hasn't released yet. It's still pinned to 0.6 in sphinx-book-theme 0.1.6:

"pydata-sphinx-theme~=0.6.0",

@chrisjsewell
Copy link
Member

I'm going to close this as a duplicate of #423

@kousu
Copy link
Contributor Author

kousu commented Nov 11, 2021

Oh. Okay.

So for dealing with #427 is the only option in the meantime to set sphinx~=4.2.0 in my setup.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants