Can someone explain why the behaviour of `kedro bu...
# questions
j
Can someone explain why the behaviour of
kedro build-reqs
was changed? It used to build a
requirements.txt
file from a
<http://requirements.in|requirements.in>
file, and now it builds a
requirements.lock
file from a
requirements.txt
file.
n
Notice that this commands has been deprecated and will no longer be available in 0.19. However you can still achieve similar function using the underlying pip compile tool directly. To your question, it was done mainly because many people do not understand the difference between the two files. This was confusing to users. We did a user research and a majority of users tend to edit the .txt and generate a .lock file, similar to npm and poetry. That said, it’s easy to pass in an argument to specify which file to read and output, the default was changed to reduce the cognitive load for users as .txt is well recognised as the entry point for Python dependency.
K 1
j
Thanks for the information! I think I find the new method more confusing because I don’t understand where or how the lock file is used. If I
pip install -e src
or
pip install -r src/requirements.txt
, what’s happening in the background to ensure the contents of the lock file is utilised? Or am I supposed to ``pip install -r src/requirements.lock` ?
n
pip install -r src/requirements.lock
is supposed to be used. This is straightforward as you specify the file you want. There is no magic in the background as you use the
pip
command directly.
K 1
j
Right, got it. That’s what I was confused about, cheers!