pysentry-rs 0.2.2__tar.gz → 0.3.0__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.
Potentially problematic release.
This version of pysentry-rs might be problematic. Click here for more details.
- pysentry_rs-0.3.0/.github/workflows/benchmark.yml +156 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/.github/workflows/release.yml +2 -1
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/Cargo.lock +11 -3
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/Cargo.toml +3 -1
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/PKG-INFO +2 -2
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/README.md +1 -1
- pysentry_rs-0.3.0/benchmarks/.gitignore +2 -0
- pysentry_rs-0.3.0/benchmarks/.python-version +1 -0
- pysentry_rs-0.3.0/benchmarks/README.md +3 -0
- pysentry_rs-0.3.0/benchmarks/main.py +111 -0
- pysentry_rs-0.3.0/benchmarks/pyproject.toml +12 -0
- pysentry_rs-0.3.0/benchmarks/results/0.2.3.md +141 -0
- pysentry_rs-0.3.0/benchmarks/results/latest.md +141 -0
- pysentry_rs-0.3.0/benchmarks/src/benchmark_runner.py +364 -0
- pysentry_rs-0.3.0/benchmarks/src/performance_monitor.py +157 -0
- pysentry_rs-0.3.0/benchmarks/src/report_generator.py +222 -0
- pysentry_rs-0.3.0/benchmarks/src/tool_wrapper.py +347 -0
- pysentry_rs-0.3.0/benchmarks/test_data/large_requirements.txt +55 -0
- pysentry_rs-0.3.0/benchmarks/test_data/small_requirements.txt +10 -0
- pysentry_rs-0.3.0/benchmarks/uv.lock +1099 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/cache/audit.rs +36 -35
- pysentry_rs-0.3.0/src/cache/mod.rs +25 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/cache/storage.rs +22 -5
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/cli.rs +29 -6
- pysentry_rs-0.3.0/src/dependency/mod.rs +24 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/dependency/resolvers/mod.rs +21 -21
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/dependency/resolvers/pip_tools.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/dependency/resolvers/uv.rs +59 -10
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/dependency/scanner.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/error.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/lib.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/main.rs +19 -7
- pysentry_rs-0.3.0/src/output/mod.rs +25 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/output/report.rs +175 -95
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/output/sarif.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/parsers/lock.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/parsers/mod.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/parsers/poetry_lock.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/parsers/pyproject.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/parsers/requirements.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/providers/mod.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/providers/osv.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/providers/pypa.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/providers/pypi.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/python.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/types.rs +21 -10
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/vulnerability/database.rs +18 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/src/vulnerability/matcher.rs +18 -0
- pysentry_rs-0.3.0/src/vulnerability/mod.rs +27 -0
- pysentry_rs-0.2.2/src/cache/mod.rs +0 -7
- pysentry_rs-0.2.2/src/dependency/mod.rs +0 -6
- pysentry_rs-0.2.2/src/output/mod.rs +0 -7
- pysentry_rs-0.2.2/src/vulnerability/mod.rs +0 -9
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/.github/FUNDING.yml +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/.github/dependabot.yml +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/.github/workflows/ci.yml +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/.gitignore +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/.pre-commit-config.yaml +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/LICENSE +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/fixtures/requirements-tests/requirements-dev.txt +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/fixtures/requirements-tests/requirements.txt +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/fixtures/requirements-tests-vulnerable/requirements.txt +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/pyproject.toml +0 -0
- {pysentry_rs-0.2.2 → pysentry_rs-0.3.0}/python/pysentry/__init__.py +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
name: Benchmark Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: "Version to benchmark (e.g., v0.2.3)"
|
|
11
|
+
required: true
|
|
12
|
+
default: "v0.2.3"
|
|
13
|
+
|
|
14
|
+
env:
|
|
15
|
+
CARGO_TERM_COLOR: always
|
|
16
|
+
RUST_BACKTRACE: 1
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
benchmark:
|
|
20
|
+
name: Run Benchmarks
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
contents: write
|
|
24
|
+
pull-requests: write
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout code
|
|
28
|
+
uses: actions/checkout@v4
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
|
|
32
|
+
- name: Extract version from tag
|
|
33
|
+
id: version
|
|
34
|
+
run: |
|
|
35
|
+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
36
|
+
VERSION="${{ github.event.inputs.version }}"
|
|
37
|
+
else
|
|
38
|
+
VERSION="${{ github.ref_name }}"
|
|
39
|
+
fi
|
|
40
|
+
VERSION_CLEAN=${VERSION#v}
|
|
41
|
+
echo "version=${VERSION_CLEAN}" >> $GITHUB_OUTPUT
|
|
42
|
+
echo "version_with_v=${VERSION}" >> $GITHUB_OUTPUT
|
|
43
|
+
echo "branch_name=benchmark-${VERSION_CLEAN}" >> $GITHUB_OUTPUT
|
|
44
|
+
|
|
45
|
+
- name: Install system dependencies
|
|
46
|
+
run: |
|
|
47
|
+
sudo apt-get update
|
|
48
|
+
sudo apt-get install -y libssl-dev pkg-config
|
|
49
|
+
|
|
50
|
+
- name: Install Rust
|
|
51
|
+
uses: dtolnay/rust-toolchain@stable
|
|
52
|
+
|
|
53
|
+
- name: Cache cargo
|
|
54
|
+
uses: actions/cache@v4
|
|
55
|
+
with:
|
|
56
|
+
path: |
|
|
57
|
+
~/.cargo/registry/index/
|
|
58
|
+
~/.cargo/registry/cache/
|
|
59
|
+
~/.cargo/git/db/
|
|
60
|
+
target
|
|
61
|
+
key: ${{ runner.os }}-cargo-benchmark-${{ hashFiles('**/Cargo.lock') }}
|
|
62
|
+
restore-keys: |
|
|
63
|
+
${{ runner.os }}-cargo-benchmark-
|
|
64
|
+
${{ runner.os }}-cargo-build-
|
|
65
|
+
|
|
66
|
+
- name: Build PySentry
|
|
67
|
+
run: cargo build --release
|
|
68
|
+
|
|
69
|
+
- name: Set up Python
|
|
70
|
+
uses: actions/setup-python@v5
|
|
71
|
+
with:
|
|
72
|
+
python-version: "3.11"
|
|
73
|
+
|
|
74
|
+
- name: Install uv
|
|
75
|
+
run: |
|
|
76
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
77
|
+
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
78
|
+
|
|
79
|
+
- name: Install pip-audit for benchmark comparison
|
|
80
|
+
run: pip install pip-audit
|
|
81
|
+
|
|
82
|
+
- name: Install benchmark dependencies
|
|
83
|
+
run: |
|
|
84
|
+
cd benchmarks
|
|
85
|
+
uv sync
|
|
86
|
+
|
|
87
|
+
- name: Run benchmark suite
|
|
88
|
+
run: |
|
|
89
|
+
cd benchmarks
|
|
90
|
+
uv run python main.py --skip-build
|
|
91
|
+
|
|
92
|
+
ls -la results/
|
|
93
|
+
|
|
94
|
+
LATEST_FILE=$(ls results/*.md 2>/dev/null | grep -v 'latest.md' | sort -r | head -n 1)
|
|
95
|
+
if [ -f "$LATEST_FILE" ]; then
|
|
96
|
+
cp "$LATEST_FILE" results/latest.md
|
|
97
|
+
echo "Created latest.md from: $LATEST_FILE"
|
|
98
|
+
else
|
|
99
|
+
echo "Warning: No benchmark files found to create latest.md"
|
|
100
|
+
fi
|
|
101
|
+
|
|
102
|
+
- name: Configure Git
|
|
103
|
+
run: |
|
|
104
|
+
git config --global user.name "github-actions[bot]"
|
|
105
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
106
|
+
|
|
107
|
+
- name: Create and switch to benchmark branch
|
|
108
|
+
run: |
|
|
109
|
+
BRANCH_NAME="${{ steps.version.outputs.branch_name }}"
|
|
110
|
+
git checkout -b $BRANCH_NAME
|
|
111
|
+
|
|
112
|
+
- name: Commit benchmark results
|
|
113
|
+
run: |
|
|
114
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
115
|
+
|
|
116
|
+
git add benchmarks/results/
|
|
117
|
+
|
|
118
|
+
if git diff --staged --quiet; then
|
|
119
|
+
echo "No changes to commit"
|
|
120
|
+
exit 0
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
git commit -m "Add benchmark results for version ${VERSION}"
|
|
124
|
+
|
|
125
|
+
- name: Push benchmark branch
|
|
126
|
+
run: |
|
|
127
|
+
BRANCH_NAME="${{ steps.version.outputs.branch_name }}"
|
|
128
|
+
git push origin $BRANCH_NAME
|
|
129
|
+
|
|
130
|
+
- name: Create Pull Request
|
|
131
|
+
env:
|
|
132
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
+
run: |
|
|
134
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
135
|
+
BRANCH_NAME="${{ steps.version.outputs.branch_name }}"
|
|
136
|
+
|
|
137
|
+
PR_BODY="This PR contains automated benchmark results comparing PySentry v${VERSION} against pip-audit."
|
|
138
|
+
|
|
139
|
+
gh pr create \
|
|
140
|
+
--title "Benchmark results for v${VERSION}" \
|
|
141
|
+
--body "$PR_BODY" \
|
|
142
|
+
--base main \
|
|
143
|
+
--head $BRANCH_NAME \
|
|
144
|
+
--label "benchmark,automated"
|
|
145
|
+
|
|
146
|
+
- name: Summary
|
|
147
|
+
run: |
|
|
148
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
149
|
+
BRANCH_NAME="${{ steps.version.outputs.branch_name }}"
|
|
150
|
+
|
|
151
|
+
echo "Benchmark workflow completed successfully!"
|
|
152
|
+
echo ""
|
|
153
|
+
echo "Benchmarked version: v${VERSION}"
|
|
154
|
+
echo "Created branch: ${BRANCH_NAME}"
|
|
155
|
+
echo "Results location: benchmarks/results/"
|
|
156
|
+
echo "Pull request created automatically"
|
|
@@ -197,6 +197,8 @@ jobs:
|
|
|
197
197
|
runs-on: ubuntu-latest
|
|
198
198
|
needs: [build-python-wheels, build-sdist]
|
|
199
199
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
200
|
+
permissions:
|
|
201
|
+
id-token: write
|
|
200
202
|
steps:
|
|
201
203
|
- name: Download artifacts
|
|
202
204
|
uses: actions/download-artifact@v4
|
|
@@ -213,7 +215,6 @@ jobs:
|
|
|
213
215
|
- name: Publish to PyPI
|
|
214
216
|
uses: pypa/gh-action-pypi-publish@v1.12.4
|
|
215
217
|
with:
|
|
216
|
-
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
217
218
|
packages-dir: dist/
|
|
218
219
|
|
|
219
220
|
update-release:
|
|
@@ -988,6 +988,12 @@ version = "0.1.1"
|
|
|
988
988
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
989
989
|
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
|
990
990
|
|
|
991
|
+
[[package]]
|
|
992
|
+
name = "owo-colors"
|
|
993
|
+
version = "4.2.2"
|
|
994
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
995
|
+
checksum = "48dd4f4a2c8405440fd0462561f0e5806bd0f77e86f51c761481bdd4018b545e"
|
|
996
|
+
|
|
991
997
|
[[package]]
|
|
992
998
|
name = "pep440_rs"
|
|
993
999
|
version = "0.7.3"
|
|
@@ -1115,7 +1121,7 @@ dependencies = [
|
|
|
1115
1121
|
|
|
1116
1122
|
[[package]]
|
|
1117
1123
|
name = "pysentry"
|
|
1118
|
-
version = "0.
|
|
1124
|
+
version = "0.3.0"
|
|
1119
1125
|
dependencies = [
|
|
1120
1126
|
"anyhow",
|
|
1121
1127
|
"async-trait",
|
|
@@ -1124,10 +1130,12 @@ dependencies = [
|
|
|
1124
1130
|
"dirs",
|
|
1125
1131
|
"fs-err",
|
|
1126
1132
|
"futures",
|
|
1133
|
+
"owo-colors",
|
|
1127
1134
|
"pep440_rs",
|
|
1128
1135
|
"pyo3",
|
|
1129
1136
|
"regex",
|
|
1130
1137
|
"reqwest",
|
|
1138
|
+
"rustc-hash",
|
|
1131
1139
|
"serde",
|
|
1132
1140
|
"serde_json",
|
|
1133
1141
|
"serde_yaml",
|
|
@@ -1531,9 +1539,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
|
|
|
1531
1539
|
|
|
1532
1540
|
[[package]]
|
|
1533
1541
|
name = "slab"
|
|
1534
|
-
version = "0.4.
|
|
1542
|
+
version = "0.4.11"
|
|
1535
1543
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1536
|
-
checksum = "
|
|
1544
|
+
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
|
|
1537
1545
|
|
|
1538
1546
|
[[package]]
|
|
1539
1547
|
name = "smallvec"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "pysentry"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
rust-version = "1.79"
|
|
6
6
|
description = "Security vulnerability auditing for Python packages"
|
|
@@ -29,10 +29,12 @@ clap = { version = "4.5.43", features = ["derive"] }
|
|
|
29
29
|
dirs = "6.0.0"
|
|
30
30
|
fs-err = "3.1.1"
|
|
31
31
|
futures = "0.3.31"
|
|
32
|
+
owo-colors = "4.2.2"
|
|
32
33
|
pep440_rs = "0.7.3"
|
|
33
34
|
pyo3 = { version = "0.25.1", features = ["extension-module"], optional = true }
|
|
34
35
|
regex = "1.11.1"
|
|
35
36
|
reqwest = { version = "0.12.22", features = ["json", "stream", "rustls-tls"], default-features = false }
|
|
37
|
+
rustc-hash = "2.1.1"
|
|
36
38
|
serde = { version = "1.0.219", features = ["derive"] }
|
|
37
39
|
serde_json = "1.0.142"
|
|
38
40
|
serde_yaml = "0.9.34"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pysentry-rs
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Classifier: Development Status :: 4 - Beta
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
@@ -28,7 +28,7 @@ Project-URL: Issues, https://github.com/nyudenkov/pysentry/issues
|
|
|
28
28
|
|
|
29
29
|
[](https://google.github.io/osv.dev/)
|
|
30
30
|
|
|
31
|
-
[Help to test and improve](https://github.com/nyudenkov/pysentry/issues/12)
|
|
31
|
+
[Help to test and improve](https://github.com/nyudenkov/pysentry/issues/12) | [Latest PySentry - pip-audit benchmark](benchmarks/results/latest.md)
|
|
32
32
|
|
|
33
33
|
A fast, reliable security vulnerability scanner for Python projects, written in Rust.
|
|
34
34
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://google.github.io/osv.dev/)
|
|
4
4
|
|
|
5
|
-
[Help to test and improve](https://github.com/nyudenkov/pysentry/issues/12)
|
|
5
|
+
[Help to test and improve](https://github.com/nyudenkov/pysentry/issues/12) | [Latest PySentry - pip-audit benchmark](benchmarks/results/latest.md)
|
|
6
6
|
|
|
7
7
|
A fast, reliable security vulnerability scanner for Python projects, written in Rust.
|
|
8
8
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import argparse
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
sys.path.insert(0, str(Path(__file__).parent / "src"))
|
|
6
|
+
|
|
7
|
+
from src.benchmark_runner import BenchmarkRunner
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
parser = argparse.ArgumentParser(
|
|
12
|
+
description="PySentry vs pip-audit benchmark suite",
|
|
13
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
14
|
+
epilog="""
|
|
15
|
+
Examples:
|
|
16
|
+
python main.py # Run full benchmark suite
|
|
17
|
+
python main.py --quick # Run only small dataset for quick testing
|
|
18
|
+
python main.py --output-dir ./custom-results # Custom output directory
|
|
19
|
+
""",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
parser.add_argument(
|
|
23
|
+
"--quick", action="store_true", help="Run only small dataset for quick testing"
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
parser.add_argument(
|
|
27
|
+
"--output-dir",
|
|
28
|
+
type=Path,
|
|
29
|
+
help="Custom output directory for results (default: ./results/)",
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
"--verbose", "-v", action="store_true", help="Enable verbose output"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
"--skip-build",
|
|
38
|
+
action="store_true",
|
|
39
|
+
help="Skip PySentry build check (assume it's already built)",
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
args = parser.parse_args()
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
benchmark_dir = Path(__file__).parent
|
|
46
|
+
if args.output_dir:
|
|
47
|
+
runner = BenchmarkRunner(benchmark_dir)
|
|
48
|
+
runner.results_dir = args.output_dir
|
|
49
|
+
runner.results_dir.mkdir(parents=True, exist_ok=True)
|
|
50
|
+
else:
|
|
51
|
+
runner = BenchmarkRunner(benchmark_dir)
|
|
52
|
+
|
|
53
|
+
if args.verbose:
|
|
54
|
+
print(f"Benchmark directory: {benchmark_dir}")
|
|
55
|
+
print(f"Results directory: {runner.results_dir}")
|
|
56
|
+
|
|
57
|
+
if args.quick:
|
|
58
|
+
print("Quick mode: Running only small dataset...")
|
|
59
|
+
large_dataset = runner.test_data_dir / "large_requirements.txt"
|
|
60
|
+
backup_path = None
|
|
61
|
+
if large_dataset.exists():
|
|
62
|
+
backup_path = runner.test_data_dir / "large_requirements.txt.backup"
|
|
63
|
+
large_dataset.rename(backup_path)
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
print("Starting benchmark suite...")
|
|
67
|
+
suite = runner.run_full_benchmark_suite()
|
|
68
|
+
|
|
69
|
+
report_path = runner.save_and_generate_report(suite)
|
|
70
|
+
|
|
71
|
+
successful_runs = len(
|
|
72
|
+
[r for r in suite.results if r.metrics.exit_code <= 1]
|
|
73
|
+
)
|
|
74
|
+
total_runs = len(suite.results)
|
|
75
|
+
|
|
76
|
+
print("\n" + "=" * 60)
|
|
77
|
+
print("BENCHMARK SUITE COMPLETED")
|
|
78
|
+
print("=" * 60)
|
|
79
|
+
print(f"Total runs: {total_runs}")
|
|
80
|
+
print(f"Successful: {successful_runs}")
|
|
81
|
+
print(f"Failed: {total_runs - successful_runs}")
|
|
82
|
+
print(f"Duration: {suite.total_duration:.2f} seconds")
|
|
83
|
+
print(f"Report saved to: {report_path}")
|
|
84
|
+
print("=" * 60)
|
|
85
|
+
|
|
86
|
+
exit_code = 0 if successful_runs == total_runs else 1
|
|
87
|
+
|
|
88
|
+
if exit_code != 0:
|
|
89
|
+
print(f"WARNING: {total_runs - successful_runs} benchmark runs failed!")
|
|
90
|
+
|
|
91
|
+
return exit_code
|
|
92
|
+
|
|
93
|
+
finally:
|
|
94
|
+
if args.quick and backup_path and backup_path.exists():
|
|
95
|
+
backup_path.rename(large_dataset)
|
|
96
|
+
|
|
97
|
+
except KeyboardInterrupt:
|
|
98
|
+
print("\nBenchmark interrupted by user.")
|
|
99
|
+
return 1
|
|
100
|
+
|
|
101
|
+
except Exception as e:
|
|
102
|
+
print(f"Error running benchmark suite: {e}")
|
|
103
|
+
if args.verbose:
|
|
104
|
+
import traceback
|
|
105
|
+
|
|
106
|
+
traceback.print_exc()
|
|
107
|
+
return 1
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
if __name__ == "__main__":
|
|
111
|
+
sys.exit(main())
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "benchmarks"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Performance benchmark suite for PySentry vs pip-audit"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"matplotlib>=3.10.5",
|
|
9
|
+
"pip-audit>=2.9.0",
|
|
10
|
+
"psutil>=7.0.0",
|
|
11
|
+
"tabulate>=0.9.0",
|
|
12
|
+
]
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# PySentry - pip-audit Benchmark Report
|
|
2
|
+
|
|
3
|
+
**Generated:** 2025-08-12 00:03:24
|
|
4
|
+
**Duration:** 2m 3.83s
|
|
5
|
+
**Total Tests:** 20
|
|
6
|
+
|
|
7
|
+
## Executive Summary
|
|
8
|
+
|
|
9
|
+
**Overall Success Rate:** 100.0% (20/20 successful runs)
|
|
10
|
+
|
|
11
|
+
### Small_Requirements Dataset - Cold Cache
|
|
12
|
+
- **Fastest:** pysentry-pypi (0.382s) - 24.16x faster than slowest
|
|
13
|
+
- **Memory Efficient:** pysentry-osv (10.01 MB) - 9.31x less memory than highest
|
|
14
|
+
|
|
15
|
+
### Small_Requirements Dataset - Hot Cache
|
|
16
|
+
- **Fastest:** pysentry-pypi (0.261s) - 30.71x faster than slowest
|
|
17
|
+
- **Memory Efficient:** pysentry-pypi (9.69 MB) - 11.09x less memory than highest
|
|
18
|
+
|
|
19
|
+
### Large_Requirements Dataset - Cold Cache
|
|
20
|
+
- **Fastest:** pysentry-pypi (1.160s) - 18.24x faster than slowest
|
|
21
|
+
- **Memory Efficient:** pysentry-osv (10.34 MB) - 10.40x less memory than highest
|
|
22
|
+
|
|
23
|
+
### Large_Requirements Dataset - Hot Cache
|
|
24
|
+
- **Fastest:** pysentry-pypi (0.740s) - 21.90x faster than slowest
|
|
25
|
+
- **Memory Efficient:** pysentry-osv (10.33 MB) - 10.23x less memory than highest
|
|
26
|
+
|
|
27
|
+
## Test Environment
|
|
28
|
+
|
|
29
|
+
- **Platform:** Linux-6.11.0-1018-azure-x86_64-with-glibc2.39
|
|
30
|
+
- **Python Version:** 3.11.13
|
|
31
|
+
- **CPU Cores:** 4
|
|
32
|
+
- **Total Memory:** 15.62 GB
|
|
33
|
+
- **Available Memory:** 14.65 GB
|
|
34
|
+
|
|
35
|
+
## Performance Comparison
|
|
36
|
+
|
|
37
|
+
### Small_Requirements Dataset - Cold Cache
|
|
38
|
+
|
|
39
|
+
#### Execution Time Comparison
|
|
40
|
+
|
|
41
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
42
|
+
|---------------------|---------------------|---------------------|
|
|
43
|
+
| 🥇 pysentry-pypi | 0.382s | 1.00x |
|
|
44
|
+
| 🥈 pysentry-osv | 1.080s | 2.83x |
|
|
45
|
+
| pysentry-all-sources | 1.468s | 3.85x |
|
|
46
|
+
| pysentry-pypa | 1.475s | 3.86x |
|
|
47
|
+
| pip-audit-default | 9.222s | 24.16x |
|
|
48
|
+
|
|
49
|
+
#### Memory Usage Comparison
|
|
50
|
+
|
|
51
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
52
|
+
|---------------------|---------------------|---------------------|
|
|
53
|
+
| 🥇 pysentry-osv | 10.01 MB | 1.00x |
|
|
54
|
+
| 🥈 pysentry-pypi | 11.70 MB | 1.17x |
|
|
55
|
+
| pip-audit-default | 45.23 MB | 4.52x |
|
|
56
|
+
| pysentry-pypa | 53.56 MB | 5.35x |
|
|
57
|
+
| pysentry-all-sources | 93.25 MB | 9.31x |
|
|
58
|
+
|
|
59
|
+
### Small_Requirements Dataset - Hot Cache
|
|
60
|
+
|
|
61
|
+
#### Execution Time Comparison
|
|
62
|
+
|
|
63
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
64
|
+
|---------------------|---------------------|---------------------|
|
|
65
|
+
| 🥇 pysentry-pypi | 0.261s | 1.00x |
|
|
66
|
+
| 🥈 pysentry-osv | 0.999s | 3.82x |
|
|
67
|
+
| pysentry-pypa | 1.373s | 5.25x |
|
|
68
|
+
| pysentry-all-sources | 1.446s | 5.53x |
|
|
69
|
+
| pip-audit-default | 8.027s | 30.71x |
|
|
70
|
+
|
|
71
|
+
#### Memory Usage Comparison
|
|
72
|
+
|
|
73
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
74
|
+
|---------------------|---------------------|---------------------|
|
|
75
|
+
| 🥇 pysentry-pypi | 9.69 MB | 1.00x |
|
|
76
|
+
| 🥈 pysentry-osv | 10.16 MB | 1.05x |
|
|
77
|
+
| pip-audit-default | 45.01 MB | 4.64x |
|
|
78
|
+
| pysentry-pypa | 62.62 MB | 6.46x |
|
|
79
|
+
| pysentry-all-sources | 107.48 MB | 11.09x |
|
|
80
|
+
|
|
81
|
+
### Large_Requirements Dataset - Cold Cache
|
|
82
|
+
|
|
83
|
+
#### Execution Time Comparison
|
|
84
|
+
|
|
85
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
86
|
+
|---------------------|---------------------|---------------------|
|
|
87
|
+
| 🥇 pysentry-pypi | 1.160s | 1.00x |
|
|
88
|
+
| 🥈 pysentry-pypa | 1.800s | 1.55x |
|
|
89
|
+
| pysentry-osv | 3.256s | 2.81x |
|
|
90
|
+
| pysentry-all-sources | 3.333s | 2.87x |
|
|
91
|
+
| pip-audit-default | 21.160s | 18.24x |
|
|
92
|
+
|
|
93
|
+
#### Memory Usage Comparison
|
|
94
|
+
|
|
95
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
96
|
+
|---------------------|---------------------|---------------------|
|
|
97
|
+
| 🥇 pysentry-osv | 10.34 MB | 1.00x |
|
|
98
|
+
| 🥈 pysentry-pypi | 13.09 MB | 1.27x |
|
|
99
|
+
| pip-audit-default | 47.49 MB | 4.59x |
|
|
100
|
+
| pysentry-pypa | 55.27 MB | 5.34x |
|
|
101
|
+
| pysentry-all-sources | 107.62 MB | 10.40x |
|
|
102
|
+
|
|
103
|
+
### Large_Requirements Dataset - Hot Cache
|
|
104
|
+
|
|
105
|
+
#### Execution Time Comparison
|
|
106
|
+
|
|
107
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
108
|
+
|---------------------|---------------------|---------------------|
|
|
109
|
+
| 🥇 pysentry-pypi | 0.740s | 1.00x |
|
|
110
|
+
| 🥈 pysentry-pypa | 1.814s | 2.45x |
|
|
111
|
+
| pysentry-osv | 3.453s | 4.67x |
|
|
112
|
+
| pysentry-all-sources | 3.757s | 5.08x |
|
|
113
|
+
| pip-audit-default | 16.199s | 21.90x |
|
|
114
|
+
|
|
115
|
+
#### Memory Usage Comparison
|
|
116
|
+
|
|
117
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
118
|
+
|---------------------|---------------------|---------------------|
|
|
119
|
+
| 🥇 pysentry-osv | 10.33 MB | 1.00x |
|
|
120
|
+
| 🥈 pysentry-pypi | 12.99 MB | 1.26x |
|
|
121
|
+
| pip-audit-default | 46.97 MB | 4.55x |
|
|
122
|
+
| pysentry-pypa | 74.16 MB | 7.18x |
|
|
123
|
+
| pysentry-all-sources | 105.66 MB | 10.23x |
|
|
124
|
+
|
|
125
|
+
## Detailed Analysis
|
|
126
|
+
|
|
127
|
+
### Pysentry Performance
|
|
128
|
+
|
|
129
|
+
- **Execution Time:** Avg: 1.737s, Min: 0.261s, Max: 3.757s
|
|
130
|
+
|
|
131
|
+
- **Memory Usage:** Avg: 46.75 MB, Min: 9.69 MB, Max: 107.62 MB
|
|
132
|
+
|
|
133
|
+
- **Success Rate:** 100.0% (16/16)
|
|
134
|
+
|
|
135
|
+
### Pip-Audit Performance
|
|
136
|
+
|
|
137
|
+
- **Execution Time:** Avg: 13.652s, Min: 8.027s, Max: 21.160s
|
|
138
|
+
|
|
139
|
+
- **Memory Usage:** Avg: 46.17 MB, Min: 45.01 MB, Max: 47.49 MB
|
|
140
|
+
|
|
141
|
+
- **Success Rate:** 100.0% (4/4)
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# PySentry - pip-audit Benchmark Report
|
|
2
|
+
|
|
3
|
+
**Generated:** 2025-08-12 00:03:24
|
|
4
|
+
**Duration:** 2m 3.83s
|
|
5
|
+
**Total Tests:** 20
|
|
6
|
+
|
|
7
|
+
## Executive Summary
|
|
8
|
+
|
|
9
|
+
**Overall Success Rate:** 100.0% (20/20 successful runs)
|
|
10
|
+
|
|
11
|
+
### Small_Requirements Dataset - Cold Cache
|
|
12
|
+
- **Fastest:** pysentry-pypi (0.382s) - 24.16x faster than slowest
|
|
13
|
+
- **Memory Efficient:** pysentry-osv (10.01 MB) - 9.31x less memory than highest
|
|
14
|
+
|
|
15
|
+
### Small_Requirements Dataset - Hot Cache
|
|
16
|
+
- **Fastest:** pysentry-pypi (0.261s) - 30.71x faster than slowest
|
|
17
|
+
- **Memory Efficient:** pysentry-pypi (9.69 MB) - 11.09x less memory than highest
|
|
18
|
+
|
|
19
|
+
### Large_Requirements Dataset - Cold Cache
|
|
20
|
+
- **Fastest:** pysentry-pypi (1.160s) - 18.24x faster than slowest
|
|
21
|
+
- **Memory Efficient:** pysentry-osv (10.34 MB) - 10.40x less memory than highest
|
|
22
|
+
|
|
23
|
+
### Large_Requirements Dataset - Hot Cache
|
|
24
|
+
- **Fastest:** pysentry-pypi (0.740s) - 21.90x faster than slowest
|
|
25
|
+
- **Memory Efficient:** pysentry-osv (10.33 MB) - 10.23x less memory than highest
|
|
26
|
+
|
|
27
|
+
## Test Environment
|
|
28
|
+
|
|
29
|
+
- **Platform:** Linux-6.11.0-1018-azure-x86_64-with-glibc2.39
|
|
30
|
+
- **Python Version:** 3.11.13
|
|
31
|
+
- **CPU Cores:** 4
|
|
32
|
+
- **Total Memory:** 15.62 GB
|
|
33
|
+
- **Available Memory:** 14.65 GB
|
|
34
|
+
|
|
35
|
+
## Performance Comparison
|
|
36
|
+
|
|
37
|
+
### Small_Requirements Dataset - Cold Cache
|
|
38
|
+
|
|
39
|
+
#### Execution Time Comparison
|
|
40
|
+
|
|
41
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
42
|
+
|---------------------|---------------------|---------------------|
|
|
43
|
+
| 🥇 pysentry-pypi | 0.382s | 1.00x |
|
|
44
|
+
| 🥈 pysentry-osv | 1.080s | 2.83x |
|
|
45
|
+
| pysentry-all-sources | 1.468s | 3.85x |
|
|
46
|
+
| pysentry-pypa | 1.475s | 3.86x |
|
|
47
|
+
| pip-audit-default | 9.222s | 24.16x |
|
|
48
|
+
|
|
49
|
+
#### Memory Usage Comparison
|
|
50
|
+
|
|
51
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
52
|
+
|---------------------|---------------------|---------------------|
|
|
53
|
+
| 🥇 pysentry-osv | 10.01 MB | 1.00x |
|
|
54
|
+
| 🥈 pysentry-pypi | 11.70 MB | 1.17x |
|
|
55
|
+
| pip-audit-default | 45.23 MB | 4.52x |
|
|
56
|
+
| pysentry-pypa | 53.56 MB | 5.35x |
|
|
57
|
+
| pysentry-all-sources | 93.25 MB | 9.31x |
|
|
58
|
+
|
|
59
|
+
### Small_Requirements Dataset - Hot Cache
|
|
60
|
+
|
|
61
|
+
#### Execution Time Comparison
|
|
62
|
+
|
|
63
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
64
|
+
|---------------------|---------------------|---------------------|
|
|
65
|
+
| 🥇 pysentry-pypi | 0.261s | 1.00x |
|
|
66
|
+
| 🥈 pysentry-osv | 0.999s | 3.82x |
|
|
67
|
+
| pysentry-pypa | 1.373s | 5.25x |
|
|
68
|
+
| pysentry-all-sources | 1.446s | 5.53x |
|
|
69
|
+
| pip-audit-default | 8.027s | 30.71x |
|
|
70
|
+
|
|
71
|
+
#### Memory Usage Comparison
|
|
72
|
+
|
|
73
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
74
|
+
|---------------------|---------------------|---------------------|
|
|
75
|
+
| 🥇 pysentry-pypi | 9.69 MB | 1.00x |
|
|
76
|
+
| 🥈 pysentry-osv | 10.16 MB | 1.05x |
|
|
77
|
+
| pip-audit-default | 45.01 MB | 4.64x |
|
|
78
|
+
| pysentry-pypa | 62.62 MB | 6.46x |
|
|
79
|
+
| pysentry-all-sources | 107.48 MB | 11.09x |
|
|
80
|
+
|
|
81
|
+
### Large_Requirements Dataset - Cold Cache
|
|
82
|
+
|
|
83
|
+
#### Execution Time Comparison
|
|
84
|
+
|
|
85
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
86
|
+
|---------------------|---------------------|---------------------|
|
|
87
|
+
| 🥇 pysentry-pypi | 1.160s | 1.00x |
|
|
88
|
+
| 🥈 pysentry-pypa | 1.800s | 1.55x |
|
|
89
|
+
| pysentry-osv | 3.256s | 2.81x |
|
|
90
|
+
| pysentry-all-sources | 3.333s | 2.87x |
|
|
91
|
+
| pip-audit-default | 21.160s | 18.24x |
|
|
92
|
+
|
|
93
|
+
#### Memory Usage Comparison
|
|
94
|
+
|
|
95
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
96
|
+
|---------------------|---------------------|---------------------|
|
|
97
|
+
| 🥇 pysentry-osv | 10.34 MB | 1.00x |
|
|
98
|
+
| 🥈 pysentry-pypi | 13.09 MB | 1.27x |
|
|
99
|
+
| pip-audit-default | 47.49 MB | 4.59x |
|
|
100
|
+
| pysentry-pypa | 55.27 MB | 5.34x |
|
|
101
|
+
| pysentry-all-sources | 107.62 MB | 10.40x |
|
|
102
|
+
|
|
103
|
+
### Large_Requirements Dataset - Hot Cache
|
|
104
|
+
|
|
105
|
+
#### Execution Time Comparison
|
|
106
|
+
|
|
107
|
+
| Tool Configuration | Execution Time | Relative Performance |
|
|
108
|
+
|---------------------|---------------------|---------------------|
|
|
109
|
+
| 🥇 pysentry-pypi | 0.740s | 1.00x |
|
|
110
|
+
| 🥈 pysentry-pypa | 1.814s | 2.45x |
|
|
111
|
+
| pysentry-osv | 3.453s | 4.67x |
|
|
112
|
+
| pysentry-all-sources | 3.757s | 5.08x |
|
|
113
|
+
| pip-audit-default | 16.199s | 21.90x |
|
|
114
|
+
|
|
115
|
+
#### Memory Usage Comparison
|
|
116
|
+
|
|
117
|
+
| Tool Configuration | Peak Memory | Relative Performance |
|
|
118
|
+
|---------------------|---------------------|---------------------|
|
|
119
|
+
| 🥇 pysentry-osv | 10.33 MB | 1.00x |
|
|
120
|
+
| 🥈 pysentry-pypi | 12.99 MB | 1.26x |
|
|
121
|
+
| pip-audit-default | 46.97 MB | 4.55x |
|
|
122
|
+
| pysentry-pypa | 74.16 MB | 7.18x |
|
|
123
|
+
| pysentry-all-sources | 105.66 MB | 10.23x |
|
|
124
|
+
|
|
125
|
+
## Detailed Analysis
|
|
126
|
+
|
|
127
|
+
### Pysentry Performance
|
|
128
|
+
|
|
129
|
+
- **Execution Time:** Avg: 1.737s, Min: 0.261s, Max: 3.757s
|
|
130
|
+
|
|
131
|
+
- **Memory Usage:** Avg: 46.75 MB, Min: 9.69 MB, Max: 107.62 MB
|
|
132
|
+
|
|
133
|
+
- **Success Rate:** 100.0% (16/16)
|
|
134
|
+
|
|
135
|
+
### Pip-Audit Performance
|
|
136
|
+
|
|
137
|
+
- **Execution Time:** Avg: 13.652s, Min: 8.027s, Max: 21.160s
|
|
138
|
+
|
|
139
|
+
- **Memory Usage:** Avg: 46.17 MB, Min: 45.01 MB, Max: 47.49 MB
|
|
140
|
+
|
|
141
|
+
- **Success Rate:** 100.0% (4/4)
|