reynoldsnlp / pipster

pipster: The pythonic way to `pip install`.
MIT License
8 stars 2 forks source link

Check for `already_loaded` with `requirements.txt` files #25

Closed reynoldsnlp closed 1 year ago

reynoldsnlp commented 1 year ago

The already_loaded check is working for directly requested distributions, but needs to inspect requirements files to check each requirement.

reynoldsnlp commented 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.Requirements) 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.

pfmoore commented 1 year ago

Hi, I’m sorry but using pip’s internal apis like this isn’t supported, so we can’t really help you here.

reynoldsnlp commented 1 year ago

@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.

pfmoore commented 1 year ago

Ah, yes, that’s a long time ago. Sorry I’d forgotten.