Skip to content

Commit 6d7c87b

Browse files
Updated files with 'repo_helper'. (#10)
Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com>
1 parent eda38ff commit 6d7c87b

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

doc-source/conf.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,28 @@
7171
}
7272

7373

74+
# Fix for pathlib issue with sphinxemoji on Python 3.9 and Sphinx 4.x
75+
def copy_asset_files(app, exc):
76+
# 3rd party
77+
from domdf_python_tools.compat import importlib_resources
78+
from sphinx.util.fileutil import copy_asset
79+
80+
if exc:
81+
return
82+
83+
asset_files = ["twemoji.js", "twemoji.css"]
84+
for path in asset_files:
85+
path_str = os.fspath(importlib_resources.files("sphinxemoji") / path)
86+
copy_asset(path_str, os.path.join(app.outdir, "_static"))
87+
88+
7489
def setup(app):
7590
# 3rd party
7691
from sphinx_toolbox.latex import better_header_layout
7792
from sphinxemoji import sphinxemoji
7893

7994
app.connect("config-inited", lambda app, config: better_header_layout(config))
80-
app.connect("build-finished", sphinxemoji.copy_asset_files)
95+
app.connect("build-finished", copy_asset_files)
8196
app.add_js_file("https://unpkg.com/twemoji@latest/dist/twemoji.min.js")
8297
app.add_js_file("twemoji.js")
8398
app.add_css_file("twemoji.css")

doc-source/requirements.txt

+6
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@ sphinx-licenseinfo>=0.3.1
1010
sphinx-notfound-page>=0.5
1111
sphinx-pyproject>=0.1.0
1212
sphinx-toolbox>=3.5.0
13+
sphinxcontrib-applehelp==1.0.4
14+
sphinxcontrib-devhelp==1.0.2
15+
sphinxcontrib-htmlhelp==2.0.1
16+
sphinxcontrib-jsmath==1.0.1
17+
sphinxcontrib-qthelp==1.0.3
18+
sphinxcontrib-serializinghtml==1.1.5
1319
sphinxemoji>=0.1.6
1420
toctree-plus>=0.6.1

pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ readme = "README.rst"
1010
keywords = [ "chemistry", "ESI", "LCMS", "PyMassSpec", "pyms",]
1111
dynamic = [ "requires-python", "classifiers", "dependencies",]
1212

13+
[project.license]
14+
file = "LICENSE"
15+
1316
[[project.authors]]
1417
name = "Dominic Davis-Foster"
1518
1619

17-
[project.license]
18-
file = "LICENSE"
19-
2020
[project.urls]
2121
Homepage = "https://github.com/GunShotMatch/pyms-lc-esi"
2222
"Issue Tracker" = "https://github.com/GunShotMatch/pyms-lc-esi/issues"

0 commit comments

Comments
 (0)