sdk369 0.0.1__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.
- sdk369-0.0.1/LICENSE +21 -0
- sdk369-0.0.1/PKG-INFO +98 -0
- sdk369-0.0.1/README.md +79 -0
- sdk369-0.0.1/pyproject.toml +39 -0
- sdk369-0.0.1/setup.cfg +4 -0
- sdk369-0.0.1/src/sdk369/__init__.py +26 -0
- sdk369-0.0.1/src/sdk369/__main__.py +34 -0
- sdk369-0.0.1/src/sdk369/py.typed +0 -0
- sdk369-0.0.1/src/sdk369.egg-info/PKG-INFO +98 -0
- sdk369-0.0.1/src/sdk369.egg-info/SOURCES.txt +12 -0
- sdk369-0.0.1/src/sdk369.egg-info/dependency_links.txt +1 -0
- sdk369-0.0.1/src/sdk369.egg-info/entry_points.txt +2 -0
- sdk369-0.0.1/src/sdk369.egg-info/top_level.txt +1 -0
- sdk369-0.0.1/tests/test_smoke.py +26 -0
sdk369-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sdk369 contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sdk369-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sdk369
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: sdk369 - a minimal, dependency-free Python package.
|
|
5
|
+
Author: sdk369 maintainers
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: sdk369
|
|
8
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# sdk369
|
|
21
|
+
|
|
22
|
+
一个最小化、零依赖的 Python 包,已发布到 PyPI。
|
|
23
|
+
|
|
24
|
+
- 版本:0.0.1(Pre-Alpha)
|
|
25
|
+
- 依赖:无
|
|
26
|
+
- 支持:Python >= 3.9
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install sdk369
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> 名称说明:PyPI 会把 `sdk369`、`sdk-369`、`SDK369`、`sdk_369` 统统归一化成同一个项目名,
|
|
33
|
+
> 所以占住 `sdk369` 等于把这几种写法一起占了。
|
|
34
|
+
|
|
35
|
+
## 为什么不做纯空包?
|
|
36
|
+
|
|
37
|
+
PyPI 官方策略把「空包占名」列为无效项目:
|
|
38
|
+
|
|
39
|
+
> **Invalid projects** … project is name squatting (**package has no functionality or is empty**) …
|
|
40
|
+
> 这类项目会被直接从索引中移除。
|
|
41
|
+
> —— <https://docs.pypi.org/project-management/name-retention/>
|
|
42
|
+
|
|
43
|
+
所以这里的做法是:保持体积最小的同时让它是一个真实可用的包——
|
|
44
|
+
能 import、有公开 API、有命令行入口、有测试,不落进 "no functionality or is empty" 的判定。
|
|
45
|
+
|
|
46
|
+
## 发布前先改这几处
|
|
47
|
+
|
|
48
|
+
1. `pyproject.toml` 里的 `description`、`authors`,以及被注释掉的 `[project.urls]`(填仓库地址)。
|
|
49
|
+
2. `LICENSE` 里的版权主体。
|
|
50
|
+
3. `README.md` 改成你项目真正的内容。
|
|
51
|
+
|
|
52
|
+
## 本地安装与使用
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python -m pip install -e .
|
|
56
|
+
python -m sdk369 # 打印包信息(JSON)
|
|
57
|
+
python -m sdk369 --version
|
|
58
|
+
sdk369 # console script
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
跑测试:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python -m pip install pytest
|
|
65
|
+
python -m pytest -q
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 发布新版本
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python -m pip install --upgrade build twine
|
|
72
|
+
rm -rf dist build src/*.egg-info
|
|
73
|
+
# 先把 pyproject.toml 里的 version 改成 0.0.2 之类的新版本号
|
|
74
|
+
python -m build
|
|
75
|
+
python -m twine check dist/*
|
|
76
|
+
TWINE_USERNAME=__token__ TWINE_PASSWORD='pypi-你的token' python -m twine upload dist/*
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
> PyPI 上的版本号**只前进、不可复用**,同一个版本号删除后也无法重传。
|
|
80
|
+
|
|
81
|
+
## 目录结构
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
sdk369/
|
|
85
|
+
├─ pyproject.toml # 包元数据 + 构建配置
|
|
86
|
+
├─ README.md # 本文件(即 PyPI 项目页正文)
|
|
87
|
+
├─ LICENSE # MIT
|
|
88
|
+
├─ .gitignore
|
|
89
|
+
├─ src/sdk369/
|
|
90
|
+
│ ├─ __init__.py # 公开 API:__version__ / info()
|
|
91
|
+
│ ├─ __main__.py # CLI 入口
|
|
92
|
+
│ └─ py.typed # 声明带类型标注
|
|
93
|
+
└─ tests/test_smoke.py
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT
|
sdk369-0.0.1/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# sdk369
|
|
2
|
+
|
|
3
|
+
一个最小化、零依赖的 Python 包,已发布到 PyPI。
|
|
4
|
+
|
|
5
|
+
- 版本:0.0.1(Pre-Alpha)
|
|
6
|
+
- 依赖:无
|
|
7
|
+
- 支持:Python >= 3.9
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install sdk369
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> 名称说明:PyPI 会把 `sdk369`、`sdk-369`、`SDK369`、`sdk_369` 统统归一化成同一个项目名,
|
|
14
|
+
> 所以占住 `sdk369` 等于把这几种写法一起占了。
|
|
15
|
+
|
|
16
|
+
## 为什么不做纯空包?
|
|
17
|
+
|
|
18
|
+
PyPI 官方策略把「空包占名」列为无效项目:
|
|
19
|
+
|
|
20
|
+
> **Invalid projects** … project is name squatting (**package has no functionality or is empty**) …
|
|
21
|
+
> 这类项目会被直接从索引中移除。
|
|
22
|
+
> —— <https://docs.pypi.org/project-management/name-retention/>
|
|
23
|
+
|
|
24
|
+
所以这里的做法是:保持体积最小的同时让它是一个真实可用的包——
|
|
25
|
+
能 import、有公开 API、有命令行入口、有测试,不落进 "no functionality or is empty" 的判定。
|
|
26
|
+
|
|
27
|
+
## 发布前先改这几处
|
|
28
|
+
|
|
29
|
+
1. `pyproject.toml` 里的 `description`、`authors`,以及被注释掉的 `[project.urls]`(填仓库地址)。
|
|
30
|
+
2. `LICENSE` 里的版权主体。
|
|
31
|
+
3. `README.md` 改成你项目真正的内容。
|
|
32
|
+
|
|
33
|
+
## 本地安装与使用
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python -m pip install -e .
|
|
37
|
+
python -m sdk369 # 打印包信息(JSON)
|
|
38
|
+
python -m sdk369 --version
|
|
39
|
+
sdk369 # console script
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
跑测试:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
python -m pip install pytest
|
|
46
|
+
python -m pytest -q
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 发布新版本
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
python -m pip install --upgrade build twine
|
|
53
|
+
rm -rf dist build src/*.egg-info
|
|
54
|
+
# 先把 pyproject.toml 里的 version 改成 0.0.2 之类的新版本号
|
|
55
|
+
python -m build
|
|
56
|
+
python -m twine check dist/*
|
|
57
|
+
TWINE_USERNAME=__token__ TWINE_PASSWORD='pypi-你的token' python -m twine upload dist/*
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> PyPI 上的版本号**只前进、不可复用**,同一个版本号删除后也无法重传。
|
|
61
|
+
|
|
62
|
+
## 目录结构
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
sdk369/
|
|
66
|
+
├─ pyproject.toml # 包元数据 + 构建配置
|
|
67
|
+
├─ README.md # 本文件(即 PyPI 项目页正文)
|
|
68
|
+
├─ LICENSE # MIT
|
|
69
|
+
├─ .gitignore
|
|
70
|
+
├─ src/sdk369/
|
|
71
|
+
│ ├─ __init__.py # 公开 API:__version__ / info()
|
|
72
|
+
│ ├─ __main__.py # CLI 入口
|
|
73
|
+
│ └─ py.typed # 声明带类型标注
|
|
74
|
+
└─ tests/test_smoke.py
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sdk369"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "sdk369 - a minimal, dependency-free Python package."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "sdk369 maintainers" }]
|
|
14
|
+
keywords = ["sdk369"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
22
|
+
"Typing :: Typed",
|
|
23
|
+
]
|
|
24
|
+
dependencies = []
|
|
25
|
+
|
|
26
|
+
# TODO: 填上仓库地址后再取消注释(PyPI 项目页侧边栏会显示)
|
|
27
|
+
# [project.urls]
|
|
28
|
+
# Homepage = "https://github.com/<you>/sdk369"
|
|
29
|
+
# Repository = "https://github.com/<you>/sdk369"
|
|
30
|
+
# "Bug Tracker" = "https://github.com/<you>/sdk369/issues"
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
sdk369 = "sdk369.__main__:main"
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
where = ["src"]
|
|
37
|
+
|
|
38
|
+
[tool.setuptools.package-data]
|
|
39
|
+
sdk369 = ["py.typed"]
|
sdk369-0.0.1/setup.cfg
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""sdk369 - a minimal, dependency-free Python package.
|
|
2
|
+
|
|
3
|
+
Intentionally tiny but *real*: it imports, exposes a documented API, ships a
|
|
4
|
+
console script, and has tests. See "为什么不做纯空包" in README.md.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
__all__ = ["__version__", "info"]
|
|
10
|
+
|
|
11
|
+
__version__ = "0.0.1"
|
|
12
|
+
|
|
13
|
+
_SUMMARY = "sdk369 - a minimal, dependency-free Python package."
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def info() -> dict[str, str]:
|
|
17
|
+
"""Return basic metadata about this package as a plain dict.
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
A dict with the keys ``name``, ``version`` and ``summary``.
|
|
21
|
+
"""
|
|
22
|
+
return {
|
|
23
|
+
"name": "sdk369",
|
|
24
|
+
"version": __version__,
|
|
25
|
+
"summary": _SUMMARY,
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Command line entry point: ``python -m sdk369`` / ``sdk369``."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
from . import __version__, info
|
|
9
|
+
|
|
10
|
+
USAGE = "usage: sdk369 [-h | --version]"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def main(argv: list[str] | None = None) -> int:
|
|
14
|
+
"""Run the CLI. Returns a process exit code."""
|
|
15
|
+
args = list(sys.argv[1:] if argv is None else argv)
|
|
16
|
+
|
|
17
|
+
if args:
|
|
18
|
+
flag = args[0]
|
|
19
|
+
if flag in {"-h", "--help"}:
|
|
20
|
+
print(USAGE)
|
|
21
|
+
return 0
|
|
22
|
+
if flag in {"-V", "--version"}:
|
|
23
|
+
print(__version__)
|
|
24
|
+
return 0
|
|
25
|
+
print(f"sdk369: unrecognized argument: {flag}", file=sys.stderr)
|
|
26
|
+
print(USAGE, file=sys.stderr)
|
|
27
|
+
return 2
|
|
28
|
+
|
|
29
|
+
print(json.dumps(info(), indent=2, ensure_ascii=False))
|
|
30
|
+
return 0
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == "__main__":
|
|
34
|
+
raise SystemExit(main())
|
|
File without changes
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sdk369
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: sdk369 - a minimal, dependency-free Python package.
|
|
5
|
+
Author: sdk369 maintainers
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: sdk369
|
|
8
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# sdk369
|
|
21
|
+
|
|
22
|
+
一个最小化、零依赖的 Python 包,已发布到 PyPI。
|
|
23
|
+
|
|
24
|
+
- 版本:0.0.1(Pre-Alpha)
|
|
25
|
+
- 依赖:无
|
|
26
|
+
- 支持:Python >= 3.9
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install sdk369
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
> 名称说明:PyPI 会把 `sdk369`、`sdk-369`、`SDK369`、`sdk_369` 统统归一化成同一个项目名,
|
|
33
|
+
> 所以占住 `sdk369` 等于把这几种写法一起占了。
|
|
34
|
+
|
|
35
|
+
## 为什么不做纯空包?
|
|
36
|
+
|
|
37
|
+
PyPI 官方策略把「空包占名」列为无效项目:
|
|
38
|
+
|
|
39
|
+
> **Invalid projects** … project is name squatting (**package has no functionality or is empty**) …
|
|
40
|
+
> 这类项目会被直接从索引中移除。
|
|
41
|
+
> —— <https://docs.pypi.org/project-management/name-retention/>
|
|
42
|
+
|
|
43
|
+
所以这里的做法是:保持体积最小的同时让它是一个真实可用的包——
|
|
44
|
+
能 import、有公开 API、有命令行入口、有测试,不落进 "no functionality or is empty" 的判定。
|
|
45
|
+
|
|
46
|
+
## 发布前先改这几处
|
|
47
|
+
|
|
48
|
+
1. `pyproject.toml` 里的 `description`、`authors`,以及被注释掉的 `[project.urls]`(填仓库地址)。
|
|
49
|
+
2. `LICENSE` 里的版权主体。
|
|
50
|
+
3. `README.md` 改成你项目真正的内容。
|
|
51
|
+
|
|
52
|
+
## 本地安装与使用
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python -m pip install -e .
|
|
56
|
+
python -m sdk369 # 打印包信息(JSON)
|
|
57
|
+
python -m sdk369 --version
|
|
58
|
+
sdk369 # console script
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
跑测试:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
python -m pip install pytest
|
|
65
|
+
python -m pytest -q
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 发布新版本
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python -m pip install --upgrade build twine
|
|
72
|
+
rm -rf dist build src/*.egg-info
|
|
73
|
+
# 先把 pyproject.toml 里的 version 改成 0.0.2 之类的新版本号
|
|
74
|
+
python -m build
|
|
75
|
+
python -m twine check dist/*
|
|
76
|
+
TWINE_USERNAME=__token__ TWINE_PASSWORD='pypi-你的token' python -m twine upload dist/*
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
> PyPI 上的版本号**只前进、不可复用**,同一个版本号删除后也无法重传。
|
|
80
|
+
|
|
81
|
+
## 目录结构
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
sdk369/
|
|
85
|
+
├─ pyproject.toml # 包元数据 + 构建配置
|
|
86
|
+
├─ README.md # 本文件(即 PyPI 项目页正文)
|
|
87
|
+
├─ LICENSE # MIT
|
|
88
|
+
├─ .gitignore
|
|
89
|
+
├─ src/sdk369/
|
|
90
|
+
│ ├─ __init__.py # 公开 API:__version__ / info()
|
|
91
|
+
│ ├─ __main__.py # CLI 入口
|
|
92
|
+
│ └─ py.typed # 声明带类型标注
|
|
93
|
+
└─ tests/test_smoke.py
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/sdk369/__init__.py
|
|
5
|
+
src/sdk369/__main__.py
|
|
6
|
+
src/sdk369/py.typed
|
|
7
|
+
src/sdk369.egg-info/PKG-INFO
|
|
8
|
+
src/sdk369.egg-info/SOURCES.txt
|
|
9
|
+
src/sdk369.egg-info/dependency_links.txt
|
|
10
|
+
src/sdk369.egg-info/entry_points.txt
|
|
11
|
+
src/sdk369.egg-info/top_level.txt
|
|
12
|
+
tests/test_smoke.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
sdk369
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
from sdk369 import __version__, info
|
|
4
|
+
from sdk369.__main__ import main
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_info_matches_version():
|
|
8
|
+
data = info()
|
|
9
|
+
assert data["name"] == "sdk369"
|
|
10
|
+
assert data["version"] == __version__
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_cli_version(capsys):
|
|
14
|
+
assert main(["--version"]) == 0
|
|
15
|
+
assert capsys.readouterr().out.strip() == __version__
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def test_cli_default_prints_json(capsys):
|
|
19
|
+
assert main([]) == 0
|
|
20
|
+
payload = json.loads(capsys.readouterr().out)
|
|
21
|
+
assert payload["name"] == "sdk369"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_cli_rejects_unknown_flag(capsys):
|
|
25
|
+
assert main(["--nope"]) == 2
|
|
26
|
+
assert "unrecognized" in capsys.readouterr().err
|