Skip to content

Commit 7c66db4

Browse files
committed
fix ci(4)
1 parent bc1e90b commit 7c66db4

File tree

6 files changed

+422
-624
lines changed

6 files changed

+422
-624
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ jobs:
4343
run: |
4444
python -m pip install --upgrade uv
4545
uv venv
46-
uv pip install maturin pytest pytest-cov pytest-xdist
46+
# Install maturin first to build the package
47+
uv pip install maturin
48+
49+
- name: Build and install Python package with dev dependencies
50+
run: |
51+
# Build and install the package with all dev dependencies
52+
uv run maturin develop --extras=dev
4753
4854
- name: Rust format check
4955
run: cargo fmt --all -- --check
@@ -54,9 +60,6 @@ jobs:
5460
- name: Run Rust tests
5561
run: cargo test --verbose
5662

57-
- name: Build and install Python package
58-
run: uv run maturin develop
59-
6063
- name: Run Python tests
6164
run: uv run pytest tests/ -v --cov=logxide --cov-report=xml
6265

examples/sentry_integration.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,18 @@
2424
import time
2525
from typing import Any
2626

27-
# Configure Sentry BEFORE importing LogXide
28-
import sentry_sdk
29-
from sentry_sdk.integrations.logging import LoggingIntegration
27+
# Check if Sentry SDK is available
28+
try:
29+
import sentry_sdk
30+
from sentry_sdk.integrations.logging import LoggingIntegration
31+
32+
HAS_SENTRY_SDK = True
33+
except ImportError:
34+
HAS_SENTRY_SDK = False
35+
print("⚠️ sentry-sdk is not installed.")
36+
print(" Install it with: pip install logxide[sentry]")
37+
print(" Exiting example.")
38+
sys.exit(1)
3039

3140
# Get Sentry DSN from environment or use a demo DSN
3241
SENTRY_DSN = os.getenv("SENTRY_DSN")

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ features = ["pyo3/extension-module"]
5757
module-name = "logxide"
5858

5959
[project.optional-dependencies]
60+
sentry = [
61+
"sentry-sdk>=1.40.0",
62+
]
6063
dev = [
6164
"pytest",
6265
"pytest-cov",

0 commit comments

Comments
 (0)