# 韩灵稚打包测试
Hanlingzhi's Package PyPi Demo
##工程结构说明
<pre>
.
├── LICENSE.txt // 证书文件
├── README.md // MD文件
├── hanlingzhi
│ ├── __init__.py
│ └── math_h.py
├── setup.py // 打包配置
└── string_h
├── __init__.py
└── reverse.py
</pre>
##测试服务器打包流程
* 升级setuptools和wheel包
<pre>python3 -m pip install --user --upgrade setuptools wheel
</pre>
* 打包到本地文件
<pre>python3 setup.py sdist bdist_wheel
会生成build、dist、hanlingzhi_test.egg-info文件,其中dist文件就是制品
├── dist
│ ├── hanlingzhi-test-0.0.1.tar.gz
│ └── hanlingzhi_test-0.0.1-py3-none-any.whl
</pre>
* 分发到PyPi私服(pypi提供的测试版 test.pypi.org),首先安装twine
<pre>
pip3 install twine
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Uploading distributions to https://test.pypi.org/legacy/
Enter your username: hanlingzhi // 私服注册的用户名
Enter your password: // 私服注册的密码
Uploading hanlingzhi_test-0.0.1-py3-none-any.whl
100%|████| 7.96k/7.96k [00:16<00:00, 486B/s]
Uploading hanlingzhi-test-0.0.1.tar.gz
100%|████| 7.28k/7.28k [00:01<00:00, 4.34kB/s]
</pre>
* 下载依赖
<pre>
最好在虚拟环境下测试 python3 -m venv venv
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps hanlingzhi_test
Looking in indexes: https://test.pypi.org/simple/
Collecting hanlingzhi_test
Downloading https://test-files.pythonhosted.org/packages/a7/ca/3e5ecda3c564a721642a756e31ec2f6f340067cfa4dddb119e2eb2c98dd0/hanlingzhi_test-0.0.1-py3-none-any.whl
Installing collected packages: hanlingzhi-test
Successfully installed hanlingzhi-test-0.0.1
</pre>
* 测试
<pre>
python3
>>> from hanlingzhi import math_h
>>> math_h.addition(3,4)
7 // 成功
</pre>
* 上传正式服务
<pre>
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
</pre>
Raw data
{
"_id": null,
"home_page": "https://github.com/JackyFuHk/numimage",
"name": "numimagejkk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "jacky package demo",
"author": "JackyFu",
"author_email": "343651570@qq.com",
"download_url": "https://files.pythonhosted.org/packages/92/93/4016850cd7c496e50370e62d028874960449a2f55f13584ef6ceb84499e9/numimagejkk-0.0.2.tar.gz",
"platform": null,
"description": "# \u97e9\u7075\u7a1a\u6253\u5305\u6d4b\u8bd5\r\nHanlingzhi's Package PyPi Demo\r\n##\u5de5\u7a0b\u7ed3\u6784\u8bf4\u660e\r\n<pre>\r\n.\r\n\u251c\u2500\u2500 LICENSE.txt \t// \u8bc1\u4e66\u6587\u4ef6\r\n\u251c\u2500\u2500 README.md\t\t// MD\u6587\u4ef6\r\n\u251c\u2500\u2500 hanlingzhi\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 __init__.py\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 math_h.py\r\n\u251c\u2500\u2500 setup.py\t\t\t// \u6253\u5305\u914d\u7f6e\r\n\u2514\u2500\u2500 string_h\r\n \u251c\u2500\u2500 __init__.py\r\n \u2514\u2500\u2500 reverse.py\r\n</pre>\r\n\r\n##\u6d4b\u8bd5\u670d\u52a1\u5668\u6253\u5305\u6d41\u7a0b\r\n\r\n* \u5347\u7ea7setuptools\u548cwheel\u5305\r\n<pre>python3 -m pip install --user --upgrade setuptools wheel\r\n</pre>\r\n\r\n* \u6253\u5305\u5230\u672c\u5730\u6587\u4ef6\r\n<pre>python3 setup.py sdist bdist_wheel\r\n\u4f1a\u751f\u6210build\u3001dist\u3001hanlingzhi_test.egg-info\u6587\u4ef6\uff0c\u5176\u4e2ddist\u6587\u4ef6\u5c31\u662f\u5236\u54c1\r\n\u251c\u2500\u2500 dist\r\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 hanlingzhi-test-0.0.1.tar.gz\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 hanlingzhi_test-0.0.1-py3-none-any.whl\r\n</pre>\r\n\r\n* \u5206\u53d1\u5230PyPi\u79c1\u670d(pypi\u63d0\u4f9b\u7684\u6d4b\u8bd5\u7248 test.pypi.org)\uff0c\u9996\u5148\u5b89\u88c5twine\r\n<pre>\r\npip3 install twine\r\npython3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*\r\nUploading distributions to https://test.pypi.org/legacy/\r\nEnter your username: hanlingzhi // \u79c1\u670d\u6ce8\u518c\u7684\u7528\u6237\u540d\r\nEnter your password: // \u79c1\u670d\u6ce8\u518c\u7684\u5bc6\u7801\r\nUploading hanlingzhi_test-0.0.1-py3-none-any.whl\r\n100%|\u2588\u2588\u2588\u2588| 7.96k/7.96k [00:16<00:00, 486B/s]\r\nUploading hanlingzhi-test-0.0.1.tar.gz\r\n100%|\u2588\u2588\u2588\u2588| 7.28k/7.28k [00:01<00:00, 4.34kB/s]\r\n</pre>\r\n\r\n* \u4e0b\u8f7d\u4f9d\u8d56\r\n<pre>\r\n\u6700\u597d\u5728\u865a\u62df\u73af\u5883\u4e0b\u6d4b\u8bd5 python3 -m venv venv\r\npython3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps hanlingzhi_test\r\nLooking in indexes: https://test.pypi.org/simple/\r\nCollecting hanlingzhi_test\r\n Downloading https://test-files.pythonhosted.org/packages/a7/ca/3e5ecda3c564a721642a756e31ec2f6f340067cfa4dddb119e2eb2c98dd0/hanlingzhi_test-0.0.1-py3-none-any.whl\r\nInstalling collected packages: hanlingzhi-test\r\nSuccessfully installed hanlingzhi-test-0.0.1\r\n</pre>\r\n\r\n* \u6d4b\u8bd5\r\n<pre>\r\npython3\r\n>>> from hanlingzhi import math_h\r\n>>> math_h.addition(3,4)\r\n7\t\t\t// \u6210\u529f\r\n</pre>\r\n\r\n* \u4e0a\u4f20\u6b63\u5f0f\u670d\u52a1\r\n<pre>\r\npython3 -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*\r\n</pre>\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\u9a8c\u8bc1\u6253\u5305\u529f\u80fd\u7684\u6d4b\u8bd5\u5305, \u8bf7\u52ff\u4e0b\u8f7d",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/JackyFuHk/numimage"
},
"split_keywords": [
"jacky",
"package",
"demo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d9fea3d1eaf0ded80ef6a97c19b921efcc41567ede1496b065287b9b21e89342",
"md5": "ad247fba19aaba62bc3054fc9be38864",
"sha256": "9b7f88d6d6c9556fdb36b89da5a2aeb7433e1148870b8c6f864aab5d6634d100"
},
"downloads": -1,
"filename": "numimagejkk-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ad247fba19aaba62bc3054fc9be38864",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3960,
"upload_time": "2024-04-28T03:44:16",
"upload_time_iso_8601": "2024-04-28T03:44:16.368498Z",
"url": "https://files.pythonhosted.org/packages/d9/fe/a3d1eaf0ded80ef6a97c19b921efcc41567ede1496b065287b9b21e89342/numimagejkk-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "92934016850cd7c496e50370e62d028874960449a2f55f13584ef6ceb84499e9",
"md5": "cc95d731d0ce9c8c4fcc9b4f2fa9e306",
"sha256": "45ebe9bacbe14ebc2c865d5db1911eec3f2069dac954922fad509f59cdfe8fce"
},
"downloads": -1,
"filename": "numimagejkk-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "cc95d731d0ce9c8c4fcc9b4f2fa9e306",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4226,
"upload_time": "2024-04-28T03:44:18",
"upload_time_iso_8601": "2024-04-28T03:44:18.482386Z",
"url": "https://files.pythonhosted.org/packages/92/93/4016850cd7c496e50370e62d028874960449a2f55f13584ef6ceb84499e9/numimagejkk-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-28 03:44:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JackyFuHk",
"github_project": "numimage",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "numimagejkk"
}