py-base-pkg 包描述
- 作者是:LG。一个 lg 上传的测试代码包, 可以被其他任何人进行引入使用。
- 支持系统:支持多个操作系统进行使用, 如: windows, linux, mac 等等。
示例代码
# This is a sample Python script.
import time
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, 我的 LG 基础包代码 print_hi 函数 {name}') # Press Ctrl+F8 to toggle the breakpoint.
def return_time_helloworld() -> str:
'''
定义函数, 用于生成与当前时间相关的字符串, 如返回: '2026-02-21 20:16:16 hello world.'
:return:
'''
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + ' hello world.'
if __name__ == '__main__':
print_hi('lgd')
s = return_time_helloworld()
print(s)
响应结果
更新日志
- 0.0.1: 初始化代码包
- 提供
return_time_helloworld()函数可供调用
- 提供
代码包更新步骤
- 修改
setup.py文件 - 执行测试命令:
python setup.py deploy - 执行打包命令:
python3 setup.py sdist - 执行上传命令, 使用
twine工具:twine upload dist/*
Metadata
Release files for basepkgtest 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| basepkgtest-0.0.3.tar.gz | 3.0 kB | Without provenance | Details |
Release files / basepkgtest-0.0.3.tar.gz
| Download URL | basepkgtest-0.0.3.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31a6a652d0d6700d7e866a5d1e3dcda74df24c627639eb90ba61d0b1266d96b8
|
|
BLAKE2b-256 checksum How to use checksums |
3c10b86482c65df8eb440cd109aab38ece0e764f0ecfc53d89abc1eda43d5b05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for basepkgtest 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.