A demo Python package with a function and a class
Project description
lib-py
一个包含函数和类的示例 Python 包。
打包发布
uv build
安装
安装此包,请使用:
uv add .
使用方法
安装后,您可以按如下方式使用该包:
from lib_py import demo_function, DemoClass
# 使用 demo 函数
result = demo_function("世界")
print(result) # 输出:Hello, 世界!这是一个示例函数。
# 使用 demo 类
demo_instance = DemoClass("示例")
result = demo_instance.greet()
print(result) # 输出:Hello from DemoClass, 示例!
开发结构
该包的组织结构如下:
demo_function.py:包含demo_function函数demo_class.py:包含DemoClass类
两者均通过包的 __init__.py 文件导出。
发布到PyPI
要使用uv将此包发布到PyPI,您可以使用我们提供的脚本:
使用脚本发布(推荐)
-
首先设置您的PyPI令牌为环境变量:
# Windows (PowerShell) $env:UV_PUBLISH_TOKEN = "your_pypi_token_here" # Linux/macOS export UV_PUBLISH_TOKEN="your_pypi_token_here"
-
运行发布脚本:
# Windows publish.bat # Linux/macOS chmod +x publish.sh ./publish.sh
手动发布步骤:
-
设置PyPI令牌为环境变量(如上所示)
-
构建包:
uv build -
发布包:
uv publish
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lib_py_itild-0.1.0.tar.gz
(3.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lib_py_itild-0.1.0.tar.gz.
File metadata
- Download URL: lib_py_itild-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88e9eb5587975e98637587f765cffa5a4ca42b530639d7b2344448106ce60eef
|
|
| MD5 |
35d4faaf9eecc65c8776502e9c597745
|
|
| BLAKE2b-256 |
e929b0f04abb943f6965ca4a111fa9ca3a5f4087c9401c0d4a6155be1e21aadd
|
File details
Details for the file lib_py_itild-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lib_py_itild-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91d43da2b59b4c48b8cf2a86bb3a50cdf1009a10aebc2d4b06376b42d38469ae
|
|
| MD5 |
d6a7b303f82f7fcd3bda0a73cfcd1a72
|
|
| BLAKE2b-256 |
c4f2c22ad308e0d4d8f602f675d743ffbc22a1eba5600c422afca16ff62518c4
|