Skip to content

Commit 713d9a5

Browse files
authored
MAINT: Update GitHub Action and some structure improvements (#47)
1 parent 6d84981 commit 713d9a5

6 files changed

Lines changed: 207 additions & 169 deletions

File tree

.github/workflows/integration.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ name: continuous-integration
33
on: [push, pull_request]
44

55
jobs:
6-
76
docs:
8-
97
runs-on: ubuntu-latest
108
strategy:
119
matrix:
12-
python-version: [3.6, 3.7, 3.8]
10+
python-version: [3.7, 3.8, 3.9]
1311

1412
steps:
1513
- uses: actions/checkout@v2
@@ -21,7 +19,6 @@ jobs:
2119
run: |
2220
python -m pip install --upgrade pip
2321
pip install -e .[sphinx,testing]
24-
2522
- name: Run tests
2623
run: |
2724
pytest
@@ -35,14 +32,14 @@ jobs:
3532
steps:
3633
- name: Checkout source
3734
uses: actions/checkout@v2
38-
- name: Set up Python 3.7
35+
- name: Set up Python 3.8
3936
uses: actions/setup-python@v1
4037
with:
41-
python-version: 3.7
38+
python-version: "3.8"
4239
- name: Build package
4340
run: |
44-
pip install wheel
45-
python setup.py sdist bdist_wheel
41+
pip install build
42+
python -m build
4643
- name: Publish
4744
uses: pypa/gh-action-pypi-publish@v1.1.0
4845
with:

setup.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,28 @@
2525
packages=find_packages(),
2626
include_package_data=True,
2727
package_data={
28-
"sphinx_thebe": ["_static/sphinx-thebe.css", "_static/sphinx-thebe.js",]
28+
"sphinx_thebe": [
29+
"_static/sphinx-thebe.css",
30+
"_static/sphinx-thebe.js",
31+
]
2932
},
30-
classifiers=["License :: OSI Approved :: MIT License"],
33+
classifiers=[
34+
"License :: OSI Approved :: MIT License",
35+
"Development Status :: 4 - Beta",
36+
"Framework :: Sphinx :: Extension",
37+
"Intended Audience :: Developers",
38+
"License :: OSI Approved :: BSD License",
39+
"License :: OSI Approved :: MIT License",
40+
"Programming Language :: Python :: 3",
41+
"Programming Language :: Python :: 3 :: Only",
42+
"Programming Language :: Python :: 3.6",
43+
"Programming Language :: Python :: 3.7",
44+
"Programming Language :: Python :: 3.8",
45+
"Programming Language :: Python :: 3.9",
46+
"Programming Language :: Python :: Implementation :: CPython",
47+
"Programming Language :: Python :: Implementation :: PyPy",
48+
"Topic :: Software Development :: Libraries :: Python Modules",
49+
],
3150
install_requires=["sphinx>=3.5,<5"],
3251
extras_require={
3352
"sphinx": [

sphinx_thebe/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def init_thebe_default_config(app, env, docnames):
3333
for key, val in defaults.items():
3434
if key not in thebe_config:
3535
thebe_config[key] = val
36-
36+
3737
# Standardize types for certain values
3838
BOOL_KEYS = ["always_load"]
3939
for key in BOOL_KEYS:
@@ -55,15 +55,17 @@ def _do_load_thebe(doctree, config_thebe):
5555

5656
# If we aren't properly configured
5757
if not config_thebe:
58-
logger.warning("[sphinx-thebe]: Didn't find `thebe_config` in conf.py, add to use thebe")
58+
logger.warning(
59+
"[sphinx-thebe]: Didn't find `thebe_config` in conf.py, add to use thebe"
60+
)
5961
return False
60-
62+
6163
return True
6264

6365

6466
def init_thebe_core(app, env, docnames):
6567
"""Add scripts to configure thebe, and optionally add thebe itself.
66-
68+
6769
By default, defer loading the `thebe` JS bundle until bootstrap is called
6870
in order to speed up page load times.
6971
"""
@@ -84,6 +86,7 @@ def init_thebe_core(app, env, docnames):
8486
# If we've got `always load` on, then load thebe on every page.
8587
app.add_js_file(THEBE_JS_URL, **{"async": "async"})
8688

89+
8790
def update_thebe_context(app, doctree, docname):
8891
"""Add thebe config nodes to this doctree using page-dependent information."""
8992
config_thebe = app.config["thebe_config"]
@@ -160,7 +163,9 @@ def _split_repo_url(url):
160163
end = url.split("github.com/")[-1]
161164
org, repo = end.split("/")[:2]
162165
else:
163-
logger.warning(f"[sphinx-thebe]: Currently Thebe repositories must be on GitHub, got {url}")
166+
logger.warning(
167+
f"[sphinx-thebe]: Currently Thebe repositories must be on GitHub, got {url}"
168+
)
164169
org = repo = None
165170
return org, repo
166171

Lines changed: 83 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
/* Thebelab Buttons */
22
.thebelab-button {
3-
z-index: 999;
4-
display: inline-block;
5-
padding: 0.35em 1.2em;
6-
margin: 0px 1px;
7-
border-radius: 0.12em;
8-
box-sizing: border-box;
9-
text-decoration: none;
10-
font-family: 'Roboto', sans-serif;
11-
font-weight: 300;
12-
text-align: center;
13-
transition: all 0.2s;
14-
background-color: #dddddd;
15-
border: 0.05em solid white;
16-
color: #000000;
17-
}
18-
19-
.thebelab-button:hover{
20-
border: 0.05em solid black;
21-
background-color: #fcfcfc;
3+
z-index: 999;
4+
display: inline-block;
5+
padding: 0.35em 1.2em;
6+
margin: 0px 1px;
7+
border-radius: 0.12em;
8+
box-sizing: border-box;
9+
text-decoration: none;
10+
font-family: "Roboto", sans-serif;
11+
font-weight: 300;
12+
text-align: center;
13+
transition: all 0.2s;
14+
background-color: #dddddd;
15+
border: 0.05em solid white;
16+
color: #000000;
17+
}
18+
19+
.thebelab-button:hover {
20+
border: 0.05em solid black;
21+
background-color: #fcfcfc;
2222
}
2323

2424
.thebe-launch-button {
25-
height: 2.2em;
26-
font-size: .8em;
27-
border: 1px black solid;
25+
height: 2.2em;
26+
font-size: 0.8em;
27+
border: 1px black solid;
2828
}
2929

3030
/* Thebelab Cell */
@@ -33,88 +33,97 @@
3333
}
3434

3535
.thebelab-cell .thebelab-input {
36-
padding-left: 1em;
37-
margin-bottom: .5em;
38-
margin-top: .5em;
36+
padding-left: 1em;
37+
margin-bottom: 0.5em;
38+
margin-top: 0.5em;
3939
}
4040

4141
.thebelab-cell .jp-OutputArea {
42-
margin-top: .5em;
43-
margin-left: 1em;
42+
margin-top: 0.5em;
43+
margin-left: 1em;
4444
}
4545

4646
button.thebelab-button.thebelab-run-button {
47-
margin-left: 1.5em;
48-
margin-bottom: .5em;
47+
margin-left: 1.5em;
48+
margin-bottom: 0.5em;
4949
}
5050

5151
/* Loading button */
5252
button.thebe-launch-button div.spinner {
53-
float: left;
54-
margin-right: 1em;
53+
float: left;
54+
margin-right: 1em;
5555
}
5656

5757
/* Remove the spinner when thebelab is ready */
5858
.thebe-launch-button.thebe-status-ready .spinner {
59-
display: none;
59+
display: none;
6060
}
6161

6262
.thebe-launch-button span.status {
63-
font-family: monospace;
64-
font-weight: bold;
63+
font-family: monospace;
64+
font-weight: bold;
6565
}
6666

6767
.thebe-launch-button.thebe-status-ready span.status {
68-
color: green;
68+
color: green;
6969
}
7070

7171
.spinner {
72-
height: 2em;
73-
text-align: center;
74-
font-size: 0.7em;
75-
}
72+
height: 2em;
73+
text-align: center;
74+
font-size: 0.7em;
75+
}
7676

77-
.spinner > div {
78-
background-color: #F37726;
79-
height: 100%;
80-
width: 6px;
81-
display: inline-block;
77+
.spinner > div {
78+
background-color: #f37726;
79+
height: 100%;
80+
width: 6px;
81+
display: inline-block;
8282

83-
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
84-
animation: sk-stretchdelay 1.2s infinite ease-in-out;
85-
}
83+
-webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
84+
animation: sk-stretchdelay 1.2s infinite ease-in-out;
85+
}
8686

87-
.spinner .rect2 {
88-
-webkit-animation-delay: -1.1s;
89-
animation-delay: -1.1s;
90-
}
87+
.spinner .rect2 {
88+
-webkit-animation-delay: -1.1s;
89+
animation-delay: -1.1s;
90+
}
9191

92-
.spinner .rect3 {
93-
-webkit-animation-delay: -1.0s;
94-
animation-delay: -1.0s;
95-
}
92+
.spinner .rect3 {
93+
-webkit-animation-delay: -1s;
94+
animation-delay: -1s;
95+
}
9696

97-
.spinner .rect4 {
98-
-webkit-animation-delay: -0.9s;
99-
animation-delay: -0.9s;
100-
}
97+
.spinner .rect4 {
98+
-webkit-animation-delay: -0.9s;
99+
animation-delay: -0.9s;
100+
}
101101

102-
.spinner .rect5 {
103-
-webkit-animation-delay: -0.8s;
104-
animation-delay: -0.8s;
105-
}
102+
.spinner .rect5 {
103+
-webkit-animation-delay: -0.8s;
104+
animation-delay: -0.8s;
105+
}
106106

107-
@-webkit-keyframes sk-stretchdelay {
108-
0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
109-
20% { -webkit-transform: scaleY(1.0) }
107+
@-webkit-keyframes sk-stretchdelay {
108+
0%,
109+
40%,
110+
100% {
111+
-webkit-transform: scaleY(0.4);
110112
}
113+
20% {
114+
-webkit-transform: scaleY(1);
115+
}
116+
}
111117

112-
@keyframes sk-stretchdelay {
113-
0%, 40%, 100% {
114-
transform: scaleY(0.4);
115-
-webkit-transform: scaleY(0.4);
116-
} 20% {
117-
transform: scaleY(1.0);
118-
-webkit-transform: scaleY(1.0);
119-
}
118+
@keyframes sk-stretchdelay {
119+
0%,
120+
40%,
121+
100% {
122+
transform: scaleY(0.4);
123+
-webkit-transform: scaleY(0.4);
120124
}
125+
20% {
126+
transform: scaleY(1);
127+
-webkit-transform: scaleY(1);
128+
}
129+
}

0 commit comments

Comments
 (0)