Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup Python
uses: actions/setup-python@3d1e2d2ca0a067f27da6fec484fce7f5256def85
- name: Install uv
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1
with:
python-version: "3.13"

- name: Install Poetry
uses: abatilo/actions-poetry@b8f6fe29ba2eb78e0d45ccbf41cd14154c4e25b2

- name: Configure Poetry
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local

- name: Install package
run: poetry install
version: "latest"
python-version: 3.13

- name: Validate version
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
POETRY_VERSION=$(poetry version -s)
PROJECT_VERSION=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version)

if [ "$TAG_VERSION" != "$POETRY_VERSION" ]; then
echo "Tag ($TAG_VERSION) doesn't match pyproject.toml ($POETRY_VERSION)"
if [ "$TAG_VERSION" != "$PROJECT_VERSION" ]; then
echo "Tag ($TAG_VERSION) doesn't match pyproject.toml ($PROJECT_VERSION)"
exit 1
fi

- name: Build package
run: poetry build
run: uv build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@d417ba7e7683fa9104c42abe611c1f2c93c0727d
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
48 changes: 21 additions & 27 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "**/*.py"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
pull_request:
branches: [main]

Expand All @@ -23,36 +24,29 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@3d1e2d2ca0a067f27da6fec484fce7f5256def85
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1
with:
version: "latest"
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@b8f6fe29ba2eb78e0d45ccbf41cd14154c4e25b2
- name: Sync packages
run: uv sync --all-extras

- name: Configure Poetry
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Format
run: uv run ruff format --check .

- name: Install package
run: poetry install --all-extras
- name: Lint
if: always()
run: uv run ruff check --output-format=github .

- name: Format
run: poetry run ruff format --check .
- name: Typecheck
if: always()
run: uv run mypy .

- name: Lint
if: always()
run: poetry run ruff check --output-format=github .

- name: Typecheck
if: always()
run: poetry run mypy .

- name: Test
if: always()
run: poetry run pytest
- name: Test
if: always()
run: uv run pytest
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# uv lock (until we migrate)
uv.lock
# Poetry deprecated
poetry.lock

# Testing code
notebooks/
Expand Down Expand Up @@ -93,7 +93,6 @@ docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints
Expand Down
33 changes: 7 additions & 26 deletions .hooks/refresh_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,19 @@
#!/bin/bash

# Get pre-merge hash from the target branch
old_hash=$(git show ORIG_HEAD:poetry.lock | md5sum 2> /dev/null || echo "")
old_hash=$(git show ORIG_HEAD:uv.lock | md5sum 2> /dev/null || echo "")

# Get current hash
new_hash=$(md5sum poetry.lock 2> /dev/null || echo "")
new_hash=$(md5sum uv.lock 2> /dev/null || echo "")

# Compare and run poetry install if changed
# Compare and run uv sync if changed
if [ "$old_hash" != "$new_hash" ]; then
echo "📦 Root dependencies changed. Running poetry install..."
poetry install || {
echo "📦 Dependencies changed. Running uv sync..."
uv sync --all-extras || {
echo "❌ Failed to update dependencies"
exit 1
}
echo "✅ Root dependencies updated!"
echo "✅ Dependencies updated!"
else
echo "📦 No root dependency changes"
fi

# Get pre-merge hash from the target branch
old_hash=$(git show ORIG_HEAD:components/api/poetry.lock | md5sum 2> /dev/null || echo "")

# Get current hash
new_hash=$(md5sum components/api/poetry.lock 2> /dev/null || echo "")

# Compare and run poetry install if changed
if [ "$old_hash" != "$new_hash" ]; then
echo "📦 API dependencies changed. Running poetry install..."
cd components/api || exit
if ! poetry install --with dev; then
echo "❌ Failed to update dependencies"
exit 1
fi
echo "✅ API dependencies updated!"
else
echo "📦 No API dependency changes"
echo "📦 No dependency changes"
fi
21 changes: 18 additions & 3 deletions .hooks/typing_and_linting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

set -e

poetry run mypy .
poetry run ruff check .
poetry run ruff format --check .
echo

echo "📝 Running type checking with mypy ..."
uv run mypy dreadnode
echo "✅ Type checking passed!"
echo

echo "🔎 Running linting with ruff ..."
uv run ruff check dreadnode
echo "✅ Linting passed!"
echo

echo "🎨 Checking formatting with ruff ..."
uv run ruff format --check dreadnode
echo "✅ Code formatting is correct!"
echo

echo "🎉 All checks passed! Code is ready to go."
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
rev: v2.4.1
hooks:
- id: codespell
entry: codespell -q 3 -f --skip=".git,.github,README.md,poetry.lock" -L astroid,braket,te,ROUGE,lief,punctuations
entry: codespell -q 3 -f --skip=".git,.github,README.md,poetry.lock,uv.lock" -L astroid,braket,te,ROUGE,lief,punctuations

# Python code security
- repo: https://github.com/PyCQA/bandit
Expand Down Expand Up @@ -93,7 +93,7 @@ repos:
# Generate documentation
- id: generate-docs
name: Generate docs
entry: poetry run python .hooks/generate_docs.py
entry: uv run python .hooks/generate_docs.py
language: system
pass_filenames: false
always_run: true
9 changes: 5 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
"editor.defaultFormatter": "charliermarsh.ruff"
},
"mypy-type-checker.importStrategy": "fromEnvironment",
"mypy-type-checker.reportingScope": "workspace",
"mypy-type-checker.preferDaemon": false,
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
"python.testing.pytestEnabled": true,
"python.analysis.ignore": [
"tests/**"
]
}
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,24 @@ with dn.run(tags=["reverse-engineering"]):
## Installation

We publish every version to PyPi:

```bash
pip install -U dreadnode
```

If you want to build from source:

```bash
uv sync

poetry install
# Install with multimodal extras
poetry install --extras multimodal
uv sync --extras multimodal

# Install with training extras
poetry install --extras training
uv sync --extras training

# Install with all extras
poetry install --all-extras
uv sync --all-extras
```

## Installation from PyPI with Optional Features
Expand Down
20 changes: 0 additions & 20 deletions agent.py

This file was deleted.

16 changes: 15 additions & 1 deletion docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,17 @@
"usage/runs",
"usage/tasks",
"usage/metrics",
"usage/scorers",
{
"group": "Scorers",
"pages": [
"usage/scorers/index",
"usage/scorers/built-in-scorers",
"usage/scorers/advanced",
"usage/scorers/composition"
]
},
"usage/optimization",
"usage/airt",
"usage/data-tracking",
"usage/rich-objects",
"usage/model-training",
Expand All @@ -66,6 +76,10 @@
"sdk/artifact",
"sdk/data_types",
"sdk/scorers",
"sdk/optimization",
"sdk/mutations",
"sdk/eval",
"sdk/airt",
"sdk/integrations",
"sdk/main",
"sdk/metric",
Expand Down
Loading