diff --git a/.cookiecutterrc b/.cookiecutterrc index 23f5bc9d..bf74d45e 100644 --- a/.cookiecutterrc +++ b/.cookiecutterrc @@ -1,7 +1,6 @@ # Generated by cookiepatcher, a small shim around cookiecutter (pip install cookiepatcher) default_context: - c_extension_module: _nameless c_extension_optional: 'yes' c_extension_support: 'no' codacy: 'no' @@ -15,6 +14,7 @@ default_context: email: contact@ionelmc.ro formatter_quote_style: double full_name: Ionel Cristian Mărieș + function_name: compute github_actions: 'yes' github_actions_osx: 'yes' github_actions_windows: 'yes' diff --git a/docs/usage.rst b/docs/usage.rst index fb7ad6aa..9047e801 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -2,6 +2,9 @@ Usage ===== -To use Nameless in a project:: +To use the project: - import nameless +.. code-block:: python + + import nameless + nameless.compute(...) diff --git a/src/nameless/__init__.py b/src/nameless/__init__.py index 9553db54..693f041b 100644 --- a/src/nameless/__init__.py +++ b/src/nameless/__init__.py @@ -1,7 +1,7 @@ __version__ = "0.1.0" -from .core import main +from .core import compute __all__ = [ - "main", + "compute", ] diff --git a/src/nameless/cli.py b/src/nameless/cli.py index fd02a154..65583b3d 100644 --- a/src/nameless/cli.py +++ b/src/nameless/cli.py @@ -17,10 +17,10 @@ import click -from .core import main +from .core import compute @click.command() @click.argument("names", nargs=-1) def run(names): - click.echo(main(names)) + click.echo(compute(names)) diff --git a/src/nameless/core.py b/src/nameless/core.py index b3d97ad0..c025c8b5 100644 --- a/src/nameless/core.py +++ b/src/nameless/core.py @@ -1,2 +1,2 @@ -def main(args): +def compute(args): return max(args, key=len) diff --git a/src/nameless/tests/test_core.py b/src/nameless/tests/test_core.py index caa17d1b..90e2c6e1 100644 --- a/src/nameless/tests/test_core.py +++ b/src/nameless/tests/test_core.py @@ -1,5 +1,5 @@ -from .. import main +from .. import compute -def test_main(): - assert main([b"a", b"bc", b"abc"]) == b"abc" +def test_compute(): + assert compute([b"a", b"bc", b"abc"]) == b"abc" diff --git a/tox.ini b/tox.ini index 6b7454a0..d05a4dc7 100644 --- a/tox.ini +++ b/tox.ini @@ -73,7 +73,9 @@ commands = coverage html [testenv:clean] -commands = coverage erase +commands = + python setup.py clean + coverage erase skip_install = true deps = coverage