Giter Site home page Giter Site logo

Comments (7)

faho avatar faho commented on September 24, 2024

What that test does is source the completion if a command by the given name exists:

if type -q (string replace -r '.*/([^/]+).fish' '$1' $f)
set -l out (source $f 2>&1 | string collect)
test -n "$out"
and echo -- OUTPUT from $f: $out
end

If that then prints anything, the test fails. It doesn't specifically care about what the command-to-be-completed is, or if it returns anything in specific, just the load-time behavior of the completion script (e.g. broken complete calls).

What error specifically are you seeing?

from fish-shell.

VulpineAmethyst avatar VulpineAmethyst commented on September 24, 2024

What we were encountering specifically was an issue caused by pip3 (for some reason) expecting /usr/bin/python to exist when our Python package only provides /usr/bin/python3.

from fish-shell.

faho avatar faho commented on September 24, 2024

The pip3 completion script in 3.7.1 calls pip3:

pip3 completion --fish 2>/dev/null | string replace -r -- " -c\s+pip\b" " -c pip3" | source

If that wants to run /usr/bin/python, then that is a real bug that manifests on your system (whether it is in pip3 or in Adélie's packaging), and any user who has pip3 installed but not /usr/bin/python would see error output and a non-functioning completion.

This appears to be working as intended.

from fish-shell.

faho avatar faho commented on September 24, 2024

Note: pip3's output here is pretty cheesy:

# pip fish completion start
function __fish_complete_pip
    set -lx COMP_WORDS (commandline -o) ""
    set -lx COMP_CWORD ( \
        math (contains -i -- (commandline -t) $COMP_WORDS)-1 \
    )
    set -lx PIP_AUTO_COMPLETE 1
    string split \  -- (eval $COMP_WORDS[1])
end
complete -fa "(__fish_complete_pip)" -c pip3
# pip fish completion end

This does not call /usr/bin/python anywhere, so I suspect the issue to be in a shebang somewhere. This would have to be fixed.

from fish-shell.

VulpineAmethyst avatar VulpineAmethyst commented on September 24, 2024

Yeah. The underlying issue is definitely on Python's end (and could be in our Python recipe), but fish could very well be installed on a system that doesn't have Python installed (e.g. my development VM only installs Python when building packages that depend on it, and it is otherwise not present, and I use fish there).

from fish-shell.

faho avatar faho commented on September 24, 2024

First of all: Our test tool is written in python. So you can't actually run the tests on a system without.

And this only checks the completions for things you have installed - it will only check the pip completions if you have pip. And it told you that the pip completions are not working correctly on that system. This seems to be a good thing to test, the test is working as designed.

The test script is correct and good, the failure is either in the completion script or the system.

In this case I'm calling this failure a bug on Adélie's or pip's end - you appear to have installed a pip3 that is not working correctly. I don't think we can really make the pip3 completion script more defensive - all it does is (after checking that pip3 exists), ask pip3 for completions.

from fish-shell.

VulpineAmethyst avatar VulpineAmethyst commented on September 24, 2024

Fair enough.

from fish-shell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.