Skip to content

Commit bb792c2

Browse files
committed
Move to uv
1 parent f64cba0 commit bb792c2

File tree

6 files changed

+2284
-58
lines changed

6 files changed

+2284
-58
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

core/schemas/template.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from pathlib import Path
33
from typing import TYPE_CHECKING, Literal, Optional
44

5-
import jinja2
5+
import minijinja
66
from pydantic import BaseModel, ConfigDict, computed_field
77

88
from core.config.config import yeti_config
@@ -22,9 +22,8 @@ class Template(BaseModel):
2222
def render(self, data: list["Observable"], output_file: str | None) -> None | str:
2323
"""Renders the template with the given data to the output file."""
2424

25-
environment = jinja2.Environment()
26-
template = environment.from_string(self.template)
27-
result = template.render(data=data)
25+
environment = minijinja.Environment(templates={self.name: self.template})
26+
result = environment.render_template(self.name, data=data)
2827
if output_file:
2928
os.makedirs(os.path.dirname(output_file), exist_ok=True)
3029
with open(output_file, "w+") as fd:

extras/git/ruff-precommit-check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# This script gives a poor error message due to https://github.com/microsoft/vscode/issues/189924
33
# but still blocks the commit from happening, so sorta WAI
4-
poetry run ruff check . && poetry run ruff format . --check
4+
uv run ruff check . && uv run ruff format . --check
55

66
# Check the exit status of the previous command
77

pyproject.toml

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,64 @@
1-
[tool.poetry]
1+
[project]
22
name = "yeti"
3-
version = "0.1.0"
3+
version = "2.3.5"
44
description = "Yeti"
5-
authors = ["Thomas Chopitea <[email protected]>"]
65
license = "Apache 2.0"
76
readme = "README.md"
7+
requires-python = ">=3.10"
8+
dependencies = [
9+
"aenum>=3.1.15",
10+
"artifacts",
11+
"authlib>=1.5.2",
12+
"beautifulsoup4>=4.13.3",
13+
"celery>=5.5.1",
14+
"click>=8.1.8",
15+
"fastapi>=0.115.12",
16+
"idstools>=0.6.5",
17+
"itsdangerous>=2.2.0",
18+
"minijinja>=2.9.0",
19+
"passlib[bcrypt]>=1.7.4",
20+
"plyara>=2.2.8",
21+
"python-arango>=8.1.6",
22+
"python-jose[cryptography]>=3.4.0",
23+
"python-multipart>=0.0.20",
24+
"pyyaml>=6.0.2",
25+
"redis>=5.2.1",
26+
"tqdm>=4.67.1",
27+
"uvicorn>=0.34.1",
28+
"validators>=0.34.0",
29+
"yara-python>=4.5.1",
30+
]
831

9-
[tool.poetry.dependencies]
10-
python = ">=3.10,<3.12"
11-
uvicorn = "^0.34"
12-
fastapi = "^0.115"
13-
python-arango = "^8.1.2"
14-
celery = "^5.3.4"
15-
validators = "^0.34.0"
16-
python-jose = {extras = ["cryptography"], version = "^3.4"}
17-
passlib = {extras = ["bcrypt"], version = "^1.7.4"}
18-
python-multipart = ">=0.0.6,<0.0.19"
19-
pandas = "^2.1.1"
20-
redis = "^5.0.0"
21-
click = "^8.1.7"
22-
jinja2 = "^3.1.2"
23-
authlib = "^1.2.1"
24-
itsdangerous = "^2.1.2"
25-
pyyaml = "^6.0.1"
26-
parameterized = "^0.9.0"
27-
yara-python = "^4.5.0"
28-
idstools = "^0.6.5"
29-
aenum = "^3.1.15"
30-
boto3 = { version = "^1.35.22", optional = true }
31-
tqdm = "^4.67.1"
32-
plyara = "^2.2"
32+
[dependency-groups]
33+
dev = [
34+
"httpx>=0.28.1",
35+
"mypy>=1.15.0",
36+
"parameterized>=0.9.0",
37+
"pylint>=3.3.6",
38+
"ruff>=0.11.5",
39+
]
40+
plugins = [
41+
"censys>=2.2.16",
42+
"ipwhois>=1.3.0",
43+
"maclookup>=1.0.3",
44+
"otxv2>=1.5.12",
45+
"pandas>=2.2.3",
46+
"pygithub>=2.6.1",
47+
"pymisp>=2.5.10",
48+
"pyopenssl>=25.0.0",
49+
"shodan>=1.31.0",
50+
"timesketch-api-client>=20250408",
51+
]
3352

34-
[tool.poetry.group.dev.dependencies]
35-
pylint = "^2.16.1"
36-
mypy = "^1.0.0"
37-
httpx = "^0.23.3"
38-
ruff = "^0.9.0"
53+
[tool.uv]
54+
default-groups = ["plugins"]
3955

40-
[tool.poetry.scripts]
41-
yetictl = 'yetictl.cli:cli'
42-
43-
[tool.poetry.group.plugins.dependencies]
44-
pymisp = "^2.4.176"
45-
otxv2 = "^1.5.12"
46-
shodan = "^1.30.0"
47-
timesketch-api-client = "^20230721"
48-
pyopenssl = "^23.3.0"
49-
ipwhois = "^1.2.0"
50-
maclookup = "^1.0.3"
51-
censys = "^2.2.10"
52-
artifacts = {git = "https://github.com/forensicartifacts/artifacts.git", rev = "main"}
53-
pygithub = "^2.3.0"
54-
55-
[build-system]
56-
requires = ["poetry-core"]
57-
build-backend = "poetry.core.masonry.api"
56+
[tool.uv.sources]
57+
artifacts = { git = "https://github.com/forensicartifacts/artifacts.git" }
5858

5959
[tool.ruff]
6060
# Enable the isort rules.
6161
lint.extend-select = ["I"]
6262
# exclude files in the /deprecated/ directories
6363
exclude = ["deprecated"]
6464
lint.ignore = ["E402", "F401"]
65-
66-
[tool.poetry.extras]
67-
s3 = ["boto3"]

pyproject.toml.poetry

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[tool.poetry]
2+
name = "yeti"
3+
version = "0.1.0"
4+
description = "Yeti"
5+
authors = ["Thomas Chopitea <[email protected]>"]
6+
license = "Apache 2.0"
7+
readme = "README.md"
8+
package-mode = false
9+
10+
[tool.poetry.dependencies]
11+
python = ">=3.10,<3.12"
12+
uvicorn = "^0.34"
13+
fastapi = "^0.115"
14+
python-arango = "^8.1.2"
15+
celery = "^5.3.4"
16+
validators = "^0.34.0"
17+
python-jose = {extras = ["cryptography"], version = "^3.4"}
18+
passlib = {extras = ["bcrypt"], version = "^1.7.4"}
19+
python-multipart = ">=0.0.6,<0.0.19"
20+
pandas = "^2.1.1"
21+
redis = "^5.0.0"
22+
click = "^8.1.7"
23+
jinja2 = "^3.1.2"
24+
authlib = "^1.2.1"
25+
itsdangerous = "^2.1.2"
26+
pyyaml = "^6.0.1"
27+
parameterized = "^0.9.0"
28+
yara-python = "^4.5.0"
29+
idstools = "^0.6.5"
30+
aenum = "^3.1.15"
31+
boto3 = { version = "^1.35.22", optional = true }
32+
tqdm = "^4.67.1"
33+
plyara = "^2.2"
34+
35+
[tool.poetry.group.dev.dependencies]
36+
pylint = "^2.16.1"
37+
mypy = "^1.0.0"
38+
httpx = "^0.23.3"
39+
ruff = "^0.9.0"
40+
41+
[tool.poetry.scripts]
42+
yetictl = 'yetictl.cli:cli'
43+
44+
[tool.poetry.group.plugins.dependencies]
45+
pymisp = "^2.4.176"
46+
otxv2 = "^1.5.12"
47+
shodan = "^1.30.0"
48+
timesketch-api-client = "^20230721"
49+
pyopenssl = "^23.3.0"
50+
ipwhois = "^1.2.0"
51+
maclookup = "^1.0.3"
52+
censys = "^2.2.10"
53+
artifacts = {git = "https://github.com/forensicartifacts/artifacts.git", rev = "main"}
54+
pygithub = "^2.3.0"
55+
56+
[build-system]
57+
requires = ["poetry-core"]
58+
build-backend = "poetry.core.masonry.api"
59+
60+
[tool.ruff]
61+
# Enable the isort rules.
62+
lint.extend-select = ["I"]
63+
# exclude files in the /deprecated/ directories
64+
exclude = ["deprecated"]
65+
lint.ignore = ["E402", "F401"]
66+
67+
[tool.poetry.extras]
68+
s3 = ["boto3"]

0 commit comments

Comments
 (0)