Skip to content

Commit 1680cd3

Browse files
committed
update workflow
1 parent cd710fd commit 1680cd3

File tree

6 files changed

+111
-187
lines changed

6 files changed

+111
-187
lines changed

.github/workflows/quality.yml

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
uses: astral-sh/setup-uv@v5
2424
with:
2525
version: "latest"
26+
enable-cache: true
27+
cache-dependency-glob: "**/uv.lock"
2628

2729
- name: Set up Python
2830
run: uv python install 3.11
@@ -43,42 +45,9 @@ jobs:
4345
run: uv run mypy hyperdb/ --ignore-missing-imports
4446

4547
- name: Security check with bandit
46-
run: uv run bandit -r hyperdb/ -f json -o bandit-report.json
48+
run: uv run bandit -r hyperdb/ --severity-level medium
4749
continue-on-error: true
4850

49-
- name: Upload bandit report
50-
uses: actions/upload-artifact@v4
51-
if: always()
52-
with:
53-
name: bandit-report
54-
path: bandit-report.json
55-
56-
dependency-check:
57-
name: Dependency vulnerability check
58-
runs-on: ubuntu-latest
59-
60-
steps:
61-
- name: Checkout code
62-
uses: actions/checkout@v4
63-
64-
- name: Install uv
65-
uses: astral-sh/setup-uv@v5
66-
with:
67-
version: "latest"
68-
69-
- name: Set up Python
70-
run: uv python install 3.11
71-
72-
- name: Install dependencies
73-
run: uv sync --group dev
74-
7551
- name: Run safety check
76-
run: uv run safety check --json --output safety-report.json
52+
run: uv run safety check
7753
continue-on-error: true
78-
79-
- name: Upload safety report
80-
uses: actions/upload-artifact@v4
81-
if: always()
82-
with:
83-
name: safety-report
84-
path: safety-report.json

hyperdb/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
from ._global import AUTHOR_EMAIL
12
from .base import BaseHypergraphDB
23
from .hypergraph import HypergraphDB
34

4-
from ._global import AUTHOR_EMAIL
5-
65
__version__ = "0.2.0"
76

87
__all__ = {"AUTHOR_EMAIL", "BaseHypergraphDB", "HypergraphDB"}

hyperdb/base.py

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
from pathlib import Path
21
from dataclasses import dataclass, field
32
from functools import cached_property
4-
from typing import Union, Tuple, List, Set, Dict, Any, Optional
3+
from pathlib import Path
4+
from typing import Any, Dict, List, Optional, Set, Tuple, Union
55

66

77
@dataclass
@@ -99,14 +99,14 @@ def all_e(self) -> List[Tuple]:
9999
Return a list of all hyperedges in the hypergraph.
100100
"""
101101
raise NotImplementedError
102-
102+
103103
@cached_property
104104
def num_v(self) -> int:
105105
r"""
106106
Return the number of vertices in the hypergraph.
107107
"""
108108
raise NotImplementedError
109-
109+
110110
@cached_property
111111
def num_e(self) -> int:
112112
r"""
@@ -283,24 +283,19 @@ def stats(self) -> dict:
283283
Return basic statistics of the hypergraph.
284284
"""
285285
raise NotImplementedError
286-
286+
287287
def draw(self, port: int = 8080, open_browser: bool = True, blocking: bool = True):
288288
"""
289289
Draw the hypergraph data of the current HyperDB instance
290-
291-
Args:
292-
``port``: Server port number, defaults to 8080
290+
291+
Args:
292+
``port``: Server port number, defaults to 8080
293293
``open_browser``: Whether to automatically open the browser, defaults to True
294294
``blocking``: Whether to block the main thread, defaults to True. Set to False for non-blocking mode.
295295
296296
Returns:
297297
HypergraphViewer instance
298298
"""
299299
from .draw import draw_hypergraph
300-
301-
return draw_hypergraph(
302-
hypergraph_db=self,
303-
port=port,
304-
open_browser=open_browser,
305-
blocking=blocking
306-
)
300+
301+
return draw_hypergraph(hypergraph_db=self, port=port, open_browser=open_browser, blocking=blocking)

0 commit comments

Comments
 (0)