Python Project Dependencies
Relevant source files
The following files were used as context for generating this wiki page:
The meltano-state-backend-clickhouse project is a specialized add-on for Meltano that enables ClickHouse as a state backend. Its dependencies are structured to support the core functionality of state persistence, database connectivity, and rigorous testing within a modern Python ecosystem. The project leverages hatchling as its build backend and utilizes standard Python packaging metadata to define its requirements.
Sources: pyproject.toml:1-10, README.md:1-5
Core Runtime Dependencies
The project defines a minimal set of runtime dependencies essential for its operation as a Meltano state store.
Primary Dependencies
- clickhouse-connect (>=0.7): This is the primary driver used to interface with ClickHouse. It provides the HTTP client necessary for executing commands, queries, and inserts.
- meltano (>=3.7): The project extends the base classes provided by Meltano's core library, specifically requiring version 3.7 or higher to ensure compatibility with modern state backend APIs.
Sources: pyproject.toml:26-29, src/meltano_state_backend_clickhouse/backend.py:27-30
Dependency Usage Flow
The following diagram illustrates how runtime dependencies interact to provide the state backend service:
This diagram shows the relationship between the Meltano core framework, the custom state store implementation, and the ClickHouse driver.
Sources: src/meltano_state_backend_clickhouse/backend.py:126-140, README.md:7-12
Development and Test Dependencies
The project uses hatch dependency groups to manage non-production requirements, separating development tools from test execution tools.
| Group | Dependency | Purpose |
|---|---|---|
| tests | pytest>=8 | Core testing framework for unit and integration tests. |
| tests | testcontainers[clickhouse]>=4.8 | Provides ephemeral ClickHouse instances for integration testing. |
| dev | tests group | Includes all test dependencies for local development. |
Sources: pyproject.toml:44-51, tests/test_backend.py:10-25
Build System and Metadata
The project uses modern Python build standards to manage its lifecycle and versioning.
- Build Backend:
hatchling.build - Versioning: Dynamic versioning is managed via
hatch-vcs, which derives the version from Git tags. - Python Compatibility: Supports Python versions >= 3.10, including explicit classifiers for 3.10 through 3.13.
Sources: pyproject.toml:1-5, pyproject.toml:17-25, pyproject.toml:53-56
Configuration via Entry Points
Dependencies and class mappings are exposed to Meltano through Python entry points. This allows Meltano to discover and load the ClickHouse backend and its associated settings dynamically.
Registered Entry Points
- meltano.state_backends: Maps the
clickhousescheme to theClickhouseStateStoreManagerclass. - meltano.settings: Defines the configuration parameters required by the backend, such as
host,port,user, andpassword.
[project.entry-points."meltano.settings"]
host = "meltano_state_backend_clickhouse.backend:CLICKHOUSE_HOST"
port = "meltano_state_backend_clickhouse.backend:CLICKHOUSE_PORT"
# ... other settings
[project.entry-points."meltano.state_backends"]
clickhouse = "meltano_state_backend_clickhouse.backend:ClickhouseStateStoreManager"
Sources: pyproject.toml:30-41, src/meltano_state_backend_clickhouse/backend.py:58-103
Summary
The dependency architecture of meltano-state-backend-clickhouse is designed for high reliability and integration within the Meltano ecosystem. By utilizing clickhouse-connect for high-performance communication and testcontainers for automated environment setup during testing, the project ensures that its dependencies provide a robust foundation for OLAP-based state management.
Sources: README.md:32-37, src/meltano_state_backend_clickhouse/backend.py:12-23