Branch

Just another Python API for Travis CI (API).

A module which provides the “Branch” resource type.

Author:
Nissar Chababy, @funilrys, contactTATAfunilrysTODTODcom
Project link:
https://github.com/funilrys/PyTravisCI
Project documentation:
https://pytravisci.readthedocs.io/en/latest/

License

MIT License

Copyright (c) 2019, 2020, 2021, 2022 Nissar Chababy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
class PyTravisCI.resource_types.branch.Branch(**kwargs)[source]

Bases: PyTravisCI.resource_types.base.ResourceTypesBase

Provides the description of a branch.

Official Travis CI API documentation:
Variables:
  • name (str) – Name of the git branch.
  • repository (Repository) – GitHub user or organization the branch belongs to.
  • default_branch (bool) – Whether or not this is the respository’s default branch.
  • exists_on_github (bool) – Whether or not the branch still exists on GitHub.
  • last_build (Build) – Last build on the branch.
  • recent_builds (List[Build]) – Last 10 builds on the branch (when include=branch.recent_builds is used).
create_cron(interval: str, *, dont_run_if_recent_build_exists: bool = False, params: Optional[dict] = None) → PyTravisCI.resource_types.cron.Cron[source]

Creates a new cron associated to the current branch.

Official Travis CI API documentation:
Parameters:
  • interval – Interval at which the cron will run (can be daily, weekly or monthly).
  • dont_run_if_recent_build_exists – Whether a cron build should run if there has been a build on this branch in the last 24 hours.
  • params – The query parameters to append to the URL.
get_cron(*, params: Optional[dict] = None) → Optional[PyTravisCI.resource_types.cron.Cron][source]

Provides the cron of the current branch.

Official Travis CI API documentation:
Parameters:params – The query parameters to append to the URL.