This file covers everything you need to run the code locally: install, format, lint, and test.
Planning a pull request? Read CONTRIBUTING.md for issue and PR conventions before opening one.
This project uses uv for dependency management and Hatch as the build backend and task runner.
Clone the repository and install the project with its development dependencies:
git clone https://github.com/apify/langchain-apify
cd langchain-apify
uv sync --extra devDevelopment tasks are defined as Hatch scripts in pyproject.toml and run with hatch run <task>. Hatch manages an isolated environment with the dev dependencies, so install it once (e.g. uv tool install hatch or pipx install hatch).
To format the code, use the following command:
hatch run formatTo lint and type-check the code, use the following commands:
hatch run lint
hatch run typecheckTo run unit tests, use the following command:
hatch run testTo run integration tests, use the following command:
APIFY_TOKEN="YOUR_TOKEN" hatch run integration-testTo run a single test file, pass it as an argument:
hatch run test tests/unit_tests/test_file.py
APIFY_TOKEN="YOUR_TOKEN" hatch run integration-test tests/integration_tests/test_file.py
APIFY_API_TOKENis also accepted as a deprecated alias forAPIFY_TOKEN(emits aDeprecationWarning). New code and examples should useAPIFY_TOKEN.