Spaces:
Sleeping
Sleeping
Charles Azam
commited on
Commit
·
663d842
1
Parent(s):
4eb04d0
feat: add precommit, ruff, and makefile
Browse files- .github/workflows/pipeline.yml +7 -0
- .pre-commit-config.yaml +13 -0
- Makefile +31 -0
- pyproject.toml +36 -19
- uv.lock +0 -0
.github/workflows/pipeline.yml
CHANGED
|
@@ -23,5 +23,12 @@ jobs:
|
|
| 23 |
- name: Install the project
|
| 24 |
run: uv sync --locked --all-extras --dev
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
- name: Run tests
|
| 27 |
run: uv run pytest tests
|
|
|
|
| 23 |
- name: Install the project
|
| 24 |
run: uv sync --locked --all-extras --dev
|
| 25 |
|
| 26 |
+
- name: Run formatter check
|
| 27 |
+
run: uv run black --check --diff src tests
|
| 28 |
+
|
| 29 |
+
- name: Run linter
|
| 30 |
+
run: uv run ruff check src tests
|
| 31 |
+
|
| 32 |
+
|
| 33 |
- name: Run tests
|
| 34 |
run: uv run pytest tests
|
.pre-commit-config.yaml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
repos:
|
| 2 |
+
- repo: https://github.com/psf/black
|
| 3 |
+
rev: 24.1.1
|
| 4 |
+
hooks:
|
| 5 |
+
- id: black
|
| 6 |
+
language_version: python3.13
|
| 7 |
+
|
| 8 |
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 9 |
+
rev: v0.2.0
|
| 10 |
+
hooks:
|
| 11 |
+
- id: ruff
|
| 12 |
+
args: [--fix, --exit-non-zero-on-fix]
|
| 13 |
+
- id: ruff-format
|
Makefile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.PHONY: help format lint type-check check install-dev install-pre-commit
|
| 2 |
+
|
| 3 |
+
help: ## Show this help message
|
| 4 |
+
@echo "Available commands:"
|
| 5 |
+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
| 6 |
+
|
| 7 |
+
install-dev: ## Install development dependencies
|
| 8 |
+
uv sync --all-extras --dev
|
| 9 |
+
|
| 10 |
+
install-pre-commit: ## Install pre-commit hooks
|
| 11 |
+
uv run pre-commit install
|
| 12 |
+
|
| 13 |
+
format: ## Format code with black
|
| 14 |
+
uv run black src tests
|
| 15 |
+
|
| 16 |
+
lint: ## Run ruff linter
|
| 17 |
+
uv run ruff check src tests
|
| 18 |
+
|
| 19 |
+
lint-fix: ## Run ruff linter and auto-fix issues
|
| 20 |
+
uv run ruff check --fix src tests
|
| 21 |
+
|
| 22 |
+
type-check: ## Run mypy type checker
|
| 23 |
+
uv run mypy src
|
| 24 |
+
|
| 25 |
+
check: format lint type-check ## Run all checks (format, lint, type-check)
|
| 26 |
+
|
| 27 |
+
test: ## Run tests
|
| 28 |
+
uv run pytest tests
|
| 29 |
+
|
| 30 |
+
test-cov: ## Run tests with coverage
|
| 31 |
+
uv run pytest tests --cov=src --cov-report=html --cov-report=term-missing
|
pyproject.toml
CHANGED
|
@@ -10,33 +10,50 @@ requires-python = ">=3.13"
|
|
| 10 |
dependencies = [
|
| 11 |
"crawl4ai>=0.6.0",
|
| 12 |
"smolagents>=1.19.0",
|
| 13 |
-
"openai",
|
| 14 |
-
"datasets",
|
| 15 |
-
"transformers",
|
| 16 |
"litellm",
|
| 17 |
-
"langchain",
|
| 18 |
-
"fasttext-wheel",
|
| 19 |
-
"wikipedia-api",
|
| 20 |
-
"pillow",
|
| 21 |
-
"gradio",
|
| 22 |
-
"python-dotenv>=1.1.1",
|
| 23 |
-
"httpx",
|
| 24 |
-
"pypdf",
|
| 25 |
"pytest-asyncio>=1.0.0",
|
| 26 |
"mistralai>=1.9.1",
|
| 27 |
-
"
|
| 28 |
-
"
|
| 29 |
-
"
|
| 30 |
-
"numpy>=2.3.1",
|
| 31 |
-
"pandas>=2.3.0",
|
| 32 |
-
"matplotlib>=3.10.3",
|
| 33 |
-
"scipy>=1.16.0",
|
| 34 |
-
"sympy>=1.14.0",
|
| 35 |
]
|
| 36 |
|
| 37 |
[project.scripts]
|
| 38 |
deepengineer = "deepengineer:main"
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
[build-system]
|
| 41 |
requires = ["hatchling"]
|
| 42 |
build-backend = "hatchling.build"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
dependencies = [
|
| 11 |
"crawl4ai>=0.6.0",
|
| 12 |
"smolagents>=1.19.0",
|
|
|
|
|
|
|
|
|
|
| 13 |
"litellm",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"pytest-asyncio>=1.0.0",
|
| 15 |
"mistralai>=1.9.1",
|
| 16 |
+
"linkup-sdk>=0.2.8",
|
| 17 |
+
"tavily-python>=0.7.9",
|
| 18 |
+
"pypdf>=5.7.0",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
]
|
| 20 |
|
| 21 |
[project.scripts]
|
| 22 |
deepengineer = "deepengineer:main"
|
| 23 |
|
| 24 |
+
[project.optional-dependencies]
|
| 25 |
+
dev = [
|
| 26 |
+
"black>=24.0.0",
|
| 27 |
+
"ruff>=0.2.0",
|
| 28 |
+
"pre-commit>=3.6.0",
|
| 29 |
+
]
|
| 30 |
+
|
| 31 |
[build-system]
|
| 32 |
requires = ["hatchling"]
|
| 33 |
build-backend = "hatchling.build"
|
| 34 |
+
|
| 35 |
+
[tool.black]
|
| 36 |
+
line-length = 88
|
| 37 |
+
target-version = ['py313']
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
[tool.ruff]
|
| 41 |
+
target-version = "py313"
|
| 42 |
+
line-length = 88
|
| 43 |
+
select = [
|
| 44 |
+
"E", # pycodestyle errors
|
| 45 |
+
"W", # pycodestyle warnings
|
| 46 |
+
"F", # pyflakes
|
| 47 |
+
"I", # isort
|
| 48 |
+
"B", # flake8-bugbear
|
| 49 |
+
"C4", # flake8-comprehensions
|
| 50 |
+
"UP", # pyupgrade
|
| 51 |
+
]
|
| 52 |
+
ignore = [
|
| 53 |
+
"E501", # line too long, handled by black
|
| 54 |
+
"B008", # do not perform function calls in argument defaults
|
| 55 |
+
"C901", # too complex
|
| 56 |
+
]
|
| 57 |
+
|
| 58 |
+
[tool.ruff.per-file-ignores]
|
| 59 |
+
"__init__.py" = ["F401"]
|
uv.lock
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|