Python ctypes bindings for the Linux-only tar-install Rust library.
Project description
tar-install Python bindings
Experimental Python bindings for the Linux-only tar_install Rust library.
This package does not use a command-line bridge. Python loads a small bundled
shared library with ctypes; that shared library links to the Rust
tar_install crate and calls the library API directly.
- No Python native extension is built.
- Linux wheels bundle
libtar_install.so. - The
tar-installbinary remains a tiny stub; the human CLI remainstarminal. - During development, Python can ask Cargo to build the shared library from a source checkout.
The actual installer behavior is Linux desktop oriented, so this package is Linux only.
Local dev
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -U pip
python -m pip install -e .
python - <<'PY'
import tarinstall
tarinstall.build_library()
print(tarinstall.list_apps())
PY
Library resolution
The wrapper finds libtar_install.so in this order:
TAR_INSTALL_LIB- bundled
tarinstall/lib/libtar_install.so target/release/libtar_install.sotarget/debug/libtar_install.so
Build The Shared Library
From the main project root, build the Rust library and .so directly:
cargo build -p tar-install
The debug shared library will be written to:
target/debug/libtar_install.so
For a release build:
cargo build -p tar-install --release
The release shared library will be written to:
target/release/libtar_install.so
This does not change the core installer logic. The tar-install crate now
declares both Rust library and shared-library outputs, so Cargo can produce
libtar_install.so from the same source. The normal Rust API remains available,
and the tar-install binary remains the small stub. The only practical impact
when building the tar-install package itself is an extra .so artifact and a
little more link time.
Build the local shared library from Python:
import tarinstall
tarinstall.build_library(release=True)
Wheel build
python -m pip wheel .
Wheel builds run cargo build -p tar-install --release
and copy the resulting shared library into the Python package. Set
TAR_INSTALL_SKIP_BUNDLE=1 to build a wrapper wheel without the shared library.
PyPI publish
PyPI publishing lives in this repository under .github/workflows/publish.yml.
The main tarminal-tar-install release workflow can trigger it after a tagged
release by sending a repository_dispatch event with a token stored as
PYLIB_WORKFLOW_TOKEN.
Configure PyPI Trusted Publisher with:
- Project name:
tar-install - Owner:
TamKungZ - Repository name:
pylib-tar-install - Workflow name:
publish.yml - Environment name:
pypi
The publish workflow checks out the requested main project ref, checks out this
Python package at the submodule commit sent by the release workflow, builds
libtar_install.so from that source, bundles it into the wheel, smoke tests the
import, and publishes the wheel to PyPI.
The publish workflow sets TAR_INSTALL_WHEEL_PLAT=manylinux_2_35_x86_64 because
PyPI rejects raw linux_x86_64 binary wheel tags.
Library API
import tarinstall
inspection = tarinstall.inspect("some-app-linux-x64.tar.xz")
report = tarinstall.install("some-app-linux-x64.tar.xz", app_id="some-app", force=True)
apps = tarinstall.list_apps()
doctor = tarinstall.doctor("some-app")
removed = tarinstall.remove("some-app")
print(inspection["safe"])
print(report.id, report.command)
print([app.as_dict() for app in apps])
print(doctor.fields)
print(removed.removed_paths)
For apps that need more control, create a client:
from tarinstall import TarInstall
tar_install = TarInstall(library="/path/to/libtar_install.so")
inspection = tar_install.inspect("some-app-linux-x64.tar.xz")
Use InstallOptions when passing install configuration around your own app:
from tarinstall import InstallOptions, TarInstall
tar_install = TarInstall()
options = InstallOptions(
scope="user",
app_id="some-app",
name="Some App",
command="some-app",
force=True,
)
report = tar_install.install("some-app-linux-x64.tar.xz", options)
If the native library returns an error, TarInstallError includes the raw
payload for logs or UI error reporting.
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 Distributions
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 tar_install-0.2.0-py3-none-manylinux_2_35_x86_64.whl.
File metadata
- Download URL: tar_install-0.2.0-py3-none-manylinux_2_35_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3, manylinux: glibc 2.35+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
886fd0351dbebba22b42b3f2051e2e56d03bef3b9d7571a7063d60ba31d092b2
|
|
| MD5 |
f42e45d35577cd62df7c9077d3a4884a
|
|
| BLAKE2b-256 |
cbb127ece0be8168f2a8f658ad3226e7e865cd222a84e62cda34abfd0f8e581e
|
Provenance
The following attestation bundles were made for tar_install-0.2.0-py3-none-manylinux_2_35_x86_64.whl:
Publisher:
publish.yml on TamKungZ/pylib-tar-install
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tar_install-0.2.0-py3-none-manylinux_2_35_x86_64.whl -
Subject digest:
886fd0351dbebba22b42b3f2051e2e56d03bef3b9d7571a7063d60ba31d092b2 - Sigstore transparency entry: 2113031447
- Sigstore integration time:
-
Permalink:
TamKungZ/pylib-tar-install@19ff0db83a2d377d18014a6ac45bf983d54f9483 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TamKungZ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@19ff0db83a2d377d18014a6ac45bf983d54f9483 -
Trigger Event:
workflow_dispatch
-
Statement type: