Repository: cmpsc-481-s22-m1/PyPiCounter (language: python)

Issue:
Rename Main Package
Currently the name of our main package is src, but in order to make the program more user friendly we should change it to the name of the acutal program.

The DS_store is in a bad place in the code, we should either place it in a user-level git-ignore or project-level git-ignore


Discussion / hints:

Fix patch:
diff --git a/README.md b/README.md
index a146db1..6b99280 100644
--- a/README.md
+++ b/README.md
@@ -79,6 +79,7 @@ Sample Output:
 
 ```python
 # of functions with docstrings: 1
+```
 
 ## Help and Bug Fixes
 
diff --git a/src/.gitkeep b/pypi_count/.gitkeep
similarity index 100%
rename from src/.gitkeep
rename to pypi_count/.gitkeep
diff --git a/src/__init__.py b/pypi_count/__init__.py
similarity index 100%
rename from src/__init__.py
rename to pypi_count/__init__.py
diff --git a/src/command_line_interface.py b/pypi_count/command_line_interface.py
similarity index 98%
rename from src/command_line_interface.py
rename to pypi_count/command_line_interface.py
index afa2661..ca50445 100644
--- a/src/command_line_interface.py
+++ b/pypi_count/command_line_interface.py
@@ -6,7 +6,7 @@
 
 import typer
 
-from src.py_counter import PyCount
+from pypi_count.py_counter import PyCount
 
 cli = typer.Typer()
 
diff --git a/src/py_counter.py b/pypi_count/py_counter.py
similarity index 100%
rename from src/py_counter.py
rename to pypi_count/py_counter.py
diff --git a/pyproject.toml b/pyproject.toml
index a8dccf1..46b2733 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,12 +5,12 @@ description = "A counting program used for different Python packages and modules
 authors = ["Adriana Solis <solisa@allegheny.edu>, Alexis Caldwell <caldwella2@allegheny.edu>, Rachael Harris <harrisr@allegheny.edu>, Ramon Guzman <guzmanr@allegheny.edu>, Ryan Hilty <hiltyr@allegheny.edu>"]
 license = "MIT"
 packages = [
-    { include = "src" },
-    { include = "tests" }
+    { include = "py_counter.py", from="pypi_count" },
+    { include = "pypi_count/py_counter.py"},
 ]
 
 [tool.poetry.scripts]
-pypicount = "src.command_line_interface:cli"
+pypicount = "pypi_count.command_line_interface:cli"
 
 [tool.poetry.dependencies]
 python = ">=3.7,<4.0"
@@ -26,8 +26,8 @@ pylint = "^2.12.2"
 black = "^21.12b0"
 
 [tool.taskipy.tasks]
-test = "pytest --cov-report term-missing --cov-fail-under=70  --cov-branch --cov=src tests/"
-lint = "pylint tests/ src/"
+test = "pytest --cov-report term-missing --cov-fail-under=70  --cov-branch --cov=pypi_count tests/"
+lint = "pylint tests/ pypi_count/"
 
 [build-system]
 requires = ["poetry-core>=1.0.0"]
diff --git a/setup.py b/setup.py
index d6d4700..26f2eaa 100644
--- a/setup.py
+++ b/setup.py
@@ -14,8 +14,8 @@ def read(fname):
     description = ("A python program to count the number of instances of different specifications."),
     license = "MIT",
     keywords = "python counter",
