Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when having multiple candidates for dependencies. #25

Open
4rozenwolves opened this issue May 23, 2022 · 3 comments
Open

Error when having multiple candidates for dependencies. #25

4rozenwolves opened this issue May 23, 2022 · 3 comments

Comments

@4rozenwolves
Copy link

When running pypi2pkgbuild.py -v pytorch-lightning, I received:

DEBUG:pypi2pkgbuild:This is pypi2pkgbuild 0.3.
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile pkgfile >/dev/null
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/pytorch_lightning[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pacman -Q python-pytorch-lightning 2>/dev/null
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/pytorch_lightning-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/pytorch_lightning-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l python-pytorch-lightning 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
INFO:pypi2pkgbuild:Packaging python-pytorch-lightning 1.6.3.
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/pip[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/pip-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l python-pip 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
DEBUG:pypi2pkgbuild:Running subprocess from /tmp/tmphhasgsmy:
makepkg --printsrcinfo | grep -Po '(?<=^\tmakedepends = ).*'
DEBUG:pypi2pkgbuild:Running subprocess:
pacman -Q python-pip >/dev/null 2>&1
DEBUG:pypi2pkgbuild:Running subprocess from /tmp/tmpwa37mdiu:
makepkg
DEBUG:pypi2pkgbuild:Running subprocess:

set -e
python -mvenv /tmp/tmp7xtyhojy
# Leave the source directory, which may contain wheels/sdists/etc.
cd /tmp/tmp7xtyhojy
. '/tmp/tmp7xtyhojy/bin/activate'
pip install --upgrade pip >/dev/null
install_cmd() {
    pip list --format=freeze | cut -d= -f1 | sort >'/tmp/tmp7xtyhojy/pre'
    if ! pip install --no-deps 'pytorch-lightning==1.6.3.*,<1.6.3.1'; then
        return 1
    fi
    pip list --format=freeze | cut -d= -f1 | sort >'/tmp/tmp7xtyhojy/post'
    # installed name, or real name if it doesn't appear
    # (setuptools, pip, Cython, numpy).
    install_name="$(comm -13 '/tmp/tmp7xtyhojy/pre' '/tmp/tmp7xtyhojy/post')"
    # the requirement can be 'req_name==version', or a path name.
    if [[ -z "$install_name" ]]; then
        if [[ -e 'pytorch-lightning==1.6.3.*,<1.6.3.1' ]]; then
            install_name="$(basename 'pytorch-lightning==1.6.3.*,<1.6.3.1' .git)"
        else
            install_name="$(echo 'pytorch-lightning==1.6.3.*,<1.6.3.1' | cut -d= -f1 -)"
        fi
    fi
}
show_cmd() {
    python - "$(pip show -v "$install_name")" <<EOF
from email.parser import Parser
import json
import sys
print(json.dumps(dict(Parser().parsestr(sys.argv[1]))))
EOF
}
if install_cmd >/tmp/tmpx54krhqc; then
    show_cmd
else
    pip install numpy >/dev/null
    echo numpy >>/tmp/tmpwlovggos
    install_cmd >/tmp/tmpx54krhqc
    show_cmd
fi

DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/fsspec[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/fsspec-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l python-fsspec 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/numpy[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/numpy-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l python-numpy 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/packaging[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/packaging-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l python-packaging 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/pydeprecate[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pacman -Q python-pydeprecate 2>/dev/null
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/pydeprecate-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/pydeprecate-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l python-pydeprecate 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/pyyaml[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/pyyaml-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l python-yaml 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/tensorboard[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/tensorboard-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -l tensorboard 2>/dev/null | grep -Po '(?<=site-packages/)[^-/]*(?=.*\.egg-info/?$)'
DEBUG:pypi2pkgbuild:Running subprocess:
(shopt -s nocaseglob; pacman -Qo /usr/lib/python3.10/site-packages/torch[.-]*-info 2>/dev/null) | rev | cut -d' ' -f1,2 | rev
DEBUG:pypi2pkgbuild:Running subprocess:
pkgfile -riv '^/usr/lib/python3\.10/site-packages/torch-.*py3\.10\.egg-info' | cut -f1 | uniq | cut -d/ -f2
ERROR:pypi2pkgbuild:Multiple candidates for torch: python-pytorch 1.11.0-2, python-pytorch-cuda 1.11.0-2.
@anntzer
Copy link
Owner

anntzer commented May 23, 2022

Sounds reasonable to add a -d/--depends python-pytorch or similar flag to allow the end user to 1) manually specify additional depends and 2) resolve such ambiguities. A patch would be welcome.

@fengwang
Copy link

fengwang commented Oct 12, 2022

@anntzer Maybe you we can skip all the candidates from here without breaking the pipeline, and remind the user to install it afterwards?

@anntzer
Copy link
Owner

anntzer commented Oct 14, 2022

Sure, that seems fine too, but I would prefer protecting that under a --skip-ambiguous-deps option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants