Skip to content

Commit aff72ce

Browse files
authored
Rolled Back Python Version Requirement to 3.8 (#25)
* Created a test file * Added documentation * Added some type hints * Added some docs * Incremented version
1 parent e77a4ad commit aff72ce

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[tool.poetry]
33
name = "ronbun"
44
description = "The Sample Programs README Automation Tool"
5-
version = "0.7.3"
5+
version = "0.7.4"
66
license = "MIT"
77

88
authors = [
@@ -21,7 +21,7 @@ classifiers=[
2121
]
2222

2323
[tool.poetry.dependencies]
24-
python = "^3.11"
24+
python = "^3.8"
2525
snakemd = "^2.2.0b1"
2626
subete = "^0.16"
2727

ronbun/readme.py

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616

1717
def main():
18+
"""
19+
The main drop in script for the README generation.
20+
"""
1821
ssl._create_default_https_context = ssl._create_unverified_context
1922
args = _get_args()
2023
numeric_level = getattr(logging, args[1].upper(), None)
@@ -31,6 +34,7 @@ def _get_args() -> tuple:
3134
"""
3235
A helper function which gets the log level from
3336
the command line. Set as warning from default.
37+
3438
:return: the log level provided by the user
3539
"""
3640
parser = argparse.ArgumentParser()
@@ -49,6 +53,12 @@ def _get_args() -> tuple:
4953

5054

5155
def _get_intro_text(language: LanguageCollection) -> Paragraph:
56+
"""
57+
Generates the test for the introduction of the README.
58+
59+
:param language: the language to generate from the LanguageCollection
60+
:return: the introduction paragraph in the README
61+
"""
5262
paragraph = Paragraph([f"Welcome to Sample Programs in {language}! "])
5363
text = Inline("here.", link=language.lang_docs_url())
5464
if language.has_docs:
@@ -60,6 +70,7 @@ def _get_intro_text(language: LanguageCollection) -> Paragraph:
6070
def _generate_program_list(language: LanguageCollection) -> list:
6171
"""
6272
A helper function which generates a list of programs for the README.
73+
6374
:param language: a language collection
6475
:return: a list of sample programs list items
6576
"""
@@ -76,8 +87,15 @@ def _generate_program_list(language: LanguageCollection) -> list:
7687
return list_items
7788

7889

79-
def _generate_missing_program_list(language: LanguageCollection, missing_programs: list[str]):
80-
list_items = list()
90+
def _generate_missing_program_list(language: LanguageCollection, missing_programs: list[str]) -> list[Paragraph]:
91+
"""
92+
Generates the list of programs that are missing in Markdown.
93+
94+
:param language: the language with missing programs
95+
:param missing_programs: the list of programs missing from the language collection
96+
:return: the missing programs lines as Markdown strings
97+
"""
98+
list_items: list[Paragraph] = list()
8199
missing_programs.sort(key=lambda x: x.name())
82100
for program in missing_programs:
83101
program: Project
@@ -106,15 +124,22 @@ def _generate_credit() -> Paragraph:
106124
return p
107125

108126

109-
def _generate_program_list_header(program_count: int, total_program_count: int):
127+
def _generate_program_list_header(program_count: int, total_program_count: int) -> str:
128+
"""
129+
Creates the heading test for the programs list.
130+
131+
:param program_count: the number of programs completed in the language
132+
:param total_program_count: the total number of possible programs
133+
:return: the heading about the program list
134+
"""
110135
i = int(((program_count / total_program_count) * 4))
111136
emojis = [":disappointed:", ":thinking:", ":relaxed:", ":smile:", ":partying_face:"]
112137
return f"Sample Programs List - {program_count}/{total_program_count} {emojis[i]}"
113138

114139

115140
class ReadMeCatalog:
116141
"""
117-
An representation of the collection of READMEs in the Sample Programs repo.
142+
A representation of the collection of READMEs in the Sample Programs repo.
118143
"""
119144

120145
def __init__(self, repo: Repo):

0 commit comments

Comments
 (0)