question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cli: pio ci 'target' for the run is None with click 8.0.2

See original GitHub issue

Configuration

Operating system:

Debian GNU/Linux 11 (bullseye)

PlatformIO Version (platformio --version):

PlatformIO Core, version 5.2.1rc1 PlatformIO Core, version 5.2.0

Description of problem

After pulling today’s Click 8.0.2, there is an issue with the implicit default for the ‘–target’

https://github.com/platformio/platformio-core/blob/fe62b810dba1fec1c3ae2463a4dbc0930741b21b/platformio/commands/run/command.py#L42

Error: Traceback (most recent call last):
  File "/home/runner/pio-test/lib/python3.9/site-packages/platformio/__main__.py", line 130, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "/home/runner/pio-test/lib/python3.9/site-packages/click/core.py", line 1126, in __call__
    return self.main(*args, **kwargs)


  File "/home/runner/pio-test/lib/python3.9/site-packages/click/core.py", line 1051, in main


    rv = self.invoke(ctx)
  File "/home/runner/pio-test/lib/python3.9/site-packages/platformio/commands/__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "/home/runner/pio-test/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/runner/pio-test/lib/python3.9/site-packages/click/core.py", line 1393, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/runner/pio-test/lib/python3.9/site-packages/click/core.py", line 752, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/pio-test/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/pio-test/lib/python3.9/site-packages/platformio/commands/ci.py", line 119, in cli
    ctx.invoke(cmd_run, project_dir=build_dir, verbose=verbose)
  File "/home/runner/pio-test/lib/python3.9/site-packages/click/core.py", line 752, in invoke
    return __callback(*args, **kwargs)
  File "/home/runner/pio-test/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/runner/pio-test/lib/python3.9/site-packages/platformio/commands/run/command.py", line 135, in cli
    process_env(
  File "/home/runner/pio-test/lib/python3.9/site-packages/platformio/commands/run/command.py", line 174, in process_env
    ep = EnvironmentProcessor(
  File "/home/runner/pio-test/lib/python3.9/site-packages/platformio/commands/run/processor.py", line 29, in __init__
    self.targets = [str(t) for t in targets]
TypeError: 'NoneType' object is not iterable

Tracing both ci and run, target is set to () when run is called normally as run(). But, when used through ctx.invoke(cmd_run) it is set to None which breaks the rest of the logic in the command.

But, not yet sure whether this was an intended change from the Click 8 release, or something broken in the context generation. Or, whether the default=() should be set explicitly in the PIO.

Steps to Reproduce

$ pip install click==8.0.2
$ pio ci <anything> --board nodemcuv2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ivankravetscommented, Oct 10, 2021

@mcspr , @franky47 , please add the next lines to your CLI workflow until we didn’t fix this issue:

pip install -U platformio
pip install "click!=8.0.2"
1reaction
ivankravetscommented, Oct 10, 2021

Temporary solutions (use of one them):

  1. Switch to the development version of PlatformIO Core:
    pio upgrade --dev
    
  2. Downgrade Click:
    pip install "click!=8.0.2"
    
Read more comments on GitHub >

github_iconTop Results From Across the Web

8.0.2 doesn't validate paths correctly · Issue #2088 · pallets/click
from click import Path >>> p = Path(dir_okay=False, exists=True, ... cli: pio ci 'target' for the run is None with click 8.0.2 ......
Read more >
pio run — PlatformIO latest documentation
Run project targets over environments declared in “platformio.ini” (Project ... It's also possible to list targets per project environment using pio run ......
Read more >
Untitled
Narcissus flycatcher song, Toca band no sound, Iphone 6 jailbreak 8.0.2 mac, ... Basix bubnjevi cena, Click on mem patch autocad, 10 slip...
Read more >
Untitled
Gold canyon resort weddings, Fssda, Si 1999 no 3312, Dunstable priory ... Under armour kids running shoes, Kiaa1549 function, Us open 2012 prize...
Read more >
Untitled
Certifica de non gage voiture, Caped coat men, New blood elf tyrande, ... Grave stone clip art, Waterfall style crossfit, Kinjal rajpriya history, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found