Skip to content

Commit

Permalink
chore(deps-dev): Bump black from 23.12.0 to 24.1.1 (#470)
Browse files Browse the repository at this point in the history
* chore(deps-dev): Bump black from 23.12.0 to 24.1.1
Signed-off-by: Christopher Phillips <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Christopher Phillips <[email protected]>
  • Loading branch information
dependabot[bot] and spiffcs authored Feb 7, 2024
1 parent 8be96dc commit 87c5fd4
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 51 deletions.
56 changes: 28 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mashumaro = "^3.10"
[tool.poetry.group.dev.dependencies]
pytest = ">=7.2.2,<9.0.0"
pre-commit = "^3.2.0"
black = "^23.1.0"
black = ">=23.1,<25.0"
jsonschema = "^4.17.3"
pytest-unordered = "^0.5.2"
pytest-sugar = ">=0.9.6,<1.1.0"
Expand Down
1 change: 1 addition & 0 deletions src/vunnel/providers/github/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
headers = {"Authorization": "Bearer XYZ123TOKENTOKENTOKEN"}
"""

from __future__ import annotations

import datetime
Expand Down
22 changes: 12 additions & 10 deletions src/vunnel/providers/nvd/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ def __init__(self, api_key: str | None = None, logger: logging.Logger | None = N
def cve_history(
self,
cve_id: str | None = None,
results_per_page: int
| None = None, # from api docs: "it is recommended that users of the CVE API use the default resultsPerPage value"
change_start_date: str
| datetime.datetime
| None = None, # note: if you specify a changeStartDate, you must also specify a changeEndDate
results_per_page: (
int | None
) = None, # from api docs: "it is recommended that users of the CVE API use the default resultsPerPage value"
change_start_date: (
str | datetime.datetime | None
) = None, # note: if you specify a changeStartDate, you must also specify a changeEndDate
change_end_date: str | datetime.datetime | None = None, # note: maximum date range is 120 days
) -> Generator[dict[str, Any], Any, None]:
parameters = {}
Expand Down Expand Up @@ -64,13 +65,14 @@ def cve_history(
def cve( # noqa: PLR0913
self,
cve_id: str | None = None,
results_per_page: int
| None = None, # from api docs: "it is recommended that users of the CVE API use the default resultsPerPage value"
results_per_page: (
int | None
) = None, # from api docs: "it is recommended that users of the CVE API use the default resultsPerPage value"
last_mod_start_date: str | datetime.datetime | None = None,
last_mod_end_date: str | datetime.datetime | None = None,
pub_start_date: str
| datetime.datetime
| None = None, # note: if you specify a pubStartDate, you must also specify a pubEndDate
pub_start_date: (
str | datetime.datetime | None
) = None, # note: if you specify a pubStartDate, you must also specify a pubEndDate
pub_end_date: str | datetime.datetime | None = None, # note: maximum date range is 120 days
) -> Generator[dict[str, Any], Any, None]:
parameters = {}
Expand Down
18 changes: 10 additions & 8 deletions src/vunnel/providers/rhel/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,14 +584,16 @@ def _parse_affected_release(self, cve_id: str, content) -> list[FixedIn]: # noq
package=ar_obj.name,
version=ar_obj.version,
module=ar_obj.module,
advisory=Advisory(
wont_fix=False,
rhsa_id=ar_obj.rhsa_id,
link=f"https://access.redhat.com/errata/{ar_obj.rhsa_id}",
severity=None,
)
if ar_obj.rhsa_id
else Advisory(wont_fix=False, rhsa_id=None, link=None, severity=None),
advisory=(
Advisory(
wont_fix=False,
rhsa_id=ar_obj.rhsa_id,
link=f"https://access.redhat.com/errata/{ar_obj.rhsa_id}",
severity=None,
)
if ar_obj.rhsa_id
else Advisory(wont_fix=False, rhsa_id=None, link=None, severity=None)
),
)
for ar_obj in final_ar_objs.values()
]
Expand Down
1 change: 1 addition & 0 deletions src/vunnel/utils/fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
a dictionary and serialized to and from JSON. This metadata file gets created
if it doesn't exist.
"""

from __future__ import annotations

import os
Expand Down
4 changes: 2 additions & 2 deletions src/vunnel/utils/oval_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Each section is associated with a parser that can be overridden by the driver. Parsed output represents a view of the
OVAL content, it's up to the driver to transform it into normalized feed data
"""

from __future__ import annotations

import enum
Expand Down Expand Up @@ -93,8 +94,7 @@ class OVALElementParser(ABC):

@staticmethod
@abstractmethod
def parse(xml_element: ET.Element, config: OVALParserConfig) -> Parsed | None:
...
def parse(xml_element: ET.Element, config: OVALParserConfig) -> Parsed | None: ...

@staticmethod
def _find_with_regex(data: str, regex: re.Pattern):
Expand Down
1 change: 1 addition & 0 deletions src/vunnel/utils/rpm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
RPM utilities with no binary dependencies on rpm or rpmUtil.
"""

from __future__ import annotations


Expand Down
4 changes: 2 additions & 2 deletions tests/unit/providers/rhel/test_rhel.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_parse_affected_releases_0(self, mock_cve, tmpdir):
{
"product_name": "Red Hat Enterprise Linux 8",
"advisory": "RHSA-2019:3345",
"package": "virt:rhel-8010020190916153839.cdc1202b"
"package": "virt:rhel-8010020190916153839.cdc1202b",
# package name lookup using RHSA and other packages shouldn't yield any results
},
],
Expand Down Expand Up @@ -310,7 +310,7 @@ def test_parse_affected_releases_0(self, mock_cve, tmpdir):
{
"product_name": "Red Hat Enterprise Linux 8",
"advisory": "RHSA-2019:5678",
"package": "virt:rhel-8010020190916153839.cdc1202b"
"package": "virt:rhel-8010020190916153839.cdc1202b",
# RHSA lookup shouldn't yield results
},
],
Expand Down

0 comments on commit 87c5fd4

Please sign in to comment.