damnever / pigar

:coffee: A tool to generate requirements.txt for Python project, and more than that. (IT IS NOT A PACKAGE MANAGEMENT TOOL)

Home Page:https://damnever.github.io/pigar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an option to output the `check` results in the correct format for requirements.txt

gsingh93 opened this issue · comments

Is your feature request related to a problem? Please describe.
I'd like to generate a requirements.txt file that has the latest version of all the packages in an existing requirements.txt file.

Describe the solution you'd like
Currently, check will output the results in a table like this:

 ===================================================
  DISTRIBUTION      | SPEC      | LOCAL   | LATEST
  ------------------+-----------+---------+--------
  black             | ==23.1.0  | 23.1.0  | 23.3.0

But it would be nice if it could output this instead:

black==23.3.0

so that I could copy and paste it into my requirements file. Maybe a --format flag could allow this?

While this functionality might make more sense to put under the generate command, it seems like generate will attempt to detect what dependencies your code needs and generate a requirements file based on that, while what I'm looking for is taking an existing requirements file and updating the versions in that instead.

Thank you. I believe this feature request is reasonable.

A new release is now available, give it a try: pip install pigar==2.0.8.