Skip to content

Commit 35ddb6b

Browse files
ckunkiahsimb
andauthored
#750: Updated dependency pip-audit (#754)
Co-authored-by: Mikhail Beck <mikhail.beck@exasol.com>
1 parent 39e3244 commit 35ddb6b

15 files changed

Lines changed: 232 additions & 90 deletions

File tree

.github/actions/security-issues/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
- name: Install Python Toolbox / Security tool
4040
shell: bash
4141
run: |
42-
pip install exasol-toolbox==6.1.0
42+
pip install exasol-toolbox==6.1.1
4343
4444
- name: Create Security Issue Report
4545
shell: bash

doc/changes/changelog.md

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/changes/changes_6.1.1.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# 6.1.1 - 2026-03-18
2+
3+
## Summary
4+
5+
## Security Issues
6+
7+
* #748: Updated dependency to `black`
8+
9+
## Refactorings
10+
11+
* #752: Updated upload-artifact from v6 to v7 and download-artifact from v7 to v8
12+
* #750: Updated dependency `pip-audit`
13+
14+
## Dependency Updates
15+
16+
### `main`
17+
18+
* Updated dependency `bandit:1.9.3` to `1.9.4`
19+
* Updated dependency `black:25.12.0` to `26.3.1`
20+
* Updated dependency `coverage:7.13.1` to `7.13.4`
21+
* Updated dependency `import-linter:2.9` to `2.11`
22+
* Updated dependency `nox:2025.11.12` to `2026.2.9`
23+
* Updated dependency `pip-audit:2.9.0` to `2.10.0`
24+
* Updated dependency `pip-licenses:5.5.0` to `5.5.1`
25+
* Updated dependency `pylint:4.0.4` to `4.0.5`
26+
* Updated dependency `ruff:0.14.13` to `0.14.14`
27+
* Updated dependency `sphinxcontrib-mermaid:2.0.0` to `2.0.1`
28+
* Updated dependency `typer:0.21.1` to `0.24.1`
29+
30+
### `dev`
31+
32+
* Updated dependency `cookiecutter:2.6.0` to `2.7.1`

doc/changes/unreleased.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
# Unreleased
22

33
## Summary
4-
5-
## Security Issues
6-
7-
* #748: Updated dependency to `black`
8-
9-
## Refactoring
10-
11-
* #752: Updated upload-artifact from v6 to v7 and download-artifact from v7 to v8

exasol/toolbox/nox/_dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def audit(session: Session) -> None:
3535
try:
3636
vulnerabilities = Vulnerabilities.load_from_pip_audit(working_directory=Path())
3737
except PipAuditException as e:
38-
session.error(e.return_code, e.stdout, e.stderr)
38+
session.error(e.returncode, e.stdout, e.stderr)
3939

4040
security_issue_dict = vulnerabilities.security_issue_dict
4141
print(json.dumps(security_issue_dict, indent=2))

exasol/toolbox/util/dependencies/audit.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@
2727
)
2828

2929

30+
PipAuditEntry = dict[str, str | list[str] | tuple[str, ...]]
31+
32+
3033
@dataclass
3134
class PipAuditException(Exception):
32-
return_code: int
35+
returncode: int
3336
stdout: str
3437
stderr: str
3538

36-
def __init__(self, subprocess_output: subprocess.CompletedProcess) -> None:
37-
self.return_code = subprocess_output.returncode
38-
self.stdout = subprocess_output.stdout
39-
self.stderr = subprocess_output.stderr
39+
@classmethod
40+
def from_subprocess(cls, proc: subprocess.CompletedProcess) -> PipAuditException:
41+
return cls(proc.returncode, proc.stdout, proc.stderr)
4042

4143

4244
class VulnerabilitySource(str, Enum):
@@ -102,7 +104,7 @@ def reference_links(self) -> tuple[str, ...]:
102104
)
103105

