Skip to content

Commit

Permalink
adding structure to project
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgift committed Oct 8, 2020
1 parent 4435412 commit 015c9f4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 19 deletions.
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
setup:
python3 -m venv ~/.myrepo

install:
pip install --upgrade pip &&\
pip install -r requirements.txt

test:
#python -m pytest test_gcli.py
python -m pytest -vv --cov=gcli test_gcli.py
python -m pytest -vv --cov=helloclick test_helloclick.py
#python -m pytest --nbval notebook.ipynb


lint:
pylint --disable=R,C gcli.py hello-click.py
pylint --disable=R,C,E1120 helloclick.py

all: install lint test
13 changes: 0 additions & 13 deletions hello-click.py

This file was deleted.

15 changes: 15 additions & 0 deletions helloclick.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import click

#var=

@click.command()
@click.option("--phrase", prompt="Enter a phrase",
help="Phase in a phrase to tokenize: i.e. The Whale is large")
def tokenize(phrase):
"""This is a commandline tool that tokenizes phrases"""

click.echo(f"tokenized phrase: {phrase.split()}")

if __name__ == "__main__":
tokenize()

8 changes: 8 additions & 0 deletions test_helloclick.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from click.testing import CliRunner
from helloclick import tokenize

def test_helloclick():
runner = CliRunner()
result = runner.invoke(tokenize, ['--phrase', 'The Whale is large'])
assert result.exit_code == 0
assert 'Whale' in result.output

0 comments on commit 015c9f4

Please sign in to comment.