pytracingx 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytracingx-0.1.2/.coderabbit.yaml +33 -0
- pytracingx-0.1.2/.github/workflows/ci.yml +81 -0
- pytracingx-0.1.2/.github/workflows/release.yml +168 -0
- pytracingx-0.1.2/.gitignore +10 -0
- pytracingx-0.1.2/.pre-commit-config.yaml +9 -0
- pytracingx-0.1.2/Cargo.lock +3051 -0
- pytracingx-0.1.2/Cargo.toml +72 -0
- pytracingx-0.1.2/LICENSE +21 -0
- pytracingx-0.1.2/PKG-INFO +209 -0
- pytracingx-0.1.2/README.md +186 -0
- pytracingx-0.1.2/examples/demo.py +164 -0
- pytracingx-0.1.2/examples/traces_to_xtrace.py +68 -0
- pytracingx-0.1.2/pyproject.toml +57 -0
- pytracingx-0.1.2/python/pytracingx/__init__.py +62 -0
- pytracingx-0.1.2/python/pytracingx/_native.pyi +156 -0
- pytracingx-0.1.2/python/pytracingx/logging.py +112 -0
- pytracingx-0.1.2/python/pytracingx/py.typed +0 -0
- pytracingx-0.1.2/rust/src/config.rs +561 -0
- pytracingx-0.1.2/rust/src/context.rs +61 -0
- pytracingx-0.1.2/rust/src/error.rs +1 -0
- pytracingx-0.1.2/rust/src/exporters.rs +75 -0
- pytracingx-0.1.2/rust/src/lib.rs +96 -0
- pytracingx-0.1.2/rust/src/logs.rs +176 -0
- pytracingx-0.1.2/rust/src/metrics.rs +176 -0
- pytracingx-0.1.2/rust/src/runtime.rs +275 -0
- pytracingx-0.1.2/rust/src/sls.rs +74 -0
- pytracingx-0.1.2/rust/src/sls_log.rs +254 -0
- pytracingx-0.1.2/rust/src/traces.rs +382 -0
- pytracingx-0.1.2/tests/conftest.py +38 -0
- pytracingx-0.1.2/tests/test_config.py +117 -0
- pytracingx-0.1.2/tests/test_logging_bridge.py +51 -0
- pytracingx-0.1.2/tests/test_runtime.py +199 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
language: zh-CN
|
|
2
|
+
early_access: false
|
|
3
|
+
reviews:
|
|
4
|
+
request_changes_workflow: false
|
|
5
|
+
high_level_summary: true
|
|
6
|
+
poem: false
|
|
7
|
+
review_status: true
|
|
8
|
+
collapse_walkthrough: false
|
|
9
|
+
auto_review:
|
|
10
|
+
enabled: true
|
|
11
|
+
drafts: false
|
|
12
|
+
base_branches:
|
|
13
|
+
- main
|
|
14
|
+
- develop
|
|
15
|
+
path_filters:
|
|
16
|
+
- "!target/**"
|
|
17
|
+
- "!dist/**"
|
|
18
|
+
- "!**/*.lock"
|
|
19
|
+
path_instructions:
|
|
20
|
+
- path: "rust/**/*.rs"
|
|
21
|
+
instructions: |
|
|
22
|
+
Focus on memory safety, GIL handling (PyO3 best practices), unsafe blocks,
|
|
23
|
+
error propagation via PtxError, and async runtime correctness with tokio.
|
|
24
|
+
- path: "python/**/*.py"
|
|
25
|
+
instructions: |
|
|
26
|
+
Check for proper type hints, asyncio context propagation, and that public
|
|
27
|
+
API stays consistent with the Rust extension's signatures.
|
|
28
|
+
- path: "tests/**/*.py"
|
|
29
|
+
instructions: |
|
|
30
|
+
Verify fixtures are isolated, async tests are marked correctly, and that
|
|
31
|
+
runtime init/shutdown lifecycle is properly cleaned up.
|
|
32
|
+
chat:
|
|
33
|
+
auto_reply: true
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
lint:
|
|
16
|
+
name: ruff
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.11"
|
|
24
|
+
|
|
25
|
+
- name: Install ruff
|
|
26
|
+
run: pip install ruff
|
|
27
|
+
|
|
28
|
+
- name: ruff check
|
|
29
|
+
run: ruff check python/pytracingx tests
|
|
30
|
+
|
|
31
|
+
- name: ruff format --check
|
|
32
|
+
run: ruff format --check python/pytracingx tests
|
|
33
|
+
|
|
34
|
+
build:
|
|
35
|
+
name: build (${{ matrix.os }} / py${{ matrix.python-version }})
|
|
36
|
+
needs: lint
|
|
37
|
+
runs-on: ${{ matrix.os }}
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
os: [ubuntu-latest, macos-latest]
|
|
42
|
+
python-version: ["3.9", "3.11", "3.13"]
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
48
|
+
uses: actions/setup-python@v5
|
|
49
|
+
with:
|
|
50
|
+
python-version: ${{ matrix.python-version }}
|
|
51
|
+
|
|
52
|
+
- name: Set up Rust toolchain
|
|
53
|
+
uses: dtolnay/rust-toolchain@stable
|
|
54
|
+
|
|
55
|
+
- name: Cache cargo registry & target
|
|
56
|
+
uses: actions/cache@v4
|
|
57
|
+
with:
|
|
58
|
+
path: |
|
|
59
|
+
~/.cargo/registry
|
|
60
|
+
~/.cargo/git
|
|
61
|
+
target
|
|
62
|
+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
63
|
+
restore-keys: |
|
|
64
|
+
${{ runner.os }}-cargo-
|
|
65
|
+
|
|
66
|
+
- name: Install build dependencies
|
|
67
|
+
run: |
|
|
68
|
+
python -m venv .venv
|
|
69
|
+
source .venv/bin/activate
|
|
70
|
+
python -m pip install --upgrade pip
|
|
71
|
+
pip install maturin pytest pytest-asyncio
|
|
72
|
+
|
|
73
|
+
- name: Build & install (maturin develop)
|
|
74
|
+
run: |
|
|
75
|
+
source .venv/bin/activate
|
|
76
|
+
maturin develop --release
|
|
77
|
+
|
|
78
|
+
- name: Run tests
|
|
79
|
+
run: |
|
|
80
|
+
source .venv/bin/activate
|
|
81
|
+
pytest -v
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
release:
|
|
7
|
+
types: [published]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
verify-version:
|
|
12
|
+
name: verify version matches tag
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release'
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Check pyproject.toml & Cargo.toml versions match the tag
|
|
19
|
+
run: |
|
|
20
|
+
set -e
|
|
21
|
+
if [ "${{ github.event_name }}" = "release" ]; then
|
|
22
|
+
TAG="${{ github.event.release.tag_name }}"
|
|
23
|
+
else
|
|
24
|
+
TAG="${GITHUB_REF#refs/tags/}"
|
|
25
|
+
fi
|
|
26
|
+
EXPECTED="${TAG#v}"
|
|
27
|
+
PY_VER=$(grep -E '^version *= *"' pyproject.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
|
|
28
|
+
RS_VER=$(grep -E '^version *= *"' Cargo.toml | head -1 | sed -E 's/.*"([^"]+)".*/\1/')
|
|
29
|
+
echo "tag=$TAG expected=$EXPECTED pyproject=$PY_VER cargo=$RS_VER"
|
|
30
|
+
if [ "$PY_VER" != "$EXPECTED" ] || [ "$RS_VER" != "$EXPECTED" ]; then
|
|
31
|
+
echo "::error::version mismatch — bump pyproject.toml and Cargo.toml to $EXPECTED before tagging"
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
linux-wheels:
|
|
36
|
+
name: linux ${{ matrix.target }} ${{ matrix.manylinux }}
|
|
37
|
+
needs: verify-version
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
strategy:
|
|
40
|
+
fail-fast: false
|
|
41
|
+
matrix:
|
|
42
|
+
target: [x86_64, aarch64]
|
|
43
|
+
manylinux: [manylinux_2_28, musllinux_1_2]
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
|
|
47
|
+
- uses: actions/setup-python@v5
|
|
48
|
+
with:
|
|
49
|
+
python-version: "3.11"
|
|
50
|
+
|
|
51
|
+
- name: Build wheels
|
|
52
|
+
uses: PyO3/maturin-action@v1
|
|
53
|
+
env:
|
|
54
|
+
AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR: ""
|
|
55
|
+
AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR: ""
|
|
56
|
+
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR: ""
|
|
57
|
+
X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR: ""
|
|
58
|
+
with:
|
|
59
|
+
target: ${{ matrix.target }}
|
|
60
|
+
manylinux: ${{ matrix.manylinux }}
|
|
61
|
+
args: --release --out dist --strip
|
|
62
|
+
sccache: "true"
|
|
63
|
+
before-script-linux: |
|
|
64
|
+
set -e
|
|
65
|
+
unset OPENSSL_DIR OPENSSL_LIB_DIR OPENSSL_INCLUDE_DIR
|
|
66
|
+
unset AARCH64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
|
|
67
|
+
unset AARCH64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR
|
|
68
|
+
unset X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
|
|
69
|
+
unset X86_64_UNKNOWN_LINUX_MUSL_OPENSSL_DIR
|
|
70
|
+
if command -v apt-get >/dev/null 2>&1; then
|
|
71
|
+
apt-get update -y
|
|
72
|
+
apt-get install -y --no-install-recommends pkg-config perl make
|
|
73
|
+
elif command -v dnf >/dev/null 2>&1; then
|
|
74
|
+
dnf install -y pkgconf-pkg-config perl perl-IPC-Cmd perl-Data-Dumper make
|
|
75
|
+
elif command -v yum >/dev/null 2>&1; then
|
|
76
|
+
yum install -y pkgconfig perl perl-IPC-Cmd perl-Data-Dumper make
|
|
77
|
+
elif command -v apk >/dev/null 2>&1; then
|
|
78
|
+
apk add --no-cache pkgconfig perl make musl-dev linux-headers
|
|
79
|
+
else
|
|
80
|
+
echo "::error::No supported package manager found"
|
|
81
|
+
exit 1
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
- name: Upload artifacts
|
|
85
|
+
uses: actions/upload-artifact@v4
|
|
86
|
+
with:
|
|
87
|
+
name: wheels-linux-${{ matrix.target }}-${{ matrix.manylinux }}
|
|
88
|
+
path: dist/*.whl
|
|
89
|
+
|
|
90
|
+
macos-wheels:
|
|
91
|
+
name: macos ${{ matrix.target }}
|
|
92
|
+
needs: verify-version
|
|
93
|
+
runs-on: macos-latest
|
|
94
|
+
strategy:
|
|
95
|
+
fail-fast: false
|
|
96
|
+
matrix:
|
|
97
|
+
target: [universal2-apple-darwin]
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/checkout@v4
|
|
100
|
+
|
|
101
|
+
- uses: actions/setup-python@v5
|
|
102
|
+
with:
|
|
103
|
+
python-version: "3.11"
|
|
104
|
+
|
|
105
|
+
- name: Build wheels
|
|
106
|
+
uses: PyO3/maturin-action@v1
|
|
107
|
+
with:
|
|
108
|
+
target: ${{ matrix.target }}
|
|
109
|
+
args: --release --out dist --strip
|
|
110
|
+
sccache: "true"
|
|
111
|
+
|
|
112
|
+
- name: Upload artifacts
|
|
113
|
+
uses: actions/upload-artifact@v4
|
|
114
|
+
with:
|
|
115
|
+
name: wheels-macos-${{ matrix.target }}
|
|
116
|
+
path: dist/*.whl
|
|
117
|
+
|
|
118
|
+
build-sdist:
|
|
119
|
+
name: sdist
|
|
120
|
+
needs: verify-version
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
steps:
|
|
123
|
+
- uses: actions/checkout@v4
|
|
124
|
+
|
|
125
|
+
- uses: actions/setup-python@v5
|
|
126
|
+
with:
|
|
127
|
+
python-version: "3.11"
|
|
128
|
+
|
|
129
|
+
- name: Build sdist
|
|
130
|
+
uses: PyO3/maturin-action@v1
|
|
131
|
+
with:
|
|
132
|
+
command: sdist
|
|
133
|
+
args: --out dist
|
|
134
|
+
|
|
135
|
+
- name: Upload sdist
|
|
136
|
+
uses: actions/upload-artifact@v4
|
|
137
|
+
with:
|
|
138
|
+
name: sdist
|
|
139
|
+
path: dist/*.tar.gz
|
|
140
|
+
|
|
141
|
+
publish:
|
|
142
|
+
name: publish to PyPI
|
|
143
|
+
needs: [linux-wheels, macos-wheels, build-sdist]
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release'
|
|
146
|
+
environment: pypi
|
|
147
|
+
permissions:
|
|
148
|
+
id-token: write
|
|
149
|
+
contents: write
|
|
150
|
+
steps:
|
|
151
|
+
- uses: actions/download-artifact@v4
|
|
152
|
+
with:
|
|
153
|
+
path: dist
|
|
154
|
+
merge-multiple: true
|
|
155
|
+
|
|
156
|
+
- name: Publish to PyPI
|
|
157
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
158
|
+
with:
|
|
159
|
+
packages-dir: dist
|
|
160
|
+
skip-existing: true
|
|
161
|
+
|
|
162
|
+
- name: Attach wheels & sdist to GitHub Release
|
|
163
|
+
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/v')
|
|
164
|
+
uses: softprops/action-gh-release@v2
|
|
165
|
+
with:
|
|
166
|
+
files: |
|
|
167
|
+
dist/*.whl
|
|
168
|
+
dist/*.tar.gz
|