ci-info is a Python library that provides information about the current Continuous Integration (CI) environment. It allows developers to detect if code is running on a CI server, identify the specific CI provider (e.g., GitHub Actions, GitLab CI, CircleCI), and check if the current build is for a pull request. The library aims to maintain parity with `watson/ci-info` (a JavaScript equivalent) and is actively developed with a focus on adding new CI provider detections. The latest version is 0.4.0, released in February 2026.
pip install ci-infoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to check if the current environment is a CI server, identify its name, and determine if the build is for a pull request using the `ci_info` module. It also shows how to retrieve all detected CI information in a dictionary.
Upgrade to Python 3.7+ or pin `ci-info<0.3.0` in your project dependencies.
Avoid relying on precise string matching for `ci_info.name()`. If specific vendor logic is critical, consider using `ci_info.is_ci()` in conjunction with checking vendor-specific environment variables directly if `ci_info.name()` changes might break your logic.
If your logic depends on a specific CI provider, always check the return value of `ci_info.name()` after confirming `ci_info.is_ci()` is `True`. If only general CI detection is needed, `is_ci()` is sufficient.
Install the library using pip: `pip install ci-info`. Then, ensure the import statement is `import ci_info`.
Use the correct snake_case attribute names for the Python library: `ci_info.is_ci()` instead of `ci_info.isCI` and `ci_info.is_pr()` instead of `ci_info.isPR`.
Verify that your CI environment sets standard CI environment variables (e.g., `CI=true`) or specific variables for your CI provider as recognized by `ci-info`. Refer to the `ci-info` documentation for a list of supported CI tools and their detection methods. If your CI is not detected, consider setting a generic `CI` environment variable or contributing to the library's detection logic.
No dependency data recorded yet.