circleci

CircleCI Web-API Bindings

Classes

AsyncCircleAPI(session, *args, **kwargs)

CircleCI API using aiohttp

CircleAPI([token, vcs_type, username, project])

CircleCI API

SlackMessage(_headers, data)

Parses a Slack message as sent by CircleCI

Documentation

class bioconda_utils.circleci.AsyncCircleAPI(session, *args, **kwargs)[source]

Bases: bioconda_utils.circleci.CircleAPI

CircleCI API using aiohttp

class bioconda_utils.circleci.CircleAPI(token=None, vcs_type='github', username='bioconda', project='bioconda-recipes')[source]

Bases: abc.ABC

CircleCI API

async get_artifacts(path, head_sha)[source]

Get artifacts for specific branch and head_sha

For each artifact built for this sha, get the latest URL. Multiple builds may exist e.g. if a rebuild was triggered.

Parameters
  • path (str) – Must be pull/123 if on fork, otherwise name of branch

  • sha – The SHA to fetch artifacts for

Return type

List[Tuple[str, str, int]]

Returns

Mapping of relative path to full URL

async list_artifacts(build_number)[source]

Lists artifacts for build number

Return type

List[Mapping[str, Any]]

Returns

List of artifacts described by path and url

async list_recent_builds(path, sha=None, skip_rebuilt=True)[source]

List recent builds for path (branch or pr)

Note: skip rebuild seems to only apply to jobs, not workflow reruns.

Parameters
  • path (str) – Must be pull/123 if on a fork, otherwise name of branch

  • sha (Optional[str]) – name of optional sha to filter by

  • skip_rebuilt (bool) – Skip artifacts from builds that have been rebuilt

Return type

List[Mapping[str, Any]]

Returns

List of builds, each having build_num, has_artifacts, status, timeout, canceled, canceller, workflows/job_name, vc_revision`, ``build_time_millis

async trigger_job(branch='master', project=None, job=None, params=None)[source]

Trigger specific job

Parameters
  • branch – Must be pull/123 if on fork, otherwise name of branch

  • project – Optionally the project (repo) name

  • job – Specific job from circle/config.yml to run

  • params – Optional dict of parameters (envvars) to override

async trigger_rebuild(branch, sha)[source]

Trigger rebuilding sha on branch.

Parameters
  • branch (str) – Must be pull/123 if on fork, otherwise name of branch

  • sha (str) – The SHA to rebuild

property var_data

Defaults for this API instance

class bioconda_utils.circleci.SlackMessage(_headers, data)[source]

Bases: object

Parses a Slack message as sent by CircleCI