Skip to main content

xharness

面向 Python 和 TypeScript 的共享基础库,提供 Windows 应用打包、发布部署、配置与日志等运维支持。

最低环境要求:Python 3.12 与 Node.js 22。

安装

Python (uv)

uv add xharness

TypeScript / Node.js (npm)

npm i @lightxlab/xharness

快速上手

xharness 核心用于产品的打包与发布部署。

1. 本地打包 Windows 可执行文件

支持 .py(基于 PyInstaller)和 .js(基于 Node pkg)入口,默认打包输出至 dist/。

Python

from xharness import deploy

request = deploy.BuildRequest(entrypoint="app.py")
output_path = deploy.build(request)

print(f"可执行文件已生成: {output_path}")

也可以直接通过 CLI 打包:

uv run xharness-build --entrypoint app.py

TypeScript

import { deploy } from "@lightxlab/xharness";

const { artifactPath } = await deploy.build({
  entrypoint: "app.js",
});

console.log(`可执行文件已生成: ${artifactPath}`);

2. 打包配置 (xharness.toml)

如果需要自定义打包名称、输出目录或打包工具参数,可在产品根目录创建 xharness.toml:

product = "my-product"
output = "dist"

[pyinstaller]
hidden-imports = ["uvicorn"]
resources = [
  { source = "assets", destination = "assets" }
]

[pkg]
compress = "GZip"

3. 运行时配置与日志(占位接口)

from xharness import config, env, logging

logging.configure()
runtime = env.runtime_name()
settings = config.load()

当前 config.load、env.runtime_name / runtimeName 和 logging.configure 为接口占位桩函数(调用抛出 NotImplementedError / Error),后续版本开放具体实现。

许可

Apache-2.0

Metadata

Release files for xharness 0.1.0

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

Source distribution (sdist)

Source distribution for xharness 0.1.0
File Size Uploaded Provenance Actions
xharness-0.1.0.tar.gz 14.4 kB With provenance Details for xharness-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.5 kB

Release files / xharness-0.1.0.tar.gz

Download URL xharness-0.1.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0eea5b54aacc680c1eaf53da056d932bd069ec30d0faf3667f3d4e7e94067b04
BLAKE2b-256 checksum
How to use checksums
6d9fa2c2ec7e610aca93b8cbc4dde590ec6986a8e9675816deb67e969d7044f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / xharness-0.1.0-py3-none-any.whl

Download URL xharness-0.1.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7138cce403691ed0125652615b1c493bd5aec06120d9354df6a5eca3a99c2f07
BLAKE2b-256 checksum
How to use checksums
9ec09c164c7dece14c3e524b180f46ee2f0036f855dbbe126d8f7e5ee3ed57b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Security for xharness 0.1.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for xharness-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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