kaizige-utils 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.
@@ -0,0 +1,17 @@
1
+ # 忽略 python-for-agent 目录(课程资料,本地单独管理)
2
+ 1_python_core/python-for-agent/
3
+
4
+ # macOS
5
+ .DS_Store
6
+
7
+ # Python
8
+ __pycache__/
9
+ *.py[cod]
10
+ *.egg-info/
11
+ .venv/
12
+ venv/
13
+ .ipynb_checkpoints/
14
+
15
+ # IDE
16
+ .idea/
17
+ .vscode/
@@ -0,0 +1,34 @@
1
+ Metadata-Version: 2.5
2
+ Name: kaizige-utils
3
+ Version: 0.1.0
4
+ Summary: 一个提供加减乘除运算的 Python 工具库,用于学习构建、发布与安装
5
+ Requires-Python: >=3.9
6
+ Description-Content-Type: text/markdown
7
+
8
+ # kaizige-utils
9
+
10
+ 一个提供加减乘除运算的 Python 工具库,用于学习 Python 工程的构建、发布与安装。
11
+
12
+ ## 功能
13
+
14
+ - `add(a, b)` — 加法
15
+ - `sub(a, b)` — 减法
16
+ - `mul(a, b)` — 乘法
17
+ - `div(a, b)` — 除法(除数为 0 时抛出 `ZeroDivisionError`)
18
+
19
+ ## 安装
20
+
21
+ ```bash
22
+ pip install kaizige-utils
23
+ ```
24
+
25
+ ## 使用
26
+
27
+ ```python
28
+ from kaizige_utils import add, sub, mul, div
29
+
30
+ add(1, 2) # => 3
31
+ sub(5, 3) # => 2
32
+ mul(2, 3) # => 6
33
+ div(10, 4) # => 2.5
34
+ ```
@@ -0,0 +1,27 @@
1
+ # kaizige-utils
2
+
3
+ 一个提供加减乘除运算的 Python 工具库,用于学习 Python 工程的构建、发布与安装。
4
+
5
+ ## 功能
6
+
7
+ - `add(a, b)` — 加法
8
+ - `sub(a, b)` — 减法
9
+ - `mul(a, b)` — 乘法
10
+ - `div(a, b)` — 除法(除数为 0 时抛出 `ZeroDivisionError`)
11
+
12
+ ## 安装
13
+
14
+ ```bash
15
+ pip install kaizige-utils
16
+ ```
17
+
18
+ ## 使用
19
+
20
+ ```python
21
+ from kaizige_utils import add, sub, mul, div
22
+
23
+ add(1, 2) # => 3
24
+ sub(5, 3) # => 2
25
+ mul(2, 3) # => 6
26
+ div(10, 4) # => 2.5
27
+ ```
@@ -0,0 +1,19 @@
1
+ # pyproject.toml
2
+
3
+ [build-system] # 构建系统配置,指定构建工具和依赖
4
+ requires = ["hatchling"] # 依赖的后端构建工具
5
+ build-backend = "hatchling.build" # 使用哪个工具的哪个模块来构建项目
6
+
7
+ [project] # 工程描述
8
+ name = "kaizige-utils" # 发行版名称
9
+ version = "0.1.0" # 版本号,遵循语义化版本控制
10
+ description = "一个提供加减乘除运算的 Python 工具库,用于学习构建、发布与安装" # 项目简介
11
+ requires-python = ">=3.9" # 指定支持的 Python 版本
12
+ readme = "README.md" # 指定项目的 README 文件路径
13
+ dependencies = [] # 本项目没有第三方依赖
14
+
15
+ [tool.hatch.build.targets.sdist] # 配置源代码分发包
16
+ # 配置留空,表示它会默认包含所有项目文件
17
+
18
+ [tool.hatch.build.targets.wheel] # 配置 wheel 包
19
+ packages = ["src/kaizige_utils"] # 指定要打进 wheel 的包目录
@@ -0,0 +1,3 @@
1
+ from kaizige_utils.calc import add, sub, mul, div
2
+
3
+ __all__ = ["add", "sub", "mul", "div"]
@@ -0,0 +1,18 @@
1
+ def add(a: float, b: float) -> float:
2
+ """加法"""
3
+ return a + b
4
+
5
+
6
+ def sub(a: float, b: float) -> float:
7
+ """减法"""
8
+ return a - b
9
+
10
+
11
+ def mul(a: float, b: float) -> float:
12
+ """乘法"""
13
+ return a * b
14
+
15
+
16
+ def div(a: float, b: float) -> float:
17
+ """除法,除数为 0 时抛出 ZeroDivisionError"""
18
+ return a / b