live

Don’t use parse_requirements in your code

I just ran into trouble while building a setuptools package.  Specifically, I was using pip.req.parse_requirements to process package dependencies from a requirements.txt file and noticed that upgrading pip would break my code.  Upon further investigation, I found out that they(authors of pip) do not guarantee the api of their internal code.  This is because they officially do not provide a programmatic api to pip see (https://github.com/pypa/pip/issues/2286).  My suggestion, just use readlines, its the same thing and dirt simple.

Posted by Chad Dotson in Programming, Programming Live Blog, 0 comments