[tox]
envlist = isort
skip_missing_interpreters = true

[testenv:isort]
basepython = python
deps =
    isort==5.12.0
commands =
    isort composio/ scripts/ tests/ coders/
    isort plugins/

[testenv:isort-check]
basepython = python3
deps =
    isort==5.12.0
commands =
    isort composio/ scripts/ tests/ coders/ --check
    isort plugins/ --check

[testenv:black]
basepython = python
deps =
    black==23.3.0
commands =
    black composio/ scripts/ tests/ coders/
    black plugins/

[testenv:black-check]
basepython = python3
deps =
    black==23.3.0
commands =
    black composio/ scripts/ tests/ coders/ --check
    black plugins/ --check

[testenv:black-diff]
basepython = python3
deps =
    black==23.3.0
commands =
    black composio/ scripts/ tests/ coders/--diff
    black plugins/ --diff
    black examples/ --diff

[testenv:mypy]
basepython = python3
deps =
    mypy==1.3.0
commands =
    mypy composio/ scripts/ tests/ coders/ --config-file tox.ini
    mypy plugins/ --config-file tox.ini

[testenv:pylint]
basepython = python3
deps =
    pylint==3.2.3
commands =
    pylint composio/ tests/ scripts/ coders/
    pylint plugins/

[testenv:flake8]
basepython = python3
deps =
    flake8==6.0.0
commands =
    flake8 composio/ scripts/ tests/ coders/ --config tox.ini
    flake8 plugins/ --config tox.ini

[testenv:darglint]
skipsdist = True
skip_install = True
deps =
    darglint==1.8.1
commands =
    darglint composio/
    darglint plugins/

[testenv:unittests]
setenv =
    CI={env:CI}
    PYTHONPATH={env:PWD:%CD%}
    COMPOSIO_API_KEY={env:COMPOSIO_API_KEY}
    COMPOSIO_BASE_URL={env:COMPOSIO_BASE_URL}
deps = 
    pytest==7.4.2
    codecov==2.1.13
    pytest-codecov==0.5.1
    typing_extensions==4.10.0
commands =
    ; TODO: Extract plugin tests separately
    ; Installing separately because of the dependency conflicts
    pytest -vvv -rfE --doctest-modules composio/ tests/ --cov=composio --cov=examples --cov-report=html --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs}

    ; pip3 install plugins/autogen
    ; pip3 install plugins/claude
    ; pip3 install plugins/crew_ai
    ; pip3 install plugins/griptape
    ; pip3 install plugins/julep
    ; pip3 install plugins/langchain
    ; pip3 install plugins/lyzr
    ; pip3 install plugins/openai

; Linter config

[isort]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
ensure_newline_before_comments = True
line_length=88
order_by_type=False
case_sensitive=True
lines_after_imports=2
; TODO: Investigate and fix why this fail
skip=plugins/langchain/langchain_demo.py
skip_glob=
known_first_party=composio
known_packages=plugins
known_local_folder=tests
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,PACKAGES,LOCALFOLDER

[flake8]
max_line_length = 200
exclude= **/build, **/dist
per-file-ignores = __init__.py:F401,W503
ignore = E231, W291, W503

[mypy]
strict_optional = True
exclude=plugins/.*/setup\.py|plugins/.*/build/lib/
ignore_missing_imports = True

[mypy-requests.*]
ignore_missing_imports = True

[mypy-click.*]
ignore_missing_imports = True

[mypy-semver.*]
ignore_missing_imports = True

[mypy-beaupy.*]
ignore_missing_imports = True

[mypy-pyperclip.*]
ignore_missing_imports = True

[mypy-aiohttp.*]
ignore_missing_imports = True

[mypy-autogen.*]
ignore_missing_imports = True

[mypy-dotenv.*]
ignore_missing_imports = True

[mypy-langchain.*]
ignore_missing_imports = True

[mypy-lyzr_automata.*]
ignore_missing_imports = True

[mypy-langchain_openai.*]
ignore_missing_imports = True

[mypy-julep.*]
ignore_missing_imports = True

[mypy-langchain_core.*]
ignore_missing_imports = True

[mypy-anthropic.*]
ignore_missing_imports = True

[mypy-griptape.*]
ignore_missing_imports = True

[mypy-schema.*]
ignore_missing_imports = True

[mypy-crewai.*]
ignore_missing_imports = True

[mypy-composio_lyzr.*]
ignore_missing_imports = True

[mypy-composio_julep.*]
ignore_missing_imports = True

[mypy-composio_griptape.*]
ignore_missing_imports = True

[mypy-flask.*]
ignore_missing_imports = True

[mypy-simple-parsing.*]
ignore_missing_imports = True

[mypy-docker.*]
ignore_missing_imports = True

[mypy-yaml.*]
ignore_missing_imports = True

[mypy-gitpython.*]
ignore_missing_imports = True
