Skip to main content

韩灵稚打包测试

Hanlingzhi's Package PyPi Demo ##工程结构说明

.
├── LICENSE.txt    	// 证书文件
├── README.md		// MD文件
├── hanlingzhi
│   ├── __init__.py
│   └── math_h.py
├── setup.py			// 打包配置
└── string_h
    ├── __init__.py
    └── reverse.py

##测试服务器打包流程

  • 升级setuptools和wheel包
python3 -m pip install --user --upgrade setuptools wheel
  • 打包到本地文件
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
  • 分发到PyPi私服(pypi提供的测试版 test.pypi.org),首先安装twine
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]
  • 下载依赖
最好在虚拟环境下测试  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
  • 测试
python3
>>> from hanlingzhi import math_h
>>> math_h.addition(3,4)
7			// 成功
  • 上传正式服务
python3 -m twine upload --repository-url https://upload.pypi.org/legacy/  dist/*

Release files for numimage 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numimage 0.0.4
File Size Uploaded
numimage-0.0.4.tar.gz 36.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for numimage 0.0.4
File Interpreter ABI Platform
numimage-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 75.0 kB

Release files / numimage-0.0.4.tar.gz

Download URL numimage-0.0.4.tar.gz
Size 36.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f050fa31eec4886f0ccfb06a819be2df96d4a3dd8b99191dcec28149e7a370a7
BLAKE2b-256 checksum
How to use checksums
9184a372dc219435945e3d36926c49abb26a6b4e983d17ef1949ec9a02bdb210
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / numimage-0.0.4-py3-none-any.whl

Download URL numimage-0.0.4-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f58d8ff925ccbfdc751dccf5777cd8fbbe023d6a994d2e25582f550fe0ad466
BLAKE2b-256 checksum
How to use checksums
92455f5692041ae3e676c75bffce7d742d26570ca299c308c81117d966534dbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page