Skip to content

Commit 061433a

Browse files
authored
Merge pull request #14 from cisagov/lineage/skeleton
⚠️ CONFLICT! Lineage pull request for: skeleton
2 parents 90b347a + 36abd32 commit 061433a

File tree

9 files changed

+40
-45
lines changed

9 files changed

+40
-45
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
101101
- id: setup-env
102102
uses: cisagov/setup-env-github-action@v1
103-
- uses: actions/checkout@v5
103+
- uses: actions/checkout@v6
104104
- id: setup-python
105105
uses: actions/setup-python@v6
106106
with:
@@ -253,7 +253,7 @@ jobs:
253253
# monitoring configuration *does not* require you to modify
254254
# this workflow.
255255
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
256-
- uses: actions/checkout@v5
256+
- uses: actions/checkout@v6
257257
- id: setup-python
258258
uses: actions/setup-python@v6
259259
with:
@@ -326,7 +326,7 @@ jobs:
326326
# monitoring configuration *does not* require you to modify
327327
# this workflow.
328328
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
329-
- uses: actions/checkout@v5
329+
- uses: actions/checkout@v6
330330
- name: Finished coveralls reports
331331
uses: coverallsapp/github-action@v2
332332
with:
@@ -378,7 +378,7 @@ jobs:
378378
# monitoring configuration *does not* require you to modify
379379
# this workflow.
380380
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
381-
- uses: actions/checkout@v5
381+
- uses: actions/checkout@v6
382382
- id: setup-python
383383
uses: actions/setup-python@v6
384384
with:
@@ -404,7 +404,7 @@ jobs:
404404
- name: Build artifacts
405405
run: python -m build
406406
- name: Upload artifacts
407-
uses: actions/upload-artifact@v5
407+
uses: actions/upload-artifact@v6
408408
with:
409409
name: dist-${{ matrix.python-version }}
410410
path: dist
@@ -465,7 +465,7 @@ jobs:
465465
# monitoring configuration *does not* require you to modify
466466
# this workflow.
467467
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
468-
- uses: actions/checkout@v5
468+
- uses: actions/checkout@v6
469469
- id: setup-python
470470
uses: actions/setup-python@v6
471471
with:
@@ -486,7 +486,7 @@ jobs:
486486
restore-keys: |
487487
${{ env.BASE_CACHE_KEY }}
488488
- name: Retrieve the built wheel
489-
uses: actions/download-artifact@v6
489+
uses: actions/download-artifact@v7
490490
with:
491491
name: dist-${{ matrix.python-version }}
492492
path: dist

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
115115

116116
- name: Checkout repository
117-
uses: actions/checkout@v5
117+
uses: actions/checkout@v6
118118

119119
# Initializes the CodeQL tools for scanning.
120120
- name: Initialize CodeQL

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
9090
- id: checkout-repo
9191
name: Checkout the repository
92-
uses: actions/checkout@v5
92+
uses: actions/checkout@v6
9393
- id: dependency-review
9494
name: Review dependency changes for vulnerabilities and license changes
9595
uses: actions/dependency-review-action@v4

.github/workflows/sync-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
# monitoring configuration *does not* require you to modify
8585
# this workflow.
8686
permissions_monitoring_config: ${{ vars.ACTIONS_PERMISSIONS_CONFIG }}
87-
- uses: actions/checkout@v5
87+
- uses: actions/checkout@v6
8888
- name: Sync repository labels
8989
if: success()
9090
uses: crazy-max/ghaction-github-labeler@v5

.pre-commit-config.yaml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ repos:
169169
- id: mypy
170170
# IMPORTANT: Keep type hinting-related dependencies of the
171171
# mypy pre-commit hook additional_dependencies in sync with
172-
# the dev section of setup.py to avoid discrepancies in type
173-
# checking between environments.
172+
# the dev section of pyproject.toml to avoid discrepancies in
173+
# type checking between environments.
174174
additional_dependencies:
175175
- types-jsonschema
176176
- repo: https://github.com/pypa/pip-audit
@@ -189,10 +189,16 @@ repos:
189189
rev: v3.21.1
190190
hooks:
191191
- id: pyupgrade
192+
args:
193+
# Python 3.10 is currently the oldest non-EOL version of
194+
# Python, so we want to apply all rules that apply to this
195+
# version or later. See here for more details:
196+
# https://www.gyford.com/phil/writing/2025/08/26/how-to-use-pyupgrade/
197+
- --py310-plus
192198

193199
# Ansible hooks
194200
- repo: https://github.com/ansible/ansible-lint
195-
rev: v25.11.0
201+
rev: v25.11.1
196202
hooks:
197203
- id: ansible-lint
198204
additional_dependencies:
@@ -208,31 +214,13 @@ repos:
208214
# hook identifies a vulnerability in ansible-core 2.16.13,
209215
# but all versions of ansible 9 have a dependency on
210216
# ~=2.16.X.
211-
#
212-
# It is also a good idea to go ahead and upgrade to version
213-
# 10 since version 9 is going EOL at the end of November:
214-
# https://endoflife.date/ansible
215217
# - ansible>=10,<11
216-
# ansible-core 2.16.3 through 2.16.6 suffer from the bug
217-
# discussed in ansible/ansible#82702, which breaks any
218-
# symlinked files in vars, tasks, etc. for any Ansible role
219-
# installed via ansible-galaxy. Hence we never want to
220-
# install those versions.
221-
#
222-
# Note that the pip-audit pre-commit hook identifies a
223-
# vulnerability in ansible-core 2.16.13. The pin of
224-
# ansible-core to >=2.17 effectively also pins ansible to
225-
# >=10.
226-
#
227-
# It is also a good idea to go ahead and upgrade to
228-
# ansible-core 2.17 since security support for ansible-core
229-
# 2.16 ends this month:
230-
# https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
218+
# ansible-core<2.17.7 suffers from GHSA-99w6-3xph-cx78.
231219
#
232220
# Note that any changes made to this dependency must also be
233221
# made in requirements.txt in cisagov/skeleton-packer and
234222
# requirements-test.txt in cisagov/skeleton-ansible-role.
235-
- ansible-core>=2.17
223+
- ansible-core>=2.17.7
236224

237225
# Terraform hooks
238226
- repo: https://github.com/antonbabenko/pre-commit-terraform

pyproject.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@
33
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
44
[build-system]
55
build-backend = "setuptools.build_meta"
6-
requires = ["setuptools"]
6+
requires = [
7+
# 61.0.0 was the first version of setuptools to offer a full-fledged
8+
# backend that uses pyproject.toml for metadata configuration (in
9+
# compliance with PEP 621):
10+
# https://setuptools.pypa.io/en/stable/history.html#v61-0-0
11+
#
12+
# 77.0.0 was the first version of setuptools to support license
13+
# expressions (in compliance with PEP 639):
14+
# https://setuptools.pypa.io/en/stable/history.html#v77-0-0
15+
"setuptools>=77.0.0"
16+
]
717

818
[project]
919
authors = [
@@ -53,6 +63,8 @@ requires-python = ">=3.12"
5363
# field of the mypy pre-commit hook to avoid discrepancies in type
5464
# checking between environments.
5565
dev = [
66+
"build",
67+
"twine",
5668
"types-jsonschema",
5769
]
5870
test = [

src/cyhy_cvesync/cve_sync.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from io import BytesIO
77
import json
88
import logging
9-
from typing import Dict, List, Tuple
109
import urllib.request
1110

1211
# Third-Party Libraries
@@ -24,15 +23,15 @@
2423
PREFERRED_CVSS_METRICS = ["cvssMetricV31", "cvssMetricV30", "cvssMetricV2"]
2524

2625
# Map to track existing CVE documents that were not updated
27-
cve_map: Dict[str, CVEDoc] = {}
26+
cve_map: dict[str, CVEDoc] = {}
2827
cve_map_lock = asyncio.Lock()
2928

3029
logger = logging.getLogger(f"{CYHY_ROOT_LOGGER}.{__name__}")
3130

3231

3332
async def process_cve_json(
3433
cve_json: dict, cve_authoritative_source: str
35-
) -> Tuple[int, int]:
34+
) -> tuple[int, int]:
3635
"""
3736
Process the provided CVEs JSON and update the database with their contents.
3837
@@ -186,11 +185,11 @@ async def fetch_cve_data(session: ClientSession, cve_url: str, gzipped: bool) ->
186185

187186

188187
async def process_urls(
189-
cve_urls: List[str],
188+
cve_urls: list[str],
190189
cve_data_gzipped: bool,
191190
concurrency: int,
192191
cve_authoritative_source: str,
193-
) -> Tuple[int, int, int]:
192+
) -> tuple[int, int, int]:
194193
"""
195194
Process URLs containing CVE data.
196195

src/cyhy_cvesync/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import asyncio
66
import logging
77
import sys
8-
from typing import Optional
98

109
# Third-Party Libraries
1110
from cyhy_config import get_config
@@ -33,7 +32,7 @@ def generate_urls(url_pattern: str) -> list[str]:
3332

3433

3534
async def do_cve_sync(
36-
config_file: Optional[str] = None, arg_log_level: Optional[str] = None
35+
config_file: str | None = None, arg_log_level: str | None = None
3736
) -> None:
3837
"""Perform the CVE synchronization."""
3938
setup_logging(arg_log_level)

src/cyhy_cvesync/models/config_model.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""Model definitions for the configuration."""
22

3-
# Standard Python Libraries
4-
from typing import Optional
5-
63
# Third-Party Libraries
74
from pydantic import BaseModel, ConfigDict, Field
85

@@ -31,7 +28,7 @@ class CVESync(BaseModel):
3128
default=DEFAULT_CVE_URL_PATTERN,
3229
description="URL pattern for the CVE JSON file; note that {year} in the pattern will be substituted with each valid year",
3330
)
34-
log_level: Optional[str] = Field(
31+
log_level: str | None = Field(
3532
None,
3633
description="Logging level",
3734
)

0 commit comments

Comments
 (0)