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

Code before:
    /// parent git repositories.
    #[attr_hidden]
    pub const GIT_CEILING_DIRECTORIES: &'static str = "GIT_CEILING_DIRECTORIES";

    /// Used for trusted publishing via `uv publish`.
    pub const GITHUB_ACTIONS: &'static str = "GITHUB_ACTIONS";

    /// 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]

Review comment (suggestion):
I don't believe this will work, unfortunately -- both `CI_JOB_JWT` and `CI_JOB_JWT_V2` are deprecated, and neither will work with Trusted Publishing on PyPI because they lack the appropriate `aud` claim (i.e. `pypi`).

Instead of using these, uv needs to check for `PYPI_ID_TOKEN`, which the user has to explicitly declare in their GitLab job definition under `id_tokens`.

There's an example of that here: https://docs.pypi.org/trusted-publishers/using-a-publisher/#gitlab-cicd

More details here: https://docs.gitlab.com/ci/yaml/#id_tokens

Code after:
    #[attr_hidden]
    pub const GIT_SSH_COMMAND: &'static str = "GIT_SSH_COMMAND";

    /// Disable interactive git prompts in terminals, e.g., for credentials. Does not disable
    /// GUI prompts.
    #[attr_hidden]
    pub const GIT_TERMINAL_PROMPT: &'static str = "GIT_TERMINAL_PROMPT";

    /// 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.