|
4 | 4 | % |
5 | 5 | \gitLoad{lst:packages:requirementstxt}{\programmingWithPythonCodeRepo}{packages/requirements.txt}{}% |
6 | 6 | \listingTxt{packages:requirementstxt}{% |
7 | | -A requirements file demanding that version~\textil{1.26.4} of \numpy\ be installed.}% |
| 7 | +A requirements file demanding that version~\textil{2.5.2} of \numpy\ be installed.}% |
8 | 8 | % |
9 | 9 | \gitLoad{lst:packages:numpy_user_venv_req_sh}{\programmingWithPythonCodeRepo}{packages/numpy_user_venv_req.sh}{}% |
10 | 10 | \gitExecBash{packages:numpy_user_venv_req_sh}{\programmingWithPythonCodeRepo}{packages}{numpy_user_venv_req.sh} |
|
27 | 27 | \end{sloppypar}% |
28 | 28 | % |
29 | 29 | \Cref{lst:packages:requirementstxt} gives a trivial example of such a file. |
30 | | -It contains the line \textil{numpy==1.26.4}. |
31 | | -This means that \numpy\ of exactly the version~1.26.4 is required for our application. |
32 | | -Had we written \textil{numpy>=1.26.4}, then a larger version of \numpy\ would also have been OK. |
| 30 | +It contains the line \textil{numpy==2.5.2}. |
| 31 | +This means that \numpy\ of exactly the version~2.5.2 is required for our application. |
| 32 | +Had we written \textil{numpy>=2.5.2}, then a larger version of \numpy\ would also have been OK. |
33 | 33 | The other operators, \textil{>}, \textil{<}, and~\textil{<=} can be used as well and have their natural corresponding meaning. |
34 | | -If we had wanted, we could have written \textil{matplotlib} in the second line of our \textil{requirements.txt} file, which would then have meant that, besides \numpy\ of version~\textil{1.26.4}, the package \matplotlib\ is needed as well. |
35 | | -Writing only \textil{matplotlib} would be interpreted as \inQuotes{find the highest version of \matplotlib\ that is compatible with \numpy\ version~1.26.4.} |
| 34 | +If we had wanted, we could have written \textil{matplotlib} in the second line of our \textil{requirements.txt} file, which would then have meant that, besides \numpy\ of version~\textil{2.5.2}, the package \matplotlib\ is needed as well. |
| 35 | +Writing only \textil{matplotlib} would be interpreted as \inQuotes{find the highest version of \matplotlib\ that is compatible with \numpy\ version~2.5.2.} |
36 | 36 | But we only need one package, \numpy, so our file just has a single line. |
37 | 37 |
|
38 | 38 | In \cref{lst:packages:numpy_user_venv_req_sh}, we present a version of the script that we used to set up a virtual environment and run our two-line \numpy\ program under \ubuntu\ \linux~(see \cref{lst:packages:numpy_user_venv_req_sh}.) |
|
0 commit comments