Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass requirements text directly to parse_requirements #48

Open
malikoth opened this issue May 18, 2020 · 1 comment
Open

Pass requirements text directly to parse_requirements #48

malikoth opened this issue May 18, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@malikoth
Copy link
Contributor

I have a use case where it may be easier to pass a blob of text representing the contents of a requirements file, rather than a file name (because a file may not actually exist on the FS). Could we refactor this so that you can pass an argument like parse_requirements(contents=my_text_blob) and have it go around the whole process of opening and reading the file?

Alternatively, if it at least supported passing filenames or file-like objects, then I could at least pass in a StringIO object that could be opened.

@di
Copy link
Owner

di commented May 18, 2020

This function is designed to replace pip._internal.req.req_file.parse_requirements, which only takes a filename.

When we wrap pip to support this function in pip-api, we need an actual filename to provide to pip on the command line, so pip_api would need to write out these contents to a temporary file in order to make this happen.

@di di added the enhancement New feature or request label May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants