Skip to content

Commit e5bdbce

Browse files
Merge pull request #232 from cyclotruc/chore/update-dependencies-and-precommit-hooks
chore: remove unused dependencies and pin fastapi/starlette/uvicorn to fix vulnerabilities
2 parents 3cee672 + 3148429 commit e5bdbce

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ repos:
9595
files: ^src/
9696
additional_dependencies:
9797
[
98-
chardet,
99-
click,
100-
fastapi-analytics,
98+
click>=8.0.0,
99+
"fastapi[standard]>=0.109.1",
100+
pydantic,
101101
pytest-asyncio,
102102
python-dotenv,
103103
slowapi,
104-
starlette,
104+
starlette>=0.40.0,
105105
tiktoken,
106106
tomli,
107-
uvicorn,
107+
uvicorn>=0.11.7,
108108
]
109109
- id: pylint
110110
name: pylint for tests
@@ -113,17 +113,16 @@ repos:
113113
- --rcfile=tests/.pylintrc
114114
additional_dependencies:
115115
[
116-
chardet,
117-
click,
118-
fastapi-analytics,
119-
pytest,
116+
click>=8.0.0,
117+
"fastapi[standard]>=0.109.1",
118+
pydantic,
120119
pytest-asyncio,
121120
python-dotenv,
122121
slowapi,
123-
starlette,
124-
tomli,
122+
starlette>=0.40.0,
125123
tiktoken,
126-
uvicorn,
124+
tomli,
125+
uvicorn>=0.11.7,
127126
]
128127

129128
- repo: meta

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ readme = {file = "README.md", content-type = "text/markdown" }
66
requires-python = ">= 3.8"
77
dependencies = [
88
"click>=8.0.0",
9+
"fastapi[standard]>=0.109.1", # Vulnerable to https://osv.dev/vulnerability/PYSEC-2024-38
10+
"pydantic",
11+
"python-dotenv",
12+
"slowapi",
13+
"starlette>=0.40.0", # Vulnerable to https://osv.dev/vulnerability/GHSA-f96h-pmfr-66vw
914
"tiktoken",
1015
"tomli",
1116
"typing_extensions; python_version < '3.10'",
17+
"uvicorn>=0.11.7", # Vulnerable to https://osv.dev/vulnerability/PYSEC-2020-150
1218
]
1319

1420
license = {file = "LICENSE"}

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
chardet
21
click>=8.0.0
32
fastapi[standard]>=0.109.1 # Vulnerable to https://osv.dev/vulnerability/PYSEC-2024-38
3+
pydantic
44
python-dotenv
55
slowapi
66
starlette>=0.40.0 # Vulnerable to https://osv.dev/vulnerability/GHSA-f96h-pmfr-66vw

src/gitingest/ingestion_schema.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
from typing import Optional, Set
66

7-
from pydantic import BaseModel, Field
7+
from pydantic import BaseModel, ConfigDict, Field
88

99
from gitingest.config import MAX_FILE_SIZE
1010

@@ -58,10 +58,7 @@ class IngestionQuery(BaseModel): # pylint: disable=too-many-instance-attributes
5858
ignore_patterns: Optional[Set[str]] = None
5959
include_patterns: Optional[Set[str]] = None
6060

61-
class Config:
62-
"""Pydantic model configuration."""
63-
64-
arbitrary_types_allowed = True
61+
model_config = ConfigDict(arbitrary_types_allowed=True)
6562

6663
def extract_clone_config(self) -> CloneConfig:
6764
"""

0 commit comments

Comments
 (0)