click-contrib / click-aliases Goto Github PK
View Code? Open in Web Editor NEWenable aliases for click
License: MIT License
enable aliases for click
License: MIT License
is this still experimental ?
could it be uploaded on pypi ?
or is it superseded by https://github.com/pallets/click/blob/master/examples/aliases/aliases.py ?
Do you plan on adding support for the following situation?
# cli.py
import click
from click_aliases import ClickAliasedGroup
from foo import foo
@click.group(cls=ClickAliasedGroup)
def cli():
pass
cli.add_command(foo, aliases=['bar', 'baz', 'qux'])
if __name__ == "__main__":
cli()
# foo.py
import click
@click.command()
def foo():
"""Run a command."""
click.echo('foo')
Hello,
Is there any reason this requires Python 3.11? Click supports Python 3.7+.
All of the tests are failing on openSUSE Leap Python 3 , but not on openSUSE Tumbleweed or openSUSE Leap Python 2.
This could be an issue with a specific version of click, or could be the pytest version being used. I'll dig into it, but dont want it to slip away, hence raising the issue.
...
[ 12s] [130/160] cumulate python3-click-6.7-lp151.3.2
...
[ 41s] ============================= test session starts ==============================
[ 41s] platform linux -- Python 3.6.5, pytest-3.10.1, py-1.5.2, pluggy-0.8.0
[ 41s] rootdir: /home/abuild/rpmbuild/BUILD/click-aliases-1.0.1, inifile:
[ 41s] collected 9 items
[ 41s]
[ 41s] tests/test_basic.py FFF
[ 41s] tests/test_foobar.py FFF
[ 41s] tests/test_naval.py FFF
[ 41s]
[ 41s] =================================== FAILURES ===================================
[ 41s] __________________________________ test_help ___________________________________
[ 41s]
[ 41s] runner = <click.testing.CliRunner object at 0x7f4dc3dbbef0>
[ 41s]
[ 41s] def test_help(runner):
[ 41s] result = runner.invoke(cli)
[ 41s] > assert result.output == TEST_HELP
[ 41s] E AssertionError: assert '' == 'Usage: cli [OPTIONS] COMMAN...exit.\n\nCommands:\n foo\n'
[ 41s] E + Usage: cli [OPTIONS] COMMAND [ARGS]...
[ 41s] E +
[ 41s] E + Options:
[ 41s] E + --help Show this message and exit.
[ 41s] E +
[ 41s] E + Commands:
[ 41s] E + foo
[ 41s]
[ 41s] tests/test_basic.py:36: AssertionError
...
https://build.opensuse.org/package/show/home:jayvdb:py-new/python-click-aliases
https://travis-ci.org/jayvdb/click-aliases/jobs/568251511
runner = <click.testing.CliRunner object at 0x7fb65f97a550>
def test_cli(runner):
result = runner.invoke(cli)
> assert result.output == TEST_CLI
E AssertionError: assert 'Usage: cli [... ship (boat)\n' == 'Usage: cli [O...ages ships.\n'
E Skipping 116 identical leading characters in diff, use -v to show
E - ine (bomb)
E - ship (boat)
E + ine (bomb) Manages mines.
E + ship (boat) Manages ships.
tests/test_naval.py:88: AssertionError
________________________________ test_ship_help ________________________________
runner = <click.testing.CliRunner object at 0x7fb65f97b110>
def test_ship_help(runner):
for cmd in ['ship', 'boat']:
result = runner.invoke(cli, [cmd])
> assert result.output == TEST_SHIP_HELP.format(cmd=cmd)
E AssertionError: assert 'Usage: cli s...shoot (fire)\n' == 'Usage: cli sh...ire to X,Y.\n'
E Skipping 134 identical leading characters in diff, use -v to show
E - ,navigate)
E - new (add,build,create)
E - shoot (fire)
E + ,navigate) Moves SHIP to the new location X,Y.
E + new (add,build,create) Creates a new ship.
E + shoot (fire) Makes SHIP fire to X,Y.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.