Closed reynoldsnlp closed 1 year ago
@ncoghlan @pfmoore @pradyunsg What is the best way to parse a requirements.txt
file into a list of requirements (or even packaging.requirements.Requirement
s) using pip
internals?
Looking at the example requirements.txt
in the docs I realized that parsing the file is not as trivial as I had assumed (e.g. following references to other requirements.txt
files), and I assume that pip
already has a well-tested function or class for this.
Hi, I’m sorry but using pip’s internal apis like this isn’t supported, so we can’t really help you here.
@pfmoore Sorry, it's been so long, I should have given some context with my request. This project is a response to https://github.com/pypa/pip/issues/5069, and I am (finally!) getting back to work on it. Since the ultimate goal is hopefully to fold this back in to pip
, it makes sense to me to rely on pip
internals to do the work.
I am hoping to have this in a good enough state that I can publicize it at PyCon in a couple weeks to get users and start identifying bugs/features for development.
Ah, yes, that’s a long time ago. Sorry I’d forgotten.
The
already_loaded
check is working for directly requested distributions, but needs to inspect requirements files to check each requirement.