Skip to content

Commit c8fcef3

Browse files
Merge pull request #23 from MichaelisTrofficus/bump-to-0.0.5
Bump to 0.0.5
2 parents 521c9ab + 9adfd9e commit c8fcef3

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "gpt4docstrings"
3-
version = "0.0.4"
3+
version = "0.0.5"
44
description = "gpt4docstrings"
55
authors = ["Miguel Otero Pedrido <miguel.otero.pedrido.1993@gmail.com>"]
66
license = "MIT"
@@ -9,7 +9,7 @@ homepage = "https://github.com/MichaelisTrofficus/gpt4docstrings"
99
repository = "https://github.com/MichaelisTrofficus/gpt4docstrings"
1010
documentation = "https://gpt4docstrings.readthedocs.io"
1111
classifiers = [
12-
"Development Status :: 1 - Planning",
12+
"Development Status :: 3 - Alpha",
1313
]
1414

1515
[tool.poetry.urls]

src/gpt4docstrings/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ def main(paths, **kwargs):
5858
model=kwargs["model"],
5959
api_key=kwargs["api_key"],
6060
)
61-
docstrings_generator.generate_docstrings()
61+
filenames = docstrings_generator.generate_docstrings()
62+
print(filenames)

src/gpt4docstrings/generate_docstrings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def get_filenames_from_paths(self) -> List[str]:
6262
if os.path.isfile(path):
6363
if not path.endswith(".py"):
6464
return sys.exit(1)
65-
filenames.append(path)
65+
66+
if not any(fnmatch(path, exc + "*") for exc in self.excluded):
67+
filenames.append(path)
68+
6669
continue
6770

6871
for root, _, fs in os.walk(path):
@@ -126,3 +129,4 @@ def generate_docstrings(self):
126129
"""Generates docstrings for undocumented classes / functions"""
127130
filenames = self.get_filenames_from_paths()
128131
self._generate_docstrings(filenames)
132+
return filenames

tests/test_find_filenames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_find_all_functions(test_openai_api_key):
1919
def test_exclude_functions(test_openai_api_key):
2020
docstrings_generator = GPT4Docstrings(
2121
paths=[os.path.join(pytest.TESTS_PATH, "resources")],
22-
excluded=[os.path.join(pytest.TESTS_PATH, "resources/package_1/*")],
22+
excluded=[os.path.join(pytest.TESTS_PATH, "resources/package_1/module_2.py")],
2323
)
2424
py_files = docstrings_generator.get_filenames_from_paths()
2525
assert set(py_files) == {f"{pytest.TESTS_PATH}/resources/module_1.py"}

0 commit comments

Comments
 (0)