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

platformio: Enable shell completion generation #107137

Merged

Conversation

kneitinger
Copy link
Contributor

@kneitinger kneitinger commented Dec 18, 2020

Motivation for this change

The platformio system completion install command relies on the click-completion python package to derive completions from the current click argument logic. When this command is ran, it currently errors on pip exceptions. If a nix-shell is used to run this command with click-completion installed, shell completion is broken when outside of the nix-shell.

After this change:

$ platformio system completion install
PlatformIO CLI completion has been installed for zsh shell to /home/kyle/.zshrc
Please restart a current shell session.

# In new shell, showing `platformio project` completions
$ platformio<TAB>pro<TAB><TAB>
config  -- Show computed configuration
data    -- Dump data intended for IDE extensions/plugins
init    -- Initialize a project or update existing
Things done
  • Add click-completion to python build's propagatedBuildInputs
  • Remove core.nix's unused fetchpatch
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

The `platformio system completion install` command relies on the
click-completion python package to derive completions from the current
click argument logic. When this command is ran, it currently errors on
pip exceptions. If a nix-shell is used to run this command with
click-completion installed, shell completion is broken when outside
of the nix-shell.
@kneitinger
Copy link
Contributor Author

@mogorman apologies for the at-mention (and please let me know if there is a better process!), but it seems that ofborg could not correctly identify the maintainers for some reason.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Mar 21, 2021

See https://github.com/platformio/platformio-core/blob/b0c3e22a525c340c86c0a2cbb1aa691c64339acb/platformio/__main__.py#L30

@ofborg eval

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 107137 run on x86_64-linux 1

2 packages built:
  • esphome
  • platformio

The following issues got detected with the above build packages.
Please fix at least the ones listed with your changed packages:

esphome:

warning: unused-argument
Unused argument: fetchpatch.
Near pkgs/tools/misc/esphome/default.nix:1:57:

  |
1 | { lib, python3, platformio, esptool, git, protobuf3_12, fetchpatch }:
  |                                                         ^

@SuperSandro2000 SuperSandro2000 merged commit 5e4a4e0 into NixOS:master Mar 21, 2021
@kneitinger kneitinger deleted the platformio_add_click_completion branch March 24, 2021 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants