Spaces:
Running
Running
Commit
·
a5b0db7
1
Parent(s):
995dcf8
fix: make runnable within local uv env
Browse files- pyproject.toml +25 -1
- src/display/utils.py +24 -22
- uv.lock +0 -0
pyproject.toml
CHANGED
@@ -1,9 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
[tool.ruff]
|
2 |
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
|
3 |
select = ["E", "F"]
|
4 |
ignore = ["E501"] # line too long (black is taking care of this)
|
5 |
line-length = 119
|
6 |
-
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "
|
7 |
|
8 |
[tool.isort]
|
9 |
profile = "black"
|
|
|
1 |
+
[project]
|
2 |
+
name = "libvulnwatchleaderboard"
|
3 |
+
version = "0.1.0"
|
4 |
+
description = "A vulnerability assessment leaderboard for libraries"
|
5 |
+
requires-python = ">=3.8"
|
6 |
+
dependencies = [
|
7 |
+
"APScheduler",
|
8 |
+
"black",
|
9 |
+
"datasets",
|
10 |
+
"gradio",
|
11 |
+
"gradio[oauth]",
|
12 |
+
"gradio_leaderboard==0.0.13",
|
13 |
+
"gradio_client",
|
14 |
+
"huggingface-hub>=0.18.0",
|
15 |
+
"matplotlib",
|
16 |
+
"numpy",
|
17 |
+
"pandas",
|
18 |
+
"python-dateutil",
|
19 |
+
"tqdm",
|
20 |
+
"transformers",
|
21 |
+
"tokenizers>=0.15.0",
|
22 |
+
"sentencepiece",
|
23 |
+
]
|
24 |
+
|
25 |
[tool.ruff]
|
26 |
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
|
27 |
select = ["E", "F"]
|
28 |
ignore = ["E501"] # line too long (black is taking care of this)
|
29 |
line-length = 119
|
30 |
+
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TID", "TRY", "UP", "YTT"]
|
31 |
|
32 |
[tool.isort]
|
33 |
profile = "black"
|
src/display/utils.py
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
-
from dataclasses import dataclass
|
2 |
from enum import Enum
|
3 |
|
4 |
-
import pandas as pd
|
5 |
-
|
6 |
from src.about import Tasks
|
7 |
|
8 |
def fields(raw_class):
|
@@ -21,28 +19,32 @@ class ColumnContent:
|
|
21 |
never_hidden: bool = False
|
22 |
|
23 |
## Leaderboard columns
|
24 |
-
|
|
|
|
|
25 |
# Init
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
30 |
for task in Tasks:
|
31 |
-
|
|
|
32 |
# Library information
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
#
|
45 |
-
AutoEvalColumn =
|
46 |
|
47 |
## For the queue columns in the submission tab
|
48 |
@dataclass(frozen=True)
|
|
|
1 |
+
from dataclasses import dataclass
|
2 |
from enum import Enum
|
3 |
|
|
|
|
|
4 |
from src.about import Tasks
|
5 |
|
6 |
def fields(raw_class):
|
|
|
19 |
never_hidden: bool = False
|
20 |
|
21 |
## Leaderboard columns
|
22 |
+
# Create a dictionary to hold the class attributes
|
23 |
+
auto_eval_column_attrs = {}
|
24 |
+
|
25 |
# Init
|
26 |
+
auto_eval_column_attrs["library_type_symbol"] = ColumnContent("T", "str", True, never_hidden=True)
|
27 |
+
auto_eval_column_attrs["library"] = ColumnContent("Library", "markdown", True, never_hidden=True)
|
28 |
+
|
29 |
+
# Scores
|
30 |
+
auto_eval_column_attrs["overall_risk"] = ColumnContent("Trust Score ⬇️", "number", True)
|
31 |
for task in Tasks:
|
32 |
+
auto_eval_column_attrs[task.name] = ColumnContent(task.value.col_name, "number", True)
|
33 |
+
|
34 |
# Library information
|
35 |
+
auto_eval_column_attrs["library_type"] = ColumnContent("Type", "str", False)
|
36 |
+
auto_eval_column_attrs["framework"] = ColumnContent("Framework", "str", False)
|
37 |
+
auto_eval_column_attrs["version"] = ColumnContent("Version", "str", False, False)
|
38 |
+
auto_eval_column_attrs["language"] = ColumnContent("Language", "str", False)
|
39 |
+
auto_eval_column_attrs["license_name"] = ColumnContent("License", "str", True)
|
40 |
+
auto_eval_column_attrs["stars"] = ColumnContent("GitHub ⭐", "number", False)
|
41 |
+
auto_eval_column_attrs["last_update"] = ColumnContent("Last Updated", "str", False)
|
42 |
+
auto_eval_column_attrs["verified"] = ColumnContent("Independently Verified", "bool", False)
|
43 |
+
auto_eval_column_attrs["availability"] = ColumnContent("Active Maintenance", "bool", True)
|
44 |
+
auto_eval_column_attrs["report_url"] = ColumnContent("Report", "str", True)
|
45 |
+
|
46 |
+
# Create the dataclass with class attributes
|
47 |
+
AutoEvalColumn = type("AutoEvalColumn", (), auto_eval_column_attrs)
|
48 |
|
49 |
## For the queue columns in the submission tab
|
50 |
@dataclass(frozen=True)
|
uv.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|