File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1
1
# -- Project information ---------------------------------------------------------------
2
2
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
3
3
4
+ import os
5
+
6
+ # Some options are only enabled for the main packaging.python.org deployment builds
7
+ RTD_BUILD = bool (os .getenv ("READTHEDOCS" ))
8
+ RTD_PR_BUILD = RTD_BUILD and os .getenv ("READTHEDOCS_VERSION_TYPE" ) == "external"
9
+ RTD_URL = os .getenv ("READTHEDOCS_CANONICAL_URL" )
10
+ RTD_CANONICAL_BUILD = RTD_BUILD and not RTD_PR_BUILD and "packaging.python.org" in RTD_URL
11
+
4
12
project = "Python Packaging User Guide"
5
13
6
14
copyright = "2013–2020, PyPA"
55
63
html_favicon = "assets/py.png"
56
64
html_last_updated_fmt = ""
57
65
66
+ _metrics_js_files = [
67
+ ("https://plausible.io/js/script.js" , {"data-domain" : "packaging.python.org" })
68
+ ]
69
+ html_js_files = []
70
+ if RTD_CANONICAL_BUILD :
71
+ # Enable collection of the visitor metrics reported at
72
+ # https://plausible.io/packaging.python.org
73
+ html_js_files .extend (_metrics_js_files )
74
+
58
75
# -- Options for HTML help output ------------------------------------------------------
59
76
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-help-output
60
77
You can’t perform that action at this time.
0 commit comments