env_detection¶

Detection methods for the current environment.

This module contains methods for detecting aspects of the current environment.

Some things which this module can detect are:
  • Whether the current environment is interactive.

  • Whether the current environment is a conda environment.

  • Whether the current environment is running on Travis, Kaggle, or Colab.

Note that these detections may not be correct 100% of the time but are as accurate as can be reasonably be expected depending on what is being detected.

Functions

check_pixman_using_anaconda

Using anaconda to check for pixman.

check_pixman_using_brew

Using homebrew to check for pixman.

check_pixman_using_dpkg

Using dpkg to check for pixman.

check_pixman_using_macports

Using macports to check for pixman.

colab_has_gpu

Detect if the current environment is running on Google Colab with a GPU.

has_gpu

Detect if the runtime has GPU.

has_network

Detect if the current environment has a network connection.

in_conda_env

Detect if the current environment is a conda environment.

is_interactive

Detect if the current environment is interactive.

is_notebook

Detect if the current environment is a Jupyter notebook.

pixman_versions

The version(s) of pixman that are installed.

pixman_warning

Detect if pixman version 0.38 is being used.

running_on_ci

Detect if the current environment is running on continuous integration (CI).

running_on_circleci

Detect if the current environment is running on CircleCI.

running_on_colab

Detect if the current environment is running on Google Colab.

running_on_github

Detect if the current environment is running on GitHub Actions.

running_on_kaggle

Detect if the current environment is running on Kaggle.

running_on_travis

Detect if the current environment is running on travis.

version_to_tuple

Convert a version string to a tuple of ints.