Skip to content

Commit

Permalink
Up.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Mar 23, 2024
1 parent 335a4de commit 63ee16e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .cookiecutterrc
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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'
Expand Down
7 changes: 5 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Usage
=====

To use Nameless in a project::
To use the project:

import nameless
.. code-block:: python
import nameless
nameless.compute(...)
4 changes: 2 additions & 2 deletions src/nameless/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__version__ = "0.1.0"

from .core import main
from .core import compute

__all__ = [
"main",
"compute",
]
4 changes: 2 additions & 2 deletions src/nameless/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
2 changes: 1 addition & 1 deletion src/nameless/core.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
def main(args):
def compute(args):
return max(args, key=len)
6 changes: 3 additions & 3 deletions src/nameless/tests/test_core.py
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ commands =
coverage html

[testenv:clean]
commands = coverage erase
commands =
python setup.py clean
coverage erase
skip_install = true
deps =
coverage

0 comments on commit 63ee16e

Please sign in to comment.