Hacker News new | past | comments | ask | show | jobs | submit login

You want to be able to distinguish between loose dependency versions and strict locked versions for deterministic builds.

What fphilipe is talking about is something like

    $ cat requirements.txt
    requests>=2.12.1,<3.0.0
    $ pip install -r requirements.txt
    $ pip freeze > requirements.locked.txt
    $ cat requirements.locked.txt
    requests==2.12.1
This way you can run pip install -r requirements.txt when you want to update your dependencies and then lock the resolved dependencies in requirements.locked.txt so that you get deterministic builds when the code runs in production environments where reproducibility and reliability are important. It also gives you a clearer idea of what are top level dependencies and what are transitive dependencies because the transitive dependencies will only be listed in requirements.locked.txt. However this system has limitations and isn't standardized. If you want to have different groups, say development, production, testing. You end up with

   + requirements.development.txt
   + requirements.development.locked.txt
   + requirements.production.txt
   + requirements.production.locked.txt
   + requirements.test.txt
   + requirements.test.locked.txt
And even if you can tell which are your transitive dependencies by comparing .locked.txt to .txt it does not tell you why a given transitive dependency is in your locked dependencies e.g you don't know which of your top level dependencies is pulling it in.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: