Repository: astral-sh/uv
File: crates/uv-static/src/env_vars.rs (Rust)

Code before:
    /// Used for trusted publishing via `uv publish`. Contains the oidc token url.
    pub const ACTIONS_ID_TOKEN_REQUEST_URL: &'static str = "ACTIONS_ID_TOKEN_REQUEST_URL";

    /// Used for trusted publishing via `uv publish`. Contains the oidc request token.
    pub const ACTIONS_ID_TOKEN_REQUEST_TOKEN: &'static str = "ACTIONS_ID_TOKEN_REQUEST_TOKEN";

    /// Indicates that the current process is running in GitLab CI.
    ///
    /// When set (typically to `true`), uv may attempt GitLab-specific trusted publishing flows.
    pub const GITLAB_CI: &'static str = "GITLAB_CI";

    /// GitLab CI/CD-provided JWT for the current job (v2 format).
    ///
    /// When using GitLab's `id_tokens` feature with audience set for PyPI, this token can be
    /// submitted to PyPI's `/_/oidc/mint-token` endpoint to obtain a short-lived publish token.
    pub const CI_JOB_JWT_V2: &'static str = "CI_JOB_JWT_V2";

    /// GitLab CI/CD-provided JSON Web Token (JWT) for the current job (legacy format).
    pub const CI_JOB_JWT: &'static str = "CI_JOB_JWT";

    /// Explicit override for passing an OIDC token for trusted publishing.
    ///
    /// If set, uv will use this value as an OIDC token and exchange it via the registry's
    /// `/_/oidc/mint-token` endpoint to obtain a short-lived publish token. This can be used in
    /// GitLab CI by mapping the `id_tokens` variable (e.g., `$PYPI_ID_TOKEN`) into this variable.
    pub const UV_TRUSTED_PUBLISHING_OIDC_TOKEN: &'static str = "UV_TRUSTED_PUBLISHING_OIDC_TOKEN";

    /// Sets the encoding for standard I/O streams (e.g., PYTHONIOENCODING=utf-8).
    #[attr_hidden]
    pub const PYTHONIOENCODING: &'static str = "PYTHONIOENCODING";

    /// Forces unbuffered I/O streams, equivalent to `-u` in Python.
    #[attr_hidden]
    pub const PYTHONUNBUFFERED: &'static str = "PYTHONUNBUFFERED";

    /// Enables UTF-8 mode for Python, equivalent to `-X utf8`.
    #[attr_hidden]
    pub const PYTHONUTF8: &'static str = "PYTHONUTF8";

    /// Adds directories to Python module search path (e.g., `PYTHONPATH=/path/to/modules`).
    pub const PYTHONPATH: &'static str = "PYTHONPATH";

    /// Used in tests to enforce a consistent locale setting.
    #[attr_hidden]
    pub const LC_ALL: &'static str = "LC_ALL";

    /// Typically set by CI runners, used to detect a CI runner.
    #[attr_hidden]
    pub const CI: &'static str = "CI";

    /// Use to set the .netrc file location.

Review comment (bug):
0.02c: I think it'd be better to not add this variable, and instead access `PYPI_ID_TOKEN` directly when we infer that the environment is Gitlab CI/CD. 

(My rationale: incorrect or invalid OIDC creds can be really annoying to debug, so I think we should stick to a "discover" rather than "user-supplied" flow as much as we can.)

Code after:

    /// Used in tests for better git isolation.
    ///
    /// For example, we run some tests in ~/.local/share/uv/tests.
    /// And if the user's `$HOME` directory is a git repository,
    /// this will change the behavior of some tests. Setting
    /// `GIT_CEILING_DIRECTORIES=/home/andrew/.local/share/uv/tests` will
    /// prevent git from crawling up the directory tree past that point to find
    /// parent git repositories.
    #[attr_hidden]
    pub const GIT_CEILING_DIRECTORIES: &'static str = "GIT_CEILING_DIRECTORIES";

    /// Indicates that the current process is running in GitHub Actions.
    ///
    /// `uv publish` may attempt trusted publishing flows when set
    /// to `true`.
    pub const GITHUB_ACTIONS: &'static str = "GITHUB_ACTIONS";

    /// Indicates that the current process is running in GitLab CI.
    ///
    /// `uv publish` may attempt trusted publishing flows when set
    /// to `true`.
    pub const GITLAB_CI: &'static str = "GITLAB_CI";

    /// Sets the encoding for standard I/O streams (e.g., PYTHONIOENCODING=utf-8).
    #[attr_hidden]
    pub const PYTHONIOENCODING: &'static str = "PYTHONIOENCODING";

    /// Forces unbuffered I/O streams, equivalent to `-u` in Python.
    #[attr_hidden]
    pub const PYTHONUNBUFFERED: &'static str = "PYTHONUNBUFFERED";

    /// Enables UTF-8 mode for Python, equivalent to `-X utf8`.
    #[attr_hidden]
    pub const PYTHONUTF8: &'static str = "PYTHONUTF8";

    /// Adds directories to Python module search path (e.g., `PYTHONPATH=/path/to/modules`).
    pub const PYTHONPATH: &'static str = "PYTHONPATH";

    /// Used in tests to enforce a consistent locale setting.
    #[attr_hidden]
    pub const LC_ALL: &'static str = "LC_ALL";

    /// Typically set by CI runners, used to detect a CI runner.
    #[attr_hidden]
    pub const CI: &'static str = "CI";

    /// Use to set the .netrc file location.
    pub const NETRC: &'static str = "NETRC";

    /// The standard `PAGER` posix env var. Used by `uv` to configure the appropriate pager.