From 41d9ee6d1566016659a05ae4c860680c8847e540 Mon Sep 17 00:00:00 2001 From: Greyson Lalonde Date: Fri, 12 Sep 2025 22:33:59 -0400 Subject: [PATCH] chore: consolidate monorepo dependencies and configuration - Consolidate dev dependencies to root using PEP 735 dependency groups - Remove duplicate dependencies between packages - Remove unused dependencies (pillow, cairosvg, bandit) - Clean up tool configurations and build targets --- .pre-commit-config.yaml | 6 +- packages/crewai/pyproject.toml | 111 +------------------------ packages/tools/.pre-commit-config.yaml | 21 ----- packages/tools/pyproject.toml | 20 ----- pyproject.toml | 53 ++---------- 5 files changed, 13 insertions(+), 198 deletions(-) delete mode 100644 packages/tools/.pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2931167e..8240b31ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,14 +6,16 @@ repos: entry: uv run ruff check language: system types: [python] + files: ^(packages/crewai/src/|packages/tools/src/).*\.py$ - id: ruff-format name: ruff-format entry: uv run ruff format language: system types: [python] + files: ^(packages/crewai/src/|packages/tools/src/).*\.py$ - id: mypy name: mypy - entry: uv run mypy + entry: uv run mypy src --exclude cli/templates language: system types: [python] - exclude: ^tests/ + exclude: ^(packages/.*/tests/|packages/crewai/src/crewai/cli/templates/) diff --git a/packages/crewai/pyproject.toml b/packages/crewai/pyproject.toml index aa421a5ae..32413c304 100644 --- a/packages/crewai/pyproject.toml +++ b/packages/crewai/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] dependencies = [ # Core Dependencies - "pydantic>=2.4.2", + "pydantic>=2.6.1", "openai>=1.13.3", "litellm==1.74.9", "instructor>=1.3.3", @@ -30,7 +30,7 @@ dependencies = [ "python-dotenv>=1.0.0", "pyjwt>=2.9.0", # Configuration and Utils - "click>=8.1.7", + "click>=8.1.8", "appdirs>=1.4.4", "jsonref>=1.1.0", "json-repair==0.25.2", @@ -42,11 +42,6 @@ dependencies = [ "portalocker==2.7.0", ] -[project.urls] -Homepage = "https://crewai.com" -Documentation = "https://docs.crewai.com" -Repository = "https://github.com/crewAIInc/crewAI" - [project.optional-dependencies] tools = ["crewai-tools"] embeddings = [ @@ -72,102 +67,10 @@ qdrant = [ "qdrant-client[fastembed]>=1.14.3", ] -[tool.uv] -dev-dependencies = [ - "ruff>=0.12.11", - "mypy>=1.17.1", - "pre-commit>=4.3.0", - "bandit>=1.8.6", - "pillow>=10.2.0", - "cairosvg>=2.7.1", - "pytest>=8.0.0", - "python-dotenv>=1.0.0", - "pytest-asyncio>=0.23.7", - "pytest-subprocess>=1.5.2", - "pytest-recording>=0.13.2", - "pytest-randomly>=3.16.0", - "pytest-timeout>=2.3.1", - "pytest-xdist>=3.6.1", - "pytest-split>=0.9.0", - "types-requests==2.32.*", - "types-pyyaml==6.0.*", - "types-regex==2024.11.6.*", - "types-appdirs==1.4.*", -] [project.scripts] crewai = "crewai.cli.cli:crewai" -[tool.ruff] -exclude = [ - "src/crewai/cli/templates", -] -fix = true - -[tool.ruff.lint] -select = [ - "E", # pycodestyle errors (style issues) - "F", # Pyflakes (code errors) - "B", # flake8-bugbear (bug prevention) - "S", # bandit (security issues) - "RUF", # ruff-specific rules - "N", # pep8-naming (naming conventions) - "W", # pycodestyle warnings - "PERF", # performance issues - "PIE", # flake8-pie (unnecessary code) - "ASYNC", # async/await best practices - "RET", # flake8-return (return improvements) - "UP006", # use collections.abc - "UP007", # use X | Y for unions - "UP035", # use dict/list instead of typing.Dict/List - "UP037", # remove quotes from type annotations - "UP045", # use X | None instead of Optional[X] - "UP004", # use isinstance instead of type - "UP008", # use super() instead of super(Class, self) - "UP010", # use isinstance for type checks - "UP018", # use str() instead of "string" - "UP031", # use f-strings for .format() - "UP032", # use f-strings for .format() with positional - "I001", # sort imports - "I002", # remove unused imports -] -ignore = ["E501"] # ignore line too long - -[tool.ruff.lint.per-file-ignores] -"tests/**/*.py" = ["S101"] # Allow assert statements in tests - -[tool.mypy] -exclude = ["src/crewai/cli/templates", "tests"] - -[tool.bandit] -exclude_dirs = ["src/crewai/cli/templates"] - -[tool.pytest.ini_options] -markers = [ - "telemetry: mark test as a telemetry test (don't mock telemetry)", -] - -# PyTorch index configuration, since torch 2.5.0 is not compatible with python 3.13 -[[tool.uv.index]] -name = "pytorch-nightly" -url = "https://download.pytorch.org/whl/nightly/cpu" -explicit = true - -[[tool.uv.index]] -name = "pytorch" -url = "https://download.pytorch.org/whl/cpu" -explicit = true - -[tool.uv.sources] -torch = [ - { index = "pytorch-nightly", marker = "python_version >= '3.13'" }, - { index = "pytorch", marker = "python_version < '3.13'" }, -] -torchvision = [ - { index = "pytorch-nightly", marker = "python_version >= '3.13'" }, - { index = "pytorch", marker = "python_version < '3.13'" }, -] - [tool.hatch.version] path = "src/crewai/__init__.py" @@ -177,13 +80,3 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["src/crewai"] -exclude = [ -"docs/**", -"docs/", -] - -[tool.hatch.build.targets.sdist] -exclude = [ -"docs/**", -"docs/", -] diff --git a/packages/tools/.pre-commit-config.yaml b/packages/tools/.pre-commit-config.yaml deleted file mode 100644 index 4eae2b11a..000000000 --- a/packages/tools/.pre-commit-config.yaml +++ /dev/null @@ -1,21 +0,0 @@ -repos: - - - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.12.1 - hooks: - - id: black - language_version: python3.11 - files: \.(py)$ - - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - name: isort (python) - args: ["--profile", "black", "--filter-files"] - - - repo: https://github.com/PyCQA/autoflake - rev: v2.2.1 - hooks: - - id: autoflake - args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variables', '--ignore-init-module-imports'] diff --git a/packages/tools/pyproject.toml b/packages/tools/pyproject.toml index d9d2536f5..4fb671b18 100644 --- a/packages/tools/pyproject.toml +++ b/packages/tools/pyproject.toml @@ -9,18 +9,12 @@ authors = [ requires-python = ">=3.10,<3.14" dependencies = [ "crewai-core", - "pydantic>=2.6.1", "lancedb>=0.5.4", - "openai>=1.12.0", - "chromadb==0.5.23", - "pyright>=1.1.350", "pytube>=15.0.0", "requests>=2.31.0", "docker>=7.1.0", - "click>=8.1.8", "tiktoken>=0.8.0", "stagehand>=0.4.1", - "portalocker==2.7.0", ] [project.urls] @@ -29,8 +23,6 @@ Repository = "https://github.com/crewAIInc/crewAI-tools" Documentation = "https://docs.crewai.com" -[project.scripts] - [project.optional-dependencies] embedchain = [ "embedchain>=0.1.114", @@ -146,11 +138,6 @@ contextual = [ [tool.pytest.ini_options] pythonpath = ["."] -[tool.uv] -dev-dependencies = [ - "pytest>=8.3.4", -] - [tool.hatch.version] path = "src/crewai_tools/__init__.py" @@ -162,10 +149,3 @@ build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] packages = ["src/crewai_tools"] - -[dependency-groups] -dev = [ - "pytest-asyncio>=0.25.2", - "pytest>=8.0.0", - "pytest-recording>=0.13.3", -] diff --git a/pyproject.toml b/pyproject.toml index 664093fb0..9ca99f073 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,43 +20,17 @@ Repository = "https://github.com/crewAIInc/crewAI" tools = ["crewai-tools"] core = ["crewai-core"] all = ["crewai-core", "crewai-tools"] -# Core framework optional dependencies -embeddings = [ - "tiktoken~=0.8.0" -] -pdfplumber = [ - "pdfplumber>=0.11.4", -] -pandas = [ - "pandas>=2.2.3", -] -openpyxl = [ - "openpyxl>=3.1.5", -] -mem0 = ["mem0ai>=0.1.94"] -docling = [ - "docling>=2.12.0", -] -aisuite = [ - "aisuite>=0.1.10", -] -qdrant = [ - "qdrant-client[fastembed]>=1.14.3", -] -[tool.uv] -dev-dependencies = [ +[dependency-groups] +dev = [ "ruff>=0.12.11", "mypy>=1.17.1", "pre-commit>=4.3.0", - "bandit>=1.8.6", - "pillow>=10.2.0", - "cairosvg>=2.7.1", "pytest>=8.0.0", "python-dotenv>=1.0.0", - "pytest-asyncio>=0.23.7", + "pytest-asyncio>=0.25.2", "pytest-subprocess>=1.5.2", - "pytest-recording>=0.13.2", + "pytest-recording>=0.13.3", "pytest-randomly>=3.16.0", "pytest-timeout>=2.3.1", "pytest-xdist>=3.6.1", @@ -67,8 +41,8 @@ dev-dependencies = [ "types-appdirs==1.4.*", ] -[project.scripts] -crewai = "crewai.cli.cli:crewai" +[tool.uv] +default-groups = ["dev"] [tool.ruff] exclude = [ @@ -112,9 +86,6 @@ ignore = ["E501"] # ignore line too long [tool.mypy] exclude = ["packages/crewai/src/crewai/cli/templates", "packages/*/tests"] -[tool.bandit] -exclude_dirs = ["packages/crewai/src/crewai/cli/templates"] - [tool.pytest.ini_options] testpaths = [ "packages/crewai/tests", @@ -161,14 +132,4 @@ requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] -packages = ["packages/crewai/src/crewai"] -exclude = [ -"docs/**", -"docs/", -] - -[tool.hatch.build.targets.sdist] -exclude = [ -"docs/**", -"docs/", -] \ No newline at end of file +packages = ["packages/crewai/src/crewai"] \ No newline at end of file