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.

Command names with underscores must be invoked with dashes instead when upgrading from 6.7 to 7.0

See original GitHub issue

Click 7.0 is breaking upstream packages, in our case mschematool (issue reported there: https://github.com/aartur/mschematool/issues/11).

After upgrading from 6.7 to 7.0, the init_db command can no longer be found.

$ mschematool xyz init_db
Usage: mschematool [OPTIONS] DBNICK COMMAND [ARGS]...
Try "mschematool --help" for help.

Error: No such command "init_db".
ERROR: Job failed: exit code 2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
davidismcommented, Sep 27, 2018

You can still use underscores by specifying the command names explicitly. It’s just that the default is now to replace with dashses, to look more consistent with other CLI tools, whereas before you would have had to specify those explicitly.

So if you want to upgrade your app to 7.0 but continue using the old names, you can name them explicitly, or use a Command subclass that doesn’t have the new behavior. There are upgrade strategies here, it just means Click 7.0 is not a drop-in upgrade in some cases.

1reaction
adityanatrajcommented, Sep 26, 2018

@davidism thanks for the commit ref and the explanation. I think it could have been more prominently described in the changelog (given python naming conventions would imply an insignificant number of people would hit this) but I do understand it was a major release. On our side, probably we should have pinned our dependencies better -_-.

perhaps it makes sense to attempt both for some interim period? of course, you’d have to dedupe (and raise some exception) when someone goes wild and attempts to register both styles…

@di nice to see you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

VMware ESXi Upgrade - VMware vSphere 7.0 - VMware Docs
VMware ESXi Upgrade is for anyone who needs to upgrade from earlier ... and special characters such as underscore or dash when you...
Read more >
Upgrading To Newer Releases — Click Documentation (7.x)
Commands that take their name from the decorated function now replace underscores with dashes. For example, the Python function run_server will get the...
Read more >
Bash Reference Manual - GNU.org
The Bash manual page should be used as the definitive reference on ... the resulting fields are used as the command name and...
Read more >
Spring Boot Reference Documentation
You do not need to use the CLI to work with Spring Boot, but it is a quick ... period-separated key names, but...
Read more >
15.4. Extending clara with Plugins — Clara Deploy SDK 0.7.3 ...
The command from the above example can be invoked using either a dash ( - ) or ... with an underscore $ clara...
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