@@ -42,8 +42,7 @@ and **those settings live in your repository**.
42
42
A configuration file with explicit dependencies looks like this:
43
43
44
44
.. code-block :: yaml
45
-
46
- # File: .readthedocs.yaml
45
+ :caption : .readthedocs.yaml
47
46
48
47
version : 2
49
48
@@ -62,8 +61,7 @@ A configuration file with explicit dependencies looks like this:
62
61
- requirements : docs/requirements.txt
63
62
64
63
.. code-block ::
65
-
66
- # File: docs/requirements.txt
64
+ :caption: docs/requirements.txt
67
65
68
66
# Defining the exact version will make sure things don't break
69
67
sphinx==4.2.0
@@ -85,8 +83,7 @@ for example:
85
83
and its dependencies using a requirements file.
86
84
87
85
.. code-block :: yaml
88
-
89
- # File: .readthedocs.yaml
86
+ :caption : .readthedocs.yaml
90
87
91
88
version : 2
92
89
@@ -106,8 +103,7 @@ for example:
106
103
Your project is relying on the default Python version and default installed dependencies.
107
104
108
105
.. code-block :: yaml
109
-
110
- # File: .readthedocs.yaml
106
+ :caption : .readthedocs.yaml
111
107
112
108
version : 2
113
109
@@ -126,24 +122,22 @@ Some examples:
126
122
in all platforms, and won't be updated unexpectedly.
127
123
128
124
.. code-block ::
129
-
130
- # File: docs/requirements.txt
125
+ :caption: docs/requirements.txt
131
126
132
127
sphinx==4.2.0
133
128
sphinx_rtd_theme==1.0.0
134
129
readthedocs-sphinx-search==0.1.1
135
130
136
131
.. code-block :: yaml
137
-
138
- # File: docs/environment.yaml
132
+ :caption : docs/environment.yaml
139
133
140
134
name : docs
141
135
channels :
142
136
- conda-forge
143
137
- defaults
144
138
dependencies :
145
139
- sphinx==4.2.0
146
- - nbsphinx==0.8.1
140
+ - nbsphinx==0.8.1
147
141
- pip :
148
142
- sphinx_rtd_theme==1.0.0
149
143
@@ -152,16 +146,14 @@ Some examples:
152
146
and your builds can fail or change unexpectedly any time.
153
147
154
148
.. code-block ::
155
-
156
- # File: docs/requirements.txt
149
+ :caption: docs/requirements.txt
157
150
158
151
sphinx
159
152
sphinx_rtd_theme
160
153
readthedocs-sphinx-search
161
154
162
155
.. code-block :: yaml
163
-
164
- # File: docs/environment.yaml
156
+ :caption : docs/environment.yaml
165
157
166
158
name : docs
167
159
channels :
@@ -182,3 +174,88 @@ or our Conda docs about :ref:`environment files <guides/conda:creating the \`\`e
182
174
183
175
Remember to update your docs' dependencies from time to time to get new improvements and fixes.
184
176
It also makes it easy to manage in case a version reaches its end of support date.
177
+
178
+
179
+ Pinning transitive dependencies
180
+ -------------------------------
181
+
182
+ Once you have pinned your own dependencies,
183
+ the next things to worry about are the dependencies of your dependencies.
184
+ These are called *transitive dependencies *,
185
+ and they can upgrade without warning if you do not pin these packages as well.
186
+
187
+ We recommend `pip-tools `_ to help address this problem.
188
+ It allows you to specify a ``requirements.in `` file with your first-level dependencies,
189
+ and it generates a ``requirements.txt `` file with the full set of transitive dependencies.
190
+
191
+ .. _pip-tools : https://pip-tools.readthedocs.io/en/latest/
192
+
193
+ ✅ Good:
194
+ All your transitive dependencies will stay defined,
195
+ which ensures new package releases will not break your docs.
196
+
197
+ .. code-block ::
198
+ :caption: docs/requirements.in
199
+
200
+ sphinx==4.2.0
201
+
202
+ .. code-block :: yaml
203
+ :caption : docs/requirements.txt
204
+
205
+ # This file is autogenerated by pip-compile with python 3.7
206
+ # To update, run:
207
+ #
208
+ # pip-compile docs.in
209
+ #
210
+ alabaster==0.7.12
211
+ # via sphinx
212
+ babel==2.10.1
213
+ # via sphinx
214
+ certifi==2021.10.8
215
+ # via requests
216
+ charset-normalizer==2.0.12
217
+ # via requests
218
+ docutils==0.17.1
219
+ # via sphinx
220
+ idna==3.3
221
+ # via requests
222
+ imagesize==1.3.0
223
+ # via sphinx
224
+ importlib-metadata==4.11.3
225
+ # via sphinx
226
+ jinja2==3.1.2
227
+ # via sphinx
228
+ markupsafe==2.1.1
229
+ # via jinja2
230
+ packaging==21.3
231
+ # via sphinx
232
+ pygments==2.11.2
233
+ # via sphinx
234
+ pyparsing==3.0.8
235
+ # via packaging
236
+ pytz==2022.1
237
+ # via babel
238
+ requests==2.27.1
239
+ # via sphinx
240
+ snowballstemmer==2.2.0
241
+ # via sphinx
242
+ sphinx==4.4.0
243
+ # via -r docs.in
244
+ sphinxcontrib-applehelp==1.0.2
245
+ # via sphinx
246
+ sphinxcontrib-devhelp==1.0.2
247
+ # via sphinx
248
+ sphinxcontrib-htmlhelp==2.0.0
249
+ # via sphinx
250
+ sphinxcontrib-jsmath==1.0.1
251
+ # via sphinx
252
+ sphinxcontrib-qthelp==1.0.3
253
+ # via sphinx
254
+ sphinxcontrib-serializinghtml==1.1.5
255
+ # via sphinx
256
+ typing-extensions==4.2.0
257
+ # via importlib-metadata
258
+ urllib3==1.26.9
259
+ # via requests
260
+ zipp==3.8.0
261
+ # via importlib-metadata
0 commit comments