Conda is looking for the oldest version of numpy limited to the Python version

I would like to do unit testing on the oldest version of Numpy that I can, so I know if the code base works as many versions of Numpy as possible.

I install numpy via conda and test several versions of Python. However, in conda, different versions of Python have different subsets of the numpy versions available to them.

Is there an easy way to find which numpy versions are available for conda for a given python version, and of which the lowest version?

+4
source share
1 answer

First we need to get a complete list of versions

, numpy python 3.2, .

PACKAGE=numpy
PYTHON_VERSION=3.2

, , conda search --canonical -f "$PACKAGE", sed , python. name-version-buildstring, buildstring python -, py32 3.2 .. , py${PYTHON_VERSION/./}, . .

^$PACKAGE-\([^-]*\)-.*py${PYTHON_VERSION/./}.*, , .

, , , , -n start p sed.

, python:

conda search --canonical -f "$PACKAGE" | \
    sed -n "s/^$PACKAGE-\([^-]*\)-.*py${PYTHON_VERSION/./}.*/\1/p" | \
    sort -Vu

-V , . , , , , -V . -u , , , python.

, head -1.

conda search --canonical -f "$PACKAGE" | \
    sed -n "s/^$PACKAGE-\([^-]*\)-.*py${PYTHON_VERSION/./}.*/\1/p" | \
    sort -Vu | \
    head -1

. PACKAGE PYTHON_VERSION.

: , , , . , .

+3

Source: https://habr.com/ru/post/1624281/


All Articles