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.1

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.1
File Size Uploaded Provenance Actions
xharness-0.1.1.tar.gz 14.4 kB With provenance Details for xharness-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 30.5 kB

Release files / xharness-0.1.1.tar.gz

Download URL xharness-0.1.1.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
431518bbf8c60ec00947b3286df779e72b3a25f21a885c99718ed5344249f7d3
BLAKE2b-256 checksum
How to use checksums
8278a147ab4c75a841f6dbb511592e125f3d014c84f3631315efc38afad1eaf5
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.1-py3-none-any.whl

Download URL xharness-0.1.1-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ca942d5a019e1132012a19cd012d318c2662ab617d536e8ba92460d758ab732
BLAKE2b-256 checksum
How to use checksums
54c05cea28096b84a290779396bf433332528757cde8fb5ba118f617520be372
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.1

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.1.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