/ \__
( @\_____
/ O
/ (_____/
/_____/ U
MinPin is a command-line tool that automatically adds minimum version pins from the conda list and pip list output to the unpinned packages in conda YAML files, such as environment.yml or anaconda-project.yml.
- Parses
conda listandpip listoutputs to retrieve installed package versions. - Updates YAML files by adding minimum version pins to unpinned packages (and skips already pinned packed).
- Handles both conda and pip dependencies.
- Preserves the original structure and comments of the YAML file.
pip install minpinActivate your environment and then run:
minpin <path/to/environment.yml or anaconda-project.yml>Input: original environment.yml
channels:
- conda-forge
dependencies:
- python=3.10 # blah blah
- numpy # blah
- pandas>=1.3
- pip
- pip:
- requests
- flaskOutput: Updated environment.yml
channels:
- conda-forge
dependencies:
- python=3.10 # blah blah
- numpy>=1.24.0 # auto min pinned 2024-11-18 # blah
- pandas>=1.3
- pip
- pip:
- requests>=2.28.2 # auto min pinned 2024-11-18
- flask>=2.2.3 # auto min pinned 2024-11-18