Skip to content

Commit b679231

Browse files
committed
Add docs showing pip-tools usage on dependencies
This will help users not have random jinja or docutils updates break their builds. Fixes #9039
1 parent 27676b7 commit b679231

File tree

1 file changed

+92
-6
lines changed

1 file changed

+92
-6
lines changed

docs/user/guides/reproducible-builds.rst

Lines changed: 92 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ and **those settings live in your repository**.
4242
A configuration file with explicit dependencies looks like this:
4343

4444
.. code-block:: yaml
45-
45+
4646
# File: .readthedocs.yaml
4747
4848
version: 2
@@ -85,7 +85,7 @@ for example:
8585
and its dependencies using a requirements file.
8686

8787
.. code-block:: yaml
88-
88+
8989
# File: .readthedocs.yaml
9090
9191
version: 2
@@ -106,7 +106,7 @@ for example:
106106
Your project is relying on the default Python version and default installed dependencies.
107107

108108
.. code-block:: yaml
109-
109+
110110
# File: .readthedocs.yaml
111111
112112
version: 2
@@ -134,7 +134,7 @@ Some examples:
134134
readthedocs-sphinx-search==0.1.1
135135
136136
.. code-block:: yaml
137-
137+
138138
# File: docs/environment.yaml
139139
140140
name: docs
@@ -143,7 +143,7 @@ Some examples:
143143
- defaults
144144
dependencies:
145145
- sphinx==4.2.0
146-
- nbsphinx==0.8.1
146+
- nbsphinx==0.8.1
147147
- pip:
148148
- sphinx_rtd_theme==1.0.0
149149
@@ -160,7 +160,7 @@ Some examples:
160160
readthedocs-sphinx-search
161161
162162
.. code-block:: yaml
163-
163+
164164
# File: docs/environment.yaml
165165
166166
name: docs
@@ -182,3 +182,89 @@ or our Conda docs about :ref:`environment files <guides/conda:creating the \`\`e
182182

183183
Remember to update your docs' dependencies from time to time to get new improvements and fixes.
184184
It also makes it easy to manage in case a version reaches its end of support date.
185+
186+
187+
Pinning transitive dependencies
188+
-------------------------------
189+
190+
Once you have pinned your own dependencies,
191+
the next thing to worry about are the additional dependencies of these projects.
192+
Transitive dependencies are these extra dependencies.
193+
194+
We recommend `pip-tools`_ to help address this problem.
195+
It allows you to specify a ``requirements.in`` file with your first-level dependencies,
196+
and it generates a ``requirementes.txt`` file with the full set of transitive dependencies.
197+
198+
.. _pip-tools: https://pip-tools.readthedocs.io/en/latest/
199+
200+
✅ Good:
201+
All your transitive dependencies will stay defined,
202+
not allowing a package upgrade to break your docs.
203+
204+
.. code-block::
205+
206+
# File: docs/requirements.in
207+
208+
sphinx==4.2.0
209+
210+
.. code-block:: yaml
211+
212+
# File: docs/requirements.txt
213+
214+
# This file is autogenerated by pip-compile with python 3.7
215+
# To update, run:
216+
#
217+
# pip-compile docs.in
218+
#
219+
alabaster==0.7.12
220+
# via sphinx
221+
babel==2.10.1
222+
# via sphinx
223+
certifi==2021.10.8
224+
# via requests
225+
charset-normalizer==2.0.12
226+
# via requests
227+
docutils==0.17.1
228+
# via sphinx
229+
idna==3.3
230+
# via requests
231+
imagesize==1.3.0
232+
# via sphinx
233+
importlib-metadata==4.11.3
234+
# via sphinx
235+
jinja2==3.1.2
236+
# via sphinx
237+
markupsafe==2.1.1
238+
# via jinja2
239+
packaging==21.3
240+
# via sphinx
241+
pygments==2.11.2
242+
# via sphinx
243+
pyparsing==3.0.8
244+
# via packaging
245+
pytz==2022.1
246+
# via babel
247+
requests==2.27.1
248+
# via sphinx
249+
snowballstemmer==2.2.0
250+
# via sphinx
251+
sphinx==4.4.0
252+
# via -r docs.in
253+
sphinxcontrib-applehelp==1.0.2
254+
# via sphinx
255+
sphinxcontrib-devhelp==1.0.2
256+
# via sphinx
257+
sphinxcontrib-htmlhelp==2.0.0
258+
# via sphinx
259+
sphinxcontrib-jsmath==1.0.1
260+
# via sphinx
261+
sphinxcontrib-qthelp==1.0.3
262+
# via sphinx
263+
sphinxcontrib-serializinghtml==1.1.5
264+
# via sphinx
265+
typing-extensions==4.2.0
266+
# via importlib-metadata
267+
urllib3==1.26.9
268+
# via requests
269+
zipp==3.8.0
270+
# via importlib-metadata

0 commit comments

Comments
 (0)