lean_server.config package

Submodules

lean_server.config.config module

This module defines the configuration models and loading mechanism for the server.

class lean_server.config.config.Config(*, host: str, port: int, lean: LeanConfig, sqlite: SQLiteConfig, logging: dict[str, Any])[source]

Bases: BaseModel

The main configuration model for the application.

host: str
lean: LeanConfig
logging: dict[str, Any]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

port: int
sqlite: SQLiteConfig
class lean_server.config.config.LeanConfig(*, executable: str, workspace: str, concurrency: int)[source]

Bases: BaseModel

Configuration specific to the Lean environment.

concurrency: int
executable: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

workspace: str
class lean_server.config.config.SQLiteConfig(*, database_path: str, timeout: int)[source]

Bases: BaseModel

Configuration for the SQLite database.

database_path: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

timeout: int
lean_server.config.config.get_config(args: Namespace) Config[source]

Loads the configuration from files and command-line arguments.

It starts with a default configuration, overrides it with a custom config file if provided, and finally applies any command-line arguments.

Parameters:

args – The parsed command-line arguments.

Returns:

A validated Config object.

Module contents

This package handles the configuration management for the Lean server.

It exports the main Config class and the get_config function for easy access.

class lean_server.config.Config(*, host: str, port: int, lean: LeanConfig, sqlite: SQLiteConfig, logging: dict[str, Any])[source]

Bases: BaseModel

The main configuration model for the application.

host: str
lean: LeanConfig
logging: dict[str, Any]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

port: int
sqlite: SQLiteConfig
lean_server.config.get_config(args: Namespace) Config[source]

Loads the configuration from files and command-line arguments.

It starts with a default configuration, overrides it with a custom config file if provided, and finally applies any command-line arguments.

Parameters:

args – The parsed command-line arguments.

Returns:

A validated Config object.