104106
@property
105-
def security_issue_entry(self) -> dict[str, str | list[str] | tuple[str, ...]]:
107+
def security_issue_entry(self) -> PipAuditEntry:
106108
return {
107109
"name": self.package.name,
108110
"version": str(self.package.version),
@@ -132,10 +134,20 @@ def subsection_for_changelog_summary(self) -> str:
132134
"""
133135
Create a subsection to be included in the Summary section of a versioned changelog.
134136
"""
135-
links_join = "\n* ".join(sorted(self.reference_links))
136-
references_subsection = f"\n#### References:\n\n* {links_join}\n\n "
137-
subsection = f"### {self.vulnerability_id} in {self.package.coordinates}\n\n{self.description}\n{references_subsection}"
138-
return cleandoc(subsection.strip())
137+
indent = " " * 12
138+
references = f"\n{indent}".join(
139+
f"* {link}" for link in sorted(self.reference_links)
140+
)
141+
description = self.description.replace("\n", f"\n{indent}")
142+
return cleandoc(f"""
143+
### {self.vulnerability_id} in {self.package.coordinates}
144+
145+
{description}
146+
147+
#### References
148+
149+
{references}
150+
""")
139151

140152

141153
def audit_poetry_files(working_directory: Path) -> str:
@@ -159,7 +171,7 @@ def audit_poetry_files(working_directory: Path) -> str:
159171
cwd=working_directory,
160172
) # nosec
161173
if output.returncode != 0:
162-
raise PipAuditException(subprocess_output=output)
174+
raise PipAuditException.from_subprocess(output)
163175

164176
with tempfile.TemporaryDirectory() as path:
165177
tmpdir = Path(path)
@@ -179,7 +191,7 @@ def audit_poetry_files(working_directory: Path) -> str:
179191
# they both map to returncode = 1, so we have our own logic to raise errors
180192
# for the case of 2) and not 1).
181193
if not search(PIP_AUDIT_VULNERABILITY_PATTERN, output.stderr.strip()):
182-
raise PipAuditException(subprocess_output=output)
194+
raise PipAuditException.from_subprocess(output)
183195
return output.stdout
184196

185197

@@ -215,7 +227,7 @@ def load_from_pip_audit(cls, working_directory: Path) -> Vulnerabilities:
215227
return Vulnerabilities(vulnerabilities=vulnerabilities)
216228

217229
@property
218-
def security_issue_dict(self) -> list[dict[str, str | list[str] | tuple[str, ...]]]:
230+
def security_issue_dict(self) -> list[PipAuditEntry]:
219231
return [
220232
vulnerability.security_issue_entry for vulnerability in self.vulnerabilities
221233
]

exasol/toolbox/version.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

poetry.lock

Lines changed: 24 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

project-template/cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"author_email": "opensource@exasol.com",
1010
"project_short_tag": "",
1111
"python_version_min": "3.10",
12-
"exasol_toolbox_version_range": ">=6.1.0,<7",
12+
"exasol_toolbox_version_range": ">=6.1.1,<7",
1313
"license_year": "{% now 'utc', '%Y' %}",
1414
"__repo_name_slug": "{{cookiecutter.package_name}}",
1515
"__package_name_slug": "{{cookiecutter.package_name}}",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "exasol-toolbox"
3-
version = "6.1.0"
3+
version = "6.1.1"
44
description = "Your one-stop solution for managing all standard tasks and core workflows of your Python project."
55
authors = [
66
{ name = "Nicola Coretti", email = "nicola.coretti@exasol.com" },
@@ -38,7 +38,7 @@ dependencies = [
3838
"mypy>=0.971",
3939
"myst-parser>=2.0.0,<4",
4040
"nox>=2022.8.7",
41-
"pip-audit>=2.7.3,<2.10.0", # see issue https://github.com/exasol/python-toolbox/issues/750
41+
"pip-audit>=2.10,<3",
4242
"pip-licenses>=5.0.0,<6",
4343
"pluggy>=1.5.0,<2",
4444
"pre-commit>=4,<5",

0 commit comments

Comments
 (0)