-    url = "https://github.com/cmpsc-481-s22-m1/PyCount",
-    packages=['PyCount', 'tests'],
+    url = "https://github.com/cmpsc-481-s22-m1/PyPiCount",
+    packages=['PyPiCount', 'tests'],
     long_description=read('README'),
     classifiers=[
         "Development Status :: 3 - Alpha",


Test patch:
diff --git a/tests/test_command_line_interface.py b/tests/test_command_line_interface.py
index f7fbbea..7bf8a17 100644
--- a/tests/test_command_line_interface.py
+++ b/tests/test_command_line_interface.py
@@ -1,68 +1,80 @@
 """Test cases for the command line interface."""
 from typer.testing import CliRunner
 
-from src.command_line_interface import cli
-
+from pypi_count.command_line_interface import cli
 
 cli_runner = CliRunner()
 
 
 def test_main_class():
     """Test case to see if class argument is correct."""
-    class_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--class_def"]) # pylint: disable=C0301
+    class_result = cli_runner.invoke(cli, ["--input-file", \
+                                           "input/sample_file.py", "--class_def"])
     assert class_result.exit_code == 0
     assert "2" in class_result.stdout
 
 
 def test_main_imports():
     """Test case to see if import argument is correct."""
-    import_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--import_statements"]) # pylint: disable=C0301
+    import_result = cli_runner.invoke(cli, ["--input-file", \
+                                            "input/sample_file.py", "--import_statements"])
     assert import_result.exit_code == 0
     assert "2" in import_result.stdout
 
 
 def test_main_comment():
     """Test case to see if comment argument is correct."""
-    comment_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--comment"]) # pylint: disable=C0301
+    comment_result = cli_runner.invoke(cli, ["--input-file", \
+                                             "input/sample_file.py", "--comment"])
     assert comment_result.exit_code == 0
-    assert "14" in comment_result.stdout
+    assert "9" in comment_result.stdout
 
 
 def test_main_function_def():
     """Test case to see if function definition argument is correct."""
-    function_def_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--function_def"]) # pylint: disable=C0301
+    function_def_result = cli_runner.invoke(cli, ["--input-file", \
+                                                  "input/sample_file.py", "--function_def"])
     assert function_def_result.exit_code == 0
     assert "6" in function_def_result.stdout
 
 
 def test_main_function_without_docstrings():
     """Test case to see if function without docstrings argument is correct."""
-    func_wo_docstr_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--function_without_docstrings"]) # pylint: disable=C0301
+    func_wo_docstr_result = cli_runner.invoke(cli, ["--input-file", \
+                                                    "input/sample_file.py", \
+                                                    "--function_without_docstrings"])
     assert func_wo_docstr_result.exit_code == 0
     assert "3" in func_wo_docstr_result.stdout
 
 
 def test_main_function_with_docstrings():
     """Test case to see if function without docstrings argument is correct."""
-    func_w_docstr_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--function_with_docstrings"]) # pylint: disable=C0301
+    func_w_docstr_result = cli_runner.invoke(cli, ["--input-file", \
+                                                   "input/sample_file.py", \
+                                                   "--function_with_docstrings"])
     assert func_w_docstr_result.exit_code == 0
     assert "3" in func_w_docstr_result.stdout
 
 
 def test_main_class_without_docstrings():
     """Test case to see if class without docstrings argument is correct."""
-    class_wo_docstr_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--class_without_docstrings"]) # pylint: disable=C0301
+    class_wo_docstr_result = cli_runner.invoke(cli, ["--input-file", \
+                                                     "input/sample_file.py", \
+                                                     "--class_without_docstrings"])
     assert class_wo_docstr_result.exit_code == 0
     assert "1" in class_wo_docstr_result.stdout
 
 def test_main_class_with_docstrings():
     """Test case to see if class with docstrings argument is correct."""
-    class_w_docstr_result = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--class_with_docstrings"]) # pylint: disable=C0301
+    class_w_docstr_result = cli_runner.invoke(cli, ["--input-file", \
+                                                    "input/sample_file.py", \
+                                                    "--class_with_docstrings"])
     assert class_w_docstr_result.exit_code == 0
     assert "1" in class_w_docstr_result.stdout
 
 def test_if_statements():
     """Test case to see if 'if statements' argument is correct."""
-    if_state = cli_runner.invoke(cli, ["--input-file", "tests/input/sample_file.py", "--if_statements"]) # pylint: disable=C0301
+    if_state = cli_runner.invoke(cli, ["--input-file", \
+                                       "input/sample_file.py", "--if_statements"])
     assert if_state.exit_code == 0
     assert "1" in if_state.stdout
diff --git a/tests/test_py_counter.py b/tests/test_py_counter.py
index 9a35116..e95413f 100644
--- a/tests/test_py_counter.py
+++ b/tests/test_py_counter.py
@@ -1,9 +1,9 @@
 """Test cases for py_counter method."""
 
-from src.py_counter import PyCount
+from pypi_count.py_counter import PyCount
 
 
-FILE = "tests/input/sample_file.py"
+FILE = "input/sample_file.py"
 test_pycount = PyCount(FILE)
 
 def test_count_class_defintions():
@@ -14,7 +14,7 @@ def test_count_class_defintions():
 
 def test_count_comments():
     """Test case for counting the class definitions."""
-    expected_comments = 14
+    expected_comments = 9
     assert test_pycount.count_comments() == expected_comments