yifan 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
yifan-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,17 @@
1
+ Metadata-Version: 2.4
2
+ Name: yifan
3
+ Version: 0.1.0
4
+ Summary: A tiny cow-printing CLI.
5
+ Project-URL: Repository, https://github.com/sudo-yf/yifan
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+
9
+ # yifan
10
+
11
+ A tiny CLI that prints a cow.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ uvx yifan
17
+ ```
yifan-0.1.0/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # yifan
2
+
3
+ A tiny CLI that prints a cow.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ uvx yifan
9
+ ```
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27.0"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "yifan"
7
+ version = "0.1.0"
8
+ description = "A tiny cow-printing CLI."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ dependencies = []
12
+
13
+ [project.scripts]
14
+ yifan = "yifan.cli:main"
15
+
16
+ [project.urls]
17
+ Repository = "https://github.com/sudo-yf/yifan"
18
+
19
+ [tool.hatch.build.targets.wheel]
20
+ packages = ["src/yifan"]
21
+
22
+ [tool.hatch.build.targets.sdist]
23
+ include = [
24
+ "/README.md",
25
+ "/pyproject.toml",
26
+ "/src/yifan/__init__.py",
27
+ "/src/yifan/__main__.py",
28
+ "/src/yifan/cli.py",
29
+ ]
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ from .cli import main
2
+
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())
@@ -0,0 +1,31 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+ from typing import Optional, Sequence
5
+
6
+ from . import __version__
7
+
8
+
9
+ def render_cow(message: str) -> str:
10
+ width = len(message)
11
+ top = " " + "_" * (width + 2)
12
+ middle = f"< {message} >"
13
+ bottom = " " + "-" * (width + 2)
14
+ cow = r""" \ ^__^
15
+ \ (oo)\_______
16
+ (__)\ )\/\
17
+ ||----w |
18
+ || ||"""
19
+ return "\n".join([top, middle, bottom, cow])
20
+
21
+
22
+ def main(argv: Optional[Sequence[str]] = None) -> int:
23
+ args = list(sys.argv[1:] if argv is None else argv)
24
+
25
+ if args and args[0] in {"-V", "--version", "version"}:
26
+ print(__version__)
27
+ return 0
28
+
29
+ message = "yifan"
30
+ print(render_cow(message))
31
+ return 0