Skip to main content

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,您可以使用我们提供的脚本:

使用脚本发布(推荐)

  1. 首先设置您的PyPI令牌为环境变量:

    # Windows (PowerShell)
    $env:UV_PUBLISH_TOKEN = "your_pypi_token_here"
    
    # Linux/macOS
    export UV_PUBLISH_TOKEN="your_pypi_token_here"
    
  2. 运行发布脚本:

    # Windows
    publish.bat
    
    # Linux/macOS
    chmod +x publish.sh
    ./publish.sh
    

手动发布步骤:

  1. 设置PyPI令牌为环境变量(如上所示)

  2. 构建包:

    uv build
    
  3. 发布包:

    uv publish
    

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lib_py_itild-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

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

Hashes for lib_py_itild-0.1.0.tar.gz
Algorithm Hash digest
SHA256 88e9eb5587975e98637587f765cffa5a4ca42b530639d7b2344448106ce60eef
MD5 35d4faaf9eecc65c8776502e9c597745
BLAKE2b-256 e929b0f04abb943f6965ca4a111fa9ca3a5f4087c9401c0d4a6155be1e21aadd

See more details on using hashes here.

File details

Details for the file lib_py_itild-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lib_py_itild-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91d43da2b59b4c48b8cf2a86bb3a50cdf1009a10aebc2d4b06376b42d38469ae
MD5 d6a7b303f82f7fcd3bda0a73cfcd1a72
BLAKE2b-256 c4f2c22ad308e0d4d8f602f675d743ffbc22a1eba5600c422afca16ff62518c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page