# 韩灵稚打包测试
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": "numimage",
"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/af/55/fc4e138304c05cea43bd2598318ef05e6d8245a180f90adbf7ac2ea03bfd/numimage-0.0.3.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.3",
"project_urls": {
"Homepage": "https://github.com/JackyFuHk/numimage"
},
"split_keywords": [
"jacky",
"package",
"demo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "959ea0e69215852535a1ed9aa24624c70a980385cfeeca821e0d6b9438928bf0",
"md5": "c51fd1de23604b200b53b7dcdac18475",
"sha256": "ef12fac00d57636135b2041c3fc1068be844e0c83d3bfd43ff70010293f6a4ca"
},
"downloads": -1,
"filename": "numimage-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c51fd1de23604b200b53b7dcdac18475",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 5388,
"upload_time": "2024-04-28T07:01:15",
"upload_time_iso_8601": "2024-04-28T07:01:15.600278Z",
"url": "https://files.pythonhosted.org/packages/95/9e/a0e69215852535a1ed9aa24624c70a980385cfeeca821e0d6b9438928bf0/numimage-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "af55fc4e138304c05cea43bd2598318ef05e6d8245a180f90adbf7ac2ea03bfd",
"md5": "9f2356e8d8277e9e8678feec7460666d",
"sha256": "aff7081ef016f8a12d8b494be3d1f44e53db37ec91ec2ab1e09e051adaab0dd3"
},
"downloads": -1,
"filename": "numimage-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "9f2356e8d8277e9e8678feec7460666d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 5689,
"upload_time": "2024-04-28T07:01:17",
"upload_time_iso_8601": "2024-04-28T07:01:17.354308Z",
"url": "https://files.pythonhosted.org/packages/af/55/fc4e138304c05cea43bd2598318ef05e6d8245a180f90adbf7ac2ea03bfd/numimage-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-28 07:01:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JackyFuHk",
"github_project": "numimage",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "numimage"
}