Environments
Environment variables are constants provided to an application when it runs. They keep configuration outside the source code, allowing the application to run in different environments without changing its implementation.
LongLink provides a simple, consistent way to define and manage this configuration, built on top of Pydantic Settings(opens in new tab). This gives applications validated and well-documented settings across local development and production. You define the configuration once, and LongLink reuses it wherever the application runs.
Usage
pythonfrom longlink import Environmentsfrom pydantic import Fieldclass Env(Environments):"""Project-specific environment model."""REQUIRED: str = Field(description="Required value")OPTIONAL: str = Field(default="optional", description="Optional value")
Settings
Point the tool.longlink section in pyproject.toml to the environment class so LongLink knows which settings your application uses when it is built and deployed.
[tool.longlink]environment = "src.envs:Env"