Skip to content

Commit 97efd83

Browse files
committed
Add example rich dependency; refactor example script
1 parent d8e6f11 commit 97efd83

File tree

4 files changed

+44
-29
lines changed

4 files changed

+44
-29
lines changed

devcontainer_python/__main__.py

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,47 @@
11
#!/usr/bin/env python3
22

3+
from rich.console import Console
4+
from rich.panel import Panel
5+
from rich.text import Text
6+
37
from . import PACKAGE_NAME, PACKAGE_VERSION
4-
from .utils import square
58

69

710
def main() -> None:
8-
print(f"Hello from {PACKAGE_NAME} version {PACKAGE_VERSION}!")
9-
print("3 squared is:", square(3))
11+
console = Console()
12+
13+
welcome_message = Text.from_markup(
14+
f":tada: Hello from [bold cyan]{PACKAGE_NAME}[/bold cyan] version"
15+
f" [green]{PACKAGE_VERSION}[/green]! :sparkles:",
16+
justify="center",
17+
)
18+
19+
console.print(
20+
Panel(
21+
welcome_message,
22+
title="[bold]Welcome[/bold]",
23+
border_style="blue",
24+
padding=(1, 2),
25+
)
26+
)
27+
28+
console.print()
29+
30+
warning_message = (
31+
":bell: [bold]Don't forget to customize this template![/bold] :bell:"
32+
"\n\n"
33+
"Make sure to update project details and other metadata in the "
34+
"project configuration files (e.g., [bold]pyproject.toml[/bold])."
35+
)
36+
37+
console.print(
38+
Panel(
39+
Text.from_markup(warning_message, justify="center"),
40+
title="[bold yellow]Important Reminder[/bold yellow]",
41+
border_style="yellow",
42+
padding=(1, 2),
43+
)
44+
)
1045

1146

1247
if __name__ == "__main__":

devcontainer_python/utils.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

poetry.lock

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "MIT"
1111
readme = "README.md"
1212
dynamic = ["version", "classifiers"]
1313
requires-python = ">=3.10,<4.0"
14-
dependencies = []
14+
dependencies = ["rich (>=14.1.0,<15.0.0)"]
1515

1616
[project.urls]
1717
"GitHub" = "https://github.com/reznakt/devcontainer-python"

0 commit comments

Comments
 (0)