Hacker News new | ask | show | jobs
by rydel 2002 days ago
That's actually really easy. Your target here is your venv site-packages, while requirements file is the prerequisite. The idea is that your site-packages folder has to be recreated/updated (pip install) when it is older than the requirements file. One thing you have to do is to simply update the directory timestamp each time you add a dependency, because adding a file into a folder does not change the folder timestamp. Having that it would be like

venv/site-packages: requirements.txt pip install -r $< touch $@

1 comments

I am pretty sure that this does not work. Maybe GNU Make accepts folders as targets (but that would be news to me). But even then, the folder itself does not inform you whether your pip install was successful or not.