jiecheng-pkg 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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 QingZhe
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.
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: jiecheng-pkg
3
+ Version: 0.1.0
4
+ Summary: A tiny factorial toolkit for learning how to publish a package to PyPI (Experiment 3).
5
+ Author: QingZhe
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 QingZhe
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://example.com/jiecheng-pkg
29
+ Project-URL: Repository, https://example.com/jiecheng-pkg.git
30
+ Keywords: factorial,jiecheng,teaching,experiment
31
+ Classifier: Programming Language :: Python :: 3
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Operating System :: OS Independent
34
+ Requires-Python: >=3.9
35
+ Description-Content-Type: text/markdown
36
+ License-File: LICENSE
37
+ Dynamic: license-file
38
+
39
+ # jiecheng_pkg
40
+
41
+ 一个用于演示 PyPI 发布流程的极简阶乘包(实验三)。
42
+
43
+ > 状态:**尚未发布**,仅作为"实验三包"的源码准备,等研究清楚后再上传 PyPI。
44
+
45
+ ## 功能
46
+
47
+ | 函数 | 说明 |
48
+ | --- | --- |
49
+ | `jiecheng(n)` | 返回 n 的阶乘(递归实现,n 为正整数) |
50
+
51
+ ## 使用
52
+
53
+ ```python
54
+ from jiecheng_pkg import jiecheng
55
+
56
+ print(jiecheng(5)) # 120
57
+ ```
58
+
59
+ ## 目录结构
60
+
61
+ ```
62
+ 实验三_jiecheng_package/
63
+ ├── jiecheng_pkg/
64
+ │ ├── __init__.py
65
+ │ └── jiecheng.py
66
+ ├── tests/
67
+ │ └── test_jiecheng.py
68
+ ├── LICENSE
69
+ ├── README.md
70
+ └── pyproject.toml
71
+ ```
72
+
73
+ ## 本地测试
74
+
75
+ 在包根目录执行:
76
+
77
+ ```bash
78
+ python -m unittest discover -s tests -v
79
+ ```
80
+
81
+ ## 发布到 PyPI 的步骤(待研究)
82
+
83
+ 1. 在 <https://pypi.org> 注册账号并开启双因素认证。
84
+ 2. 在 Account settings → API tokens 创建令牌,复制 `pypi-...` 开头的 Token。
85
+ 3. 安装构建与上传工具:
86
+
87
+ ```bash
88
+ pip install build twine
89
+ ```
90
+
91
+ 4. 构建分发包:
92
+
93
+ ```bash
94
+ python -m build
95
+ ```
96
+
97
+ 会生成 `dist/jiecheng_pkg-0.1.0-py3-none-any.whl` 与 `.tar.gz`。
98
+
99
+ 5. 检查并上传(PyPI 已禁用账号密码,必须用 API Token):
100
+
101
+ ```bash
102
+ twine check dist/*
103
+ twine upload -u __token__ -p pypi-你的Token dist/*
104
+ ```
105
+
106
+ 6. 若用 GitHub Actions 等 CI,可改用 Trusted Publishers(OIDC),无需保存 Token。
107
+ 7. 上传后用 `pip install jiecheng-pkg` 验证,并让同学互相安装测试。
@@ -0,0 +1,69 @@
1
+ # jiecheng_pkg
2
+
3
+ 一个用于演示 PyPI 发布流程的极简阶乘包(实验三)。
4
+
5
+ > 状态:**尚未发布**,仅作为"实验三包"的源码准备,等研究清楚后再上传 PyPI。
6
+
7
+ ## 功能
8
+
9
+ | 函数 | 说明 |
10
+ | --- | --- |
11
+ | `jiecheng(n)` | 返回 n 的阶乘(递归实现,n 为正整数) |
12
+
13
+ ## 使用
14
+
15
+ ```python
16
+ from jiecheng_pkg import jiecheng
17
+
18
+ print(jiecheng(5)) # 120
19
+ ```
20
+
21
+ ## 目录结构
22
+
23
+ ```
24
+ 实验三_jiecheng_package/
25
+ ├── jiecheng_pkg/
26
+ │ ├── __init__.py
27
+ │ └── jiecheng.py
28
+ ├── tests/
29
+ │ └── test_jiecheng.py
30
+ ├── LICENSE
31
+ ├── README.md
32
+ └── pyproject.toml
33
+ ```
34
+
35
+ ## 本地测试
36
+
37
+ 在包根目录执行:
38
+
39
+ ```bash
40
+ python -m unittest discover -s tests -v
41
+ ```
42
+
43
+ ## 发布到 PyPI 的步骤(待研究)
44
+
45
+ 1. 在 <https://pypi.org> 注册账号并开启双因素认证。
46
+ 2. 在 Account settings → API tokens 创建令牌,复制 `pypi-...` 开头的 Token。
47
+ 3. 安装构建与上传工具:
48
+
49
+ ```bash
50
+ pip install build twine
51
+ ```
52
+
53
+ 4. 构建分发包:
54
+
55
+ ```bash
56
+ python -m build
57
+ ```
58
+
59
+ 会生成 `dist/jiecheng_pkg-0.1.0-py3-none-any.whl` 与 `.tar.gz`。
60
+
61
+ 5. 检查并上传(PyPI 已禁用账号密码,必须用 API Token):
62
+
63
+ ```bash
64
+ twine check dist/*
65
+ twine upload -u __token__ -p pypi-你的Token dist/*
66
+ ```
67
+
68
+ 6. 若用 GitHub Actions 等 CI,可改用 Trusted Publishers(OIDC),无需保存 Token。
69
+ 7. 上传后用 `pip install jiecheng-pkg` 验证,并让同学互相安装测试。
@@ -0,0 +1,6 @@
1
+ """jiecheng_pkg:一个简单的阶乘计算包(实验三待发布)。"""
2
+
3
+ from .jiecheng import jiecheng
4
+
5
+ __version__ = "0.1.0"
6
+ __all__ = ["jiecheng"]
@@ -0,0 +1,6 @@
1
+ def jiecheng(n):
2
+ """返回 n 的阶乘(n 为正整数)。"""
3
+ if n == 1:
4
+ return 1
5
+ else:
6
+ return n * jiecheng(n - 1)
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: jiecheng-pkg
3
+ Version: 0.1.0
4
+ Summary: A tiny factorial toolkit for learning how to publish a package to PyPI (Experiment 3).
5
+ Author: QingZhe
6
+ License: MIT License
7
+
8
+ Copyright (c) 2026 QingZhe
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://example.com/jiecheng-pkg
29
+ Project-URL: Repository, https://example.com/jiecheng-pkg.git
30
+ Keywords: factorial,jiecheng,teaching,experiment
31
+ Classifier: Programming Language :: Python :: 3
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Operating System :: OS Independent
34
+ Requires-Python: >=3.9
35
+ Description-Content-Type: text/markdown
36
+ License-File: LICENSE
37
+ Dynamic: license-file
38
+
39
+ # jiecheng_pkg
40
+
41
+ 一个用于演示 PyPI 发布流程的极简阶乘包(实验三)。
42
+
43
+ > 状态:**尚未发布**,仅作为"实验三包"的源码准备,等研究清楚后再上传 PyPI。
44
+
45
+ ## 功能
46
+
47
+ | 函数 | 说明 |
48
+ | --- | --- |
49
+ | `jiecheng(n)` | 返回 n 的阶乘(递归实现,n 为正整数) |
50
+
51
+ ## 使用
52
+
53
+ ```python
54
+ from jiecheng_pkg import jiecheng
55
+
56
+ print(jiecheng(5)) # 120
57
+ ```
58
+
59
+ ## 目录结构
60
+
61
+ ```
62
+ 实验三_jiecheng_package/
63
+ ├── jiecheng_pkg/
64
+ │ ├── __init__.py
65
+ │ └── jiecheng.py
66
+ ├── tests/
67
+ │ └── test_jiecheng.py
68
+ ├── LICENSE
69
+ ├── README.md
70
+ └── pyproject.toml
71
+ ```
72
+
73
+ ## 本地测试
74
+
75
+ 在包根目录执行:
76
+
77
+ ```bash
78
+ python -m unittest discover -s tests -v
79
+ ```
80
+
81
+ ## 发布到 PyPI 的步骤(待研究)
82
+
83
+ 1. 在 <https://pypi.org> 注册账号并开启双因素认证。
84
+ 2. 在 Account settings → API tokens 创建令牌,复制 `pypi-...` 开头的 Token。
85
+ 3. 安装构建与上传工具:
86
+
87
+ ```bash
88
+ pip install build twine
89
+ ```
90
+
91
+ 4. 构建分发包:
92
+
93
+ ```bash
94
+ python -m build
95
+ ```
96
+
97
+ 会生成 `dist/jiecheng_pkg-0.1.0-py3-none-any.whl` 与 `.tar.gz`。
98
+
99
+ 5. 检查并上传(PyPI 已禁用账号密码,必须用 API Token):
100
+
101
+ ```bash
102
+ twine check dist/*
103
+ twine upload -u __token__ -p pypi-你的Token dist/*
104
+ ```
105
+
106
+ 6. 若用 GitHub Actions 等 CI,可改用 Trusted Publishers(OIDC),无需保存 Token。
107
+ 7. 上传后用 `pip install jiecheng-pkg` 验证,并让同学互相安装测试。
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ jiecheng_pkg/__init__.py
5
+ jiecheng_pkg/jiecheng.py
6
+ jiecheng_pkg.egg-info/PKG-INFO
7
+ jiecheng_pkg.egg-info/SOURCES.txt
8
+ jiecheng_pkg.egg-info/dependency_links.txt
9
+ jiecheng_pkg.egg-info/top_level.txt
10
+ tests/test_jiecheng.py
@@ -0,0 +1 @@
1
+ jiecheng_pkg
@@ -0,0 +1,25 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "jiecheng-pkg"
7
+ version = "0.1.0"
8
+ description = "A tiny factorial toolkit for learning how to publish a package to PyPI (Experiment 3)."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = { file = "LICENSE" }
12
+ authors = [{ name = "QingZhe" }]
13
+ keywords = ["factorial", "jiecheng", "teaching", "experiment"]
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ ]
19
+
20
+ [project.urls]
21
+ Homepage = "https://example.com/jiecheng-pkg"
22
+ Repository = "https://example.com/jiecheng-pkg.git"
23
+
24
+ [tool.setuptools.packages.find]
25
+ include = ["jiecheng_pkg*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,17 @@
1
+ """jiecheng 函数的最简单元测试。"""
2
+
3
+ import unittest
4
+
5
+ from jiecheng_pkg import jiecheng
6
+
7
+
8
+ class TestJiecheng(unittest.TestCase):
9
+ def test_values(self):
10
+ self.assertEqual(jiecheng(1), 1)
11
+ self.assertEqual(jiecheng(2), 2)
12
+ self.assertEqual(jiecheng(5), 120)
13
+ self.assertEqual(jiecheng(10), 3628800)
14
+
15
+
16
+ if __name__ == "__main__":
17
+ unittest.main(verbosity=2)