{"id":5878,"library":"ci-info","title":"CI-Info: Continuous Integration Information","description":"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.","status":"active","version":"0.4.0","language":"en","source_language":"en","source_url":"https://github.com/mgxd/ci-info","tags":["ci","continuous integration","environment detection","devops"],"install":[{"cmd":"pip install ci-info","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"is_ci","correct":"import ci_info"},{"symbol":"name","correct":"import ci_info"},{"symbol":"is_pr","correct":"import ci_info"},{"symbol":"info","correct":"import ci_info"}],"quickstart":{"code":"import ci_info\nimport os\n\nif ci_info.is_ci():\n    print(f\"Running on CI: {ci_info.name()}\")\n    if ci_info.is_pr():\n        print(\"This is a Pull Request build.\")\n    else:\n        print(\"This is not a Pull Request build.\")\n    \n    # Example of accessing CI environment variables directly\n    # os.environ.get('CI_NAME', 'Unknown')\n    \n    # Get all detected info as a dictionary\n    all_ci_info = ci_info.info()\n    print(f\"All CI Info: {all_ci_info}\")\nelse:\n    print(\"Not running on a CI server.\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade to Python 3.7+ or pin `ci-info<0.3.0` in your project dependencies.","message":"Version 0.3.0 dropped official support for Python 3.5 and 3.6. Users on these Python versions should either remain on `ci-info` version `0.2.x` or upgrade their Python interpreter to 3.7 or newer.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"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.","message":"The exact string value returned by `ci_info.name()` is not guaranteed to be constant across versions for a specific CI vendor. It is primarily for display and general identification.","severity":"gotcha","affected_versions":"All versions"},{"fix":"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.","message":"It is possible for `ci_info.is_ci()` to return `True` while `ci_info.name()` returns `None`. This occurs when generic, vendor-neutral CI environment variables are detected, but no specific CI provider recognized by `ci-info` is found.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}