(Jun-23-2022, 10:41 PM)Skaperen Wrote: can it make a flat list of dependencies?It will give new line display of using
poetry show
or can also use pip list
when activate environment with poetry shell
. Poetry also gives description of what the libraries dos
G:\div_code\pan_env {git}{hg} poetry show atomicwrites 1.4.0 Atomic file writes. attrs 21.4.0 Classes Without Boilerplate colorama 0.4.5 Cross-platform colored terminal text. more-itertools 8.13.0 More routines for operating on iterables, beyond itertools numpy 1.23.0 NumPy is the fundamental package for array computing with Python. packaging 21.3 Core utilities for Python packages pandas 1.4.3 Powerful data structures for data analysis, time series, and statistics pluggy 0.13.1 plugin and hook calling mechanisms for python py 1.11.0 library with cross-python path, ini-parsing, io, code, log facilities pyparsing 3.0.9 pyparsing module - Classes and methods to define and execute parsing grammars pytest 5.4.3 pytest: simple powerful testing with Python python-dateutil 2.8.2 Extensions to the standard Python datetime module pytz 2022.1 World timezone definitions, modern and historical six 1.16.0 Python 2 and 3 compatibility utilities wcwidth 0.2.5 Measures the displayed width of unicode strings in a terminalpip just list the libraries and version
G:\div_code\pan_env {git}{hg} pip list Package Version --------------- ------- atomicwrites 1.4.0 attrs 21.4.0 colorama 0.4.5 more-itertools 8.13.0 numpy 1.23.0 packaging 21.3 pandas 1.4.3 pip 22.0.3 pluggy 0.13.1 py 1.11.0 pyparsing 3.0.9 pytest 5.4.3 python-dateutil 2.8.2 pytz 2022.1 setuptools 60.6.0 six 1.16.0 wcwidth 0.2.5 wheel 0.37.1To get Python list have to parse it,but i don't see why need that?
Can spend a couple of minute to make to a working Python list.
Redirect to a file
pip list > "pip_lst.txt"
Parse it:
pip_lst = [] with open('pip_lst.txt') as f: next(f);next(f) for line in f: pip_lst.append(line.split()) print(pip_lst)
Output:[['atomicwrites', '1.4.0'], ['attrs', '21.4.0'], ['colorama', '0.4.5'], ['more-itertools', '8.13.0'], ['numpy', '1.23.0'], ['packaging', '21.3'], ['pandas', '1.4.3'], ['pip', '22.0.3'], ['pluggy', '0.13.1'], ['py', '1.11.0'], ['pyparsing', '3.0.9'], ['pytest', '5.4.3'], ['python-dateutil', '2.8.2'], ['pytz', '2022.1'], ['setuptools', '60.6.0'], ['six', '1.16.0'], ['wcwidth', '0.2.5'], ['wheel', '0.37.1']]