damnever / pigar

:coffee: A tool to generate requirements.txt for Python project, and more than that. (IT IS NOT A PACKAGE MANAGEMENT TOOL)
https://damnever.github.io/pigar/
BSD 3-Clause "New" or "Revised" License
1.64k stars 90 forks source link

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

Closed gsingh93 closed 1 year ago

gsingh93 commented 1 year ago

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.

damnever commented 1 year ago

Thank you. I believe this feature request is reasonable.

damnever commented 1 year ago

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