Open ebouchut opened 1 month ago
EDIT: moved to PR description.
@MikePlante1 I'd rather have your review approval for this one.
@marionbarker
I merged upstream/dev
which dismissed your approval.
@MikePlante1
✅ I merged the dev
branch and added instructions for using pip-compile
to create requirements.txt
.
Here is a proposal to make it easier to create and add dependencies, and to be alerted to security issues in the packages we use.
Why?
The goal is:
requirements.txt
).requirements.in
.requirements.txt
Today, when using a single file with all dependencies (
requirements.txt
), I find it difficult to spot the direct dependencies (sphinx, sphinx-copybutton, sphinx-rtd-theme, myst-parser
) in an ocean of indirect dependencies. So, I suggest using 2 files.How?
requirements.txt
to have 2 files:requirements.in
containing only the direct dependenciesrequirements.txt
containing the exhaustive list of all dependencies (direct and indirect). Today it does not contain the latter.pip-compile
lists below each dependencies its sub-dependencies.pip-compile
(from thepip-tools
package) to generaterequirements.txt
fromrequirements.in
.pip-compile
reads a source filerequirements.in
to generate arequirements.txt
with all the dependencies. It resolves and pins the dependencies to the ad-hoc version, ensuring reproducibility. It only focuses on dependencies declared in the source file.pip freeze
uses all packages installed in the virtual environment.Install
We need to install
pip-tools
first to usepip-compile
:Usage
Using
pip-compile
:pip-compile
only looks at the source file (requirements.in
), whereaspip freeze
looks at what is currently installed in the virtual environment.Previously, with
pip
: