Skip to content

Commit 6cb03bb

Browse files
[Infra] Update python and sphinx version (#862)
* update Sphinx version (#858) * Update Python & Sphinx (#859) * update Sphinx version * update python to 3.10 and Sphinx 8.1 * upgrade setup-python from v3 to v4 * update python version * Add SRI attributes to Highlight.js CDN scripts and styles (#860) * enforce default light mode in sphinx-book-theme (#861) --------- Co-authored-by: amitnGiniApps <155542316+amitnGiniApps@users.noreply.github.com>
1 parent 8958b56 commit 6cb03bb

File tree

7 files changed

+130
-44
lines changed

7 files changed

+130
-44
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ jobs:
6767
uses: actions/checkout@v3
6868
with:
6969
path: functions
70-
# Install python 3.9
71-
- name: Install python 3.9
72-
uses: actions/setup-python@v3
70+
# Install python 3.10.17
71+
- name: Install python 3.10.17
72+
uses: actions/setup-python@v4
7373
with:
74-
python-version: 3.9
74+
python-version: 3.10.17
7575
# Install dependencies
7676
- uses: actions/cache@v3
7777
id: cache

.github/workflows/test-all.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
shell: bash
1515
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"
1616
id: myref
17-
17+
1818
- uses: actions/checkout@v4
1919
- id: set-matrix
2020
# This is very hacky, but it goes like that:
@@ -66,11 +66,11 @@ jobs:
6666
uses: actions/checkout@v4
6767
with:
6868
path: functions
69-
# Install python 3.9
70-
- name: Install python 3.9
71-
uses: actions/setup-python@v3
69+
# Install python 3.10.17
70+
- name: Install python 3.10.17
71+
uses: actions/setup-python@v4
7272
with:
73-
python-version: 3.9
73+
python-version: 3.10.17
7474
# Install dependencies
7575
- uses: actions/cache@v3
7676
id: cache
@@ -99,7 +99,7 @@ jobs:
9999
runs-on: ubuntu-latest
100100
needs: run_monorepo_tests
101101
continue-on-error: false
102-
102+
103103
steps:
104104
- name: Get the current branch name
105105
shell: bash
@@ -114,10 +114,10 @@ jobs:
114114
with:
115115
repository: mlrun/marketplace
116116
path: marketplace
117-
- name: Install python 3.9
118-
uses: actions/setup-python@v3
117+
- name: Install python 3.10.17
118+
uses: actions/setup-python@v4
119119
with:
120-
python-version: 3.9
120+
python-version: 3.10.17
121121
- name: Install requirements
122122
run: |
123123
cd functions
Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,49 @@
1-
.bd-sidebar {
2-
display: none;
1+
html:root {
2+
--sd-color-primary: #2750ff;
3+
--pst-color-primary: var(--sd-color-primary);
4+
--pst-color-link-hover: var(--sd-color-primary);
5+
--pst-color-secondary: var(--sd-color-primary);
6+
--sd-color-secondary: #6c757d;
7+
--sd-color-success: #28a745;
8+
--sd-color-info: #2750ff;
9+
--sd-color-warning: #e3781a;
10+
--sd-color-danger: #dc3545;
11+
--sd-color-light: #f8f9fa;
12+
--sd-color-muted: #6c757d;
13+
--sd-color-dark: #212529;
14+
--sd-color-primary-highlight: var(--sd-color-primary);
15+
--sd-color-secondary-highlight: #5c636a;
16+
--sd-color-success-highlight: #228e3b;
17+
--sd-color-info-highlight: var(--sd-color-primary);
18+
--sd-color-warning-highlight: #cc986b;
19+
--sd-color-danger-highlight: #bb2d3b;
20+
--sd-color-light-highlight: #d3d4d5;
21+
--sd-color-muted-highlight: #5c636a;
22+
--sd-color-dark-highlight: #1c1f23;
23+
--sd-color-primary-text: #fff;
24+
--sd-color-secondary-text: #fff;
25+
--sd-color-success-text: #fff;
26+
--sd-color-info-text: #fff;
27+
--sd-color-warning-text: #fff;
28+
--sd-color-danger-text: #fff;
29+
--sd-color-light-text: #212529;
30+
--sd-color-muted-text: #fff;
31+
--sd-color-dark-text: #fff;
32+
--pst-color-accent: var(--sd-color-primary);
33+
--pst-color-secondary-highlight: var(--sd-color-primary);
34+
--pst-color-table-row-hover-bg: #d8dfff;
35+
--bs-dropdown-min-width: 8rem;
336
}
437

5-
.header-article {
6-
height: 0;
7-
background-color: transparent;
38+
.bd-sidebar,
39+
.header-article-items__start,
40+
.theme-switch-button,
41+
.search-button,
42+
.footer-content{
43+
display: none !important;
844
}
945

10-
.footer-content {
11-
display: none;
46+
.bd-header-article {
47+
position: relative;
48+
box-shadow: none !important;
1249
}

cli/marketplace/conf.template

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import re
1515
import sys
16+
import os
1617

1718
sys.path.insert(0, "{{sphinx_docs_target}}")
1819

@@ -28,7 +29,7 @@ master_doc = "index"
2829
# The short X.Y version
2930
version = "{{version}}"
3031
release = "{{release}}"
31-
32+
master_doc = "index"
3233

3334
# -- General configuration ---------------------------------------------------
3435

@@ -72,6 +73,8 @@ source_suffix = {
7273
".md": "myst-nb",
7374
}
7475

76+
# If you want to mock imports during autodoc
77+
autodoc_mock_imports = [{{mock_imports}}]
7578

7679
# -- Options for HTML output -------------------------------------------------
7780

@@ -86,22 +89,33 @@ html_theme = "sphinx_book_theme"
8689
html_static_path = ["_static"]
8790
html_css_files = ["css/custom.css"]
8891

92+
# conf.py
93+
94+
html_context = {
95+
"default_mode": "light", # Enforces light mode on page load
96+
}
97+
8998
html_theme_options = {
9099
"repository_url": "{{repository_url}}",
91-
"use_repository_button": True,
92-
"use_issues_button": True,
93-
"use_edit_page_button": True,
100+
"repository_branch": "{{repository_branch}}",
101+
"path_to_docs": "docs",
94102
"use_repository_button": False,
95103
"use_issues_button": False,
96104
"use_edit_page_button": False,
97-
"path_to_docs": "docs",
98-
"repository_branch": "{{repository_branch}}",
99-
"single_page": True,
105+
"home_page_in_toc": False,
100106
"navigation_with_keys": False,
101-
"use_download_button": False,
102107
"use_fullscreen_button": False,
108+
"show_navbar_depth": 1,
109+
"theme_dev_mode": False,
110+
"launch_buttons": {},
111+
"switcher": False,
112+
"search_bar_text": "",
113+
"search_bar_position": "none",
103114
}
104115

116+
# Prevents generation of searchindex.js
117+
html_search = False
118+
105119
html_title = "{{html_title}}"
106120
html_logo = "{{html_logo}}"
107121
html_favicon = "{{html_favicon}}"
@@ -124,3 +138,12 @@ def copy_doc(src, dest, title=""):
124138
changed = True
125139
out.write(line)
126140
{% endraw %}
141+
142+
# -- Post-build cleanup ------------------------------------------------------
143+
def remove_searchtools(app, exception):
144+
searchtools_path = os.path.join(app.outdir, '_static', 'searchtools.js')
145+
if os.path.exists(searchtools_path):
146+
os.remove(searchtools_path)
147+
148+
def setup(app):
149+
app.connect("build-finished", remove_searchtools)

cli/marketplace/python.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@
55
<meta charset="UTF-8">
66
<meta content="IE=edge" http-equiv="X-UA-Compatible">
77
<meta content="width=device-width, initial-scale=1.0" name="viewport">
8-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/atom-one-dark.min.css">
9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js"></script>
10-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/languages/python.min.js"></script>
8+
<link
9+
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/atom-one-dark.min.css"
10+
rel="stylesheet"
11+
integrity="sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07"
12+
crossorigin="anonymous"
13+
/>
14+
<script
15+
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"
16+
integrity="sha384-RH2xi4eIQ/gjtbs9fUXM68sLSi99C7ZWBRX1vDrVv6GQXRibxXLbwO2NGZB74MbU"
17+
crossorigin="anonymous"
18+
></script>
19+
<script
20+
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/python.min.js"
21+
integrity="sha384-eXRt+aAa2ig1yFVDQCLis8k9s/1dikTcigj+/R07yNdIxc8BAG/b1uHDyEW3of17"
22+
crossorigin="anonymous"
23+
></script>
1124
<title>Source</title>
1225
<script>hljs.highlightAll();</script>
1326
</head>
@@ -19,4 +32,4 @@
1932
</code>
2033
</pre>
2134
</body>
22-
</html>
35+
</html>

cli/marketplace/yaml.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@
55
<meta charset="UTF-8">
66
<meta content="IE=edge" http-equiv="X-UA-Compatible">
77
<meta content="width=device-width, initial-scale=1.0" name="viewport">
8-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/atom-one-dark.min.css">
9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js"></script>
10-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/languages/yaml.min.js"></script>
8+
<link
9+
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/atom-one-dark.min.css"
10+
rel="stylesheet"
11+
integrity="sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07"
12+
crossorigin="anonymous"
13+
/>
14+
<script
15+
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"
16+
integrity="sha384-RH2xi4eIQ/gjtbs9fUXM68sLSi99C7ZWBRX1vDrVv6GQXRibxXLbwO2NGZB74MbU"
17+
crossorigin="anonymous"
18+
></script>
19+
<script
20+
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/languages/yaml.min.js"
21+
integrity="sha384-A/iMReLA0Bo3tLydBIoOQXQzYnrwL90jkHYUubrtERUGCbIuU7U0EHge0Xd2s5sr"
22+
crossorigin="anonymous"
23+
></script>
1124
<title>Source</title>
1225
<script>hljs.highlightAll();</script>
1326
</head>
@@ -19,4 +32,4 @@
1932
</code>
2033
</pre>
2134
</body>
22-
</html>
35+
</html>

requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ pipenv
66
myst_nb
77
black~=22.0
88
isort~=5.7
9-
sphinx==4.0.2
10-
sphinx-book-theme==0.3.3
11-
sphinx-togglebutton==0.3.1
12-
sphinxcontrib-applehelp<=1.0.7
13-
sphinxcontrib.devhelp<=1.0.5
14-
sphinxcontrib-htmlhelp<=2.0.4
15-
sphinxcontrib-serializinghtml<=1.1.9
16-
sphinxcontrib-qthelp<=1.0.6
9+
sphinx~=8.1.0
10+
sphinx-book-theme~=1.1.3
11+
sphinx-togglebutton==0.3.2
12+
sphinxcontrib-applehelp==1.0.8
13+
sphinxcontrib-devhelp==1.0.6
14+
sphinxcontrib-htmlhelp==2.0.6
15+
sphinxcontrib-serializinghtml==1.1.10
16+
sphinxcontrib-qthelp==1.0.7

0 commit comments

Comments
 (0)