12 Commits
Author SHA1 Message Date
Noah 024254a288 fix(build): restore editable installs after stream_gears packaging change (#1734)
* fix(build): restore editable installs after stream_gears packaging change

Editable installs only put python-source (crates/stream-gears) on sys.path and skip include, so the root biliup/ package was unimportable after maturin develop / pip install -e . Add crates/stream-gears/biliup/__init__.py, which loads the root package under the same name. Wheels are unchanged: maturin only walks stream_gears/ and the include globs, which match the root biliup/ first.

* test(stream-gears): cover editable installs

test_wheel_ships_stubs only checks RECORD for regular installs, since an editable install's RECORD lists the .pth. A new test puts only python-source on PYTHONPATH and checks that biliup and biliup.__main__ resolve to the root package.

* build: move biliup/ and pyproject.toml into crates/stream-gears

Editable installs (`maturin develop`, `pip install -e`) only put
`python-source` on sys.path and skip `include`, so with `biliup/` at the
repository root they could not import it. With `pyproject.toml`,
`biliup/` and `stream_gears/` in the same directory, `biliup` goes in
through `python-packages`, which editable installs honour.

- `biliup/` is moved unchanged; the loader added earlier in this PR is
  removed because that path is now the real package.
- `readme` and `license` point at the repository root, so the wheel's
  METADATA and `licenses/LICENSE` stay the same.
- CI, Termux and the Dockerfile build with
  `-m crates/stream-gears/Cargo.toml`.

Ref #1732

* docs: point source install commands at crates/stream-gears
2026-09-24 09:30:04 +00:00
Noah 3f4583b40d feat(stream-gears): ship stream_gears package with accurate stubs (#1732)
* feat(stream-gears): ship stream_gears package with accurate stubs

The stream_gears/ package (__init__.py, stub, py.typed) never made it into
the wheel: pyproject only listed python-packages = ["biliup"], so maturin
generated its own __init__.py and the stub drifted from the implementation
(7 of 16 upload lines, login_by_qrcode typed as bool, missing upload
parameters, pyobject.Segment/Credit not accepted by the Rust side).

- Move the package to the repo root next to biliup/ (maturin resolves
  python-packages relative to python-source) and set
  module-name = "stream_gears.stream_gears" for a mixed layout.
- __init__.py re-exports the native module, adds Segment = PySegment and a
  Credit TypedDict; pyobject.py is removed.
- Rewrite stream_gears.pyi from the implementation, including
  StreamGearsError and the proxy/file parameters.
- Give upload an explicit text_signature so its string and list defaults
  show up in inspect.signature/help() instead of Ellipsis.

Top-level names only grow: Credit and Segment are added.

* ci(desktop): keep PyInstaller off the source stream_gears package

PyInstaller puts the repo root first on its search path, so the source
stream_gears/ (which has no native module) shadowed the installed package
and the frozen biliup failed to import stream_gears.stream_gears. Remove
the source copy after installing the wheel.

* test(stream-gears): check package layout and run stubtest in CI

test_package.py covers the new top-level names, the native submodule,
__all__ staying in sync with the native module, py.typed and the stub in
the wheel, upload's text_signature against PyO3's argument parsing, and
mypy --strict on a valid and an invalid example.

CI runs python -m mypy.stubtest stream_gears against the installed wheel
so the stub cannot drift from the implementation again.

* build(stream-gears): drop unused danmaku-client and async-trait deps

Neither is referenced anywhere in crates/stream-gears. danmaku is still
built through biliup-cli, so this only trims the manifest and lockfile
entries.

* refactor(stream-gears): keep the package in crates/stream-gears via python-source

Point maturin's python-source at crates/stream-gears instead of moving
stream_gears/ to the repository root. python-packages is resolved under
python-source, so the root biliup/ package is shipped through include.
The wheel contents are unchanged.

* ci: drop workarounds for a root-level stream_gears package

With stream_gears/ back in crates/stream-gears, nothing at the repository
root shadows the installed package, so PyInstaller and stubtest no longer
need to avoid it.
2026-09-24 06:48:40 +00:00
Noah e83123b3be test(stream-gears): pytest smoke suite for the wheel in CI (#1723)
* test(stream-gears): pytest smoke suite for the wheel in CI

Offline checks against the installed wheel: exported names, UploadLine
members, PySegment/config_bindings basics, `biliup --version` and
`python -m biliup --help` in a subprocess. OPS-19 (login functions
require `proxy`) is recorded as a strict xfail.

The linux x86_64 job installs the abi3 wheel into a venv and runs the
suite before the free-threaded build.

Ref #1721

* chore(stream-gears): move manual scripts to examples/

Drop test_server.py (only printed the default config; now covered by
the smoke suite). Move login.py, test_upload.py and test_download.py to
examples/ so pytest never collects them, and take the video/cookie
paths and stream URL from argv/env instead of hard-coded E:\ paths.
Also pass proxy explicitly (OPS-19), use PySegment (OPS-20) and catch
ValueError from str.index (OPS-38) so the scripts run on this version.

Ref #1721

* test(stream-gears): drop internal bug id from xfail reason
2026-09-24 03:14:32 +00:00
ForgQi 03ed3f5ff2 Bumping version 2026-09-23 00:33:34 +08:00
Noah 01a33213b8 ci: 修复发布与 CI 工作流的权限、死代码及供应链问题 (#1679)
release.yml:
- Windows 归档条件比较 matrix.os 与 windows-2019 永远为假,实际
  依赖 MSYS 的 .exe 兜底才能工作,改为按 runner.os 判断
- publish 归档循环中 exe 变量不重置,目录顺序变化时会污染后续平台
- 替换已归档的 actions-rs/toolchain、actions-rs/cargo,改用
  dtolnay/rust-toolchain 与 cross;checkout@v2(node12 已下线)升 v4
- 弃用的 ::set-output 改为 GITHUB_OUTPUT
- 顶层收紧为 contents: read,仅 publish 任务授予写权限

ci.yml:
- tag 触发从 '*' 收紧为 v[0-9]+.[0-9]+.[0-9]+,任意 tag 不再能
  触发 PyPI 正式发布
- setup-node@v3 升 v4

docker-publish.yml:
- 顶层 packages: write 会授予 pull_request 触发的 test 任务,收紧
  为顶层只读、build/merge 任务单独授予
- 移除 buildx 已弃用的 install: true;docker-compose v1 命令改为
  compose v2 子命令

docs-publish.yml:补 paths 过滤与显式权限。
Termux-publish.yml:setup-node@v3 升 v4。

新增 test.yml:PR 与 master push 运行
cargo test -p biliup -p biliup-cli -p danmaku,合并前有真实测试门禁。

Dockerfile:FFmpeg 从滚动的 latest tag 改为固定 autobuild 版本并
强制 SHA-256 校验,下载被篡改或损坏时构建失败。

docker-compose.yml:占位符 <HOST_PORT> 等使解析必然失败,改为
带默认值的环境变量;移除已废弃的 version 字段。

新增 .dockerignore:排除 .git、构建产物及本地数据库/凭据/日志,
避免进入构建上下文。
2026-08-30 15:00:16 +00:00
ForgQi 18c5bf086e Define AT_HWCAP2 for ppc64le; enable tokio
Set CFLAGS_powerpc64le_unknown_linux_gnu=-DAT_HWCAP2=26 in CI to work around aws-lc-sys (via rustls) calling getauxval(AT_HWCAP2) on manylinux2014 where glibc 2.17 headers lack AT_HWCAP2; glibc still provides getauxval so the value is safe and only used for ppc64le cc invocations. Also enable the tokio "io-std" feature for the biliup-cli crate to opt into the io-std I/O implementation.
2026-07-11 03:53:51 +08:00
ForgQi 58dc75b6ca Build free-threaded wheels for Python 3.14t (#1648)
maturin 1.14 dropped support for free-threaded Python 3.13
("Free-threaded Python interpreter is only supported on 3.14 and
later"), which broke the linux/musllinux/macos free-threaded wheel
steps since maturin-action always uses the latest maturin. Switch
the free-threaded builds from python3.13t to python3.14t, matching
what maturin generate-ci now emits.
2026-07-10 17:08:08 +00:00
ForgQi 3698bcf28a Add struct-patch support and improve config handling
Introduces the struct-patch crate for partial config updates and applies it to configuration models. Refactors config access patterns, adds PartialEq to several types, and updates LiveStreamer to use ConfigPatch for override_cfg. Also updates the CI workflow to use macos-15-intel, improves download task cancellation logic, and upgrades @douyinfe/semi-ui and related dependencies in the frontend.
2025-11-20 03:26:40 +08:00
Heporis 3537a6bde7 更改Termux的wheel发布至Release (#1371)
增加Termux使用教程链接
由于PyPI不支持Termux的platform tag,改为发布至Release
2025-07-26 09:58:39 +08:00
Heporis fd776a8207 为aarch64架构termux平台自动构建 (#1369)
* Update pyproject.toml

添加quickjs作为斗鱼平台js解释器

* Update ci.yml

增加aarch64架构termux平台自动构建

* Update README.md
2025-07-24 02:32:03 +00:00
ForgQi 67d041a217 Comment out CI workflow files
All steps in docker-publish.yml, pyinstaller-publish.yml, and python-publish.yml have been commented out, effectively disabling these GitHub Actions workflows. This change may be for temporarily suspending automated builds and releases.

Update ci.yml

Update ci.yml

Update CI workflows and stream-gears version

Fixes a variable reference in the CI workflow for manylinux builds and updates the Windows PyInstaller workflow to use maturin for development installs and a more streamlined build process. Bumps stream-gears crate version to 0.4.102 and removes the stream-gears Python dependency from pyproject.toml.

Delete python-publish.yml
2025-07-16 23:40:35 +08:00
ForgQi 9d7318b25f init tauri-app
init tauri-app

init rs
2025-07-16 03:43:05 +08:00