Skip to main content

Python client for the Angles Dashboard API

Project description

angles-python-client

A small Python client for the Angles Dashboard REST API, designed to be a like-for-like port of angles-javascript-client.

Install (local / editable)

pip install -e .

Quick usage (singleton reporter)

from angles_python_client import angles_reporter
from angles_python_client.models import Artifact, ScreenshotPlatform, Platform

angles_reporter.set_base_url("http://127.0.0.1:3000/rest/api/v1.0/")

build = angles_reporter.start_build(
    name="TestRunName",
    team="Team",
    environment="Environment",
    component="Component",
    phase="optional-phase",
)

angles_reporter.add_artifacts([
    Artifact(groupId="angles-ui", artifactId="anglesHQ", version="1.0.0")
])

angles_reporter.start_test(title="test1", suite="suite1")
angles_reporter.add_action("My first action")

platform = ScreenshotPlatform(
    platformName="Android",
    platformVersion="10",
    browserName="Chrome",
    browserVersion="89.0",
    deviceName="Samsung Galaxy S9",
)

screenshot = angles_reporter.save_screenshot_with_platform(
    file_path="/path/to/screenshot.png",
    view="view_1",
    tags=["smoke", "home"],
    platform=platform,
)

angles_reporter.info_with_screenshot("Checking my view on android", screenshot.get("_id"))

angles_reporter.pass_step("Assertion", expected="true", actual="true", info="Just doing an assertion")
angles_reporter.fail_step("Assertion", expected="true", actual="false", info="Just doing an assertion")

execution = angles_reporter.save_test()

Direct requests usage

from angles_python_client import AnglesHttpClient
from angles_python_client.requests import BuildRequests

http = AnglesHttpClient(base_url="http://127.0.0.1:3000/rest/api/v1.0/")
builds = BuildRequests(http)
build = builds.get_build("your-build-id")

Publish a release to PyPI

  1. Bump project.version in pyproject.toml

  2. Push a tag like v1.0.1:

    git tag v1.0.1
    git push origin v1.0.1
    

The workflow .github/workflows/publish.yml will build and publish to PyPI.

Publish to TestPyPI first (optional)

  • Push a tag like test-v1.0.1, or run the Publish to TestPyPI workflow manually.

  • Install from TestPyPI to validate:

    python -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple angles-python-client
    

Build locally (manual)

python -m pip install -U pip build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*

Versioning

This project uses a standard pyproject.toml version = "X.Y.Z" field.

Bump version locally (and create a tag)

pip install -U bump2version
bump2version patch   # or minor / major
git push --follow-tags

Bump via GitHub Actions (and publish)

Run the Bump version and tag workflow (Actions tab) and choose:

  • target=pypi → creates a tag like v1.0.1 (triggers the PyPI publish workflow)
  • target=testpypi → creates a tag like test-v1.0.1 (triggers the TestPyPI publish workflow)

Auto-release on main/master

This repo includes an optional workflow: .github/workflows/release-on-main.yml.

When enabled (it is committed by default), every push to main or master will:

  1. Read the current project.version from pyproject.toml
  2. Create and push a git tag vX.Y.Z (if it doesn't already exist)
  3. Build and publish to PyPI (Trusted Publishing)
  4. Bump the version patch for the next release and push that commit back to the default branch

To avoid loops, the post-bump commit includes [skip release] and the workflow ignores commits containing that marker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

angles_python_client_sarm333-1.0.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

angles_python_client_sarm333-1.0.1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file angles_python_client_sarm333-1.0.1.tar.gz.

File metadata

File hashes

Hashes for angles_python_client_sarm333-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0a3736c0b7d53b1c981caf86f7e8217ecc22e9b8b8029088a0c4d68c603666e9
MD5 e165f738492361ba0e767029c1cfd018
BLAKE2b-256 f8263ede2f0bb6511520a3c787f5b6548fb57074e8ac5f6a926e4c40c5a5b34e

See more details on using hashes here.

Provenance

The following attestation bundles were made for angles_python_client_sarm333-1.0.1.tar.gz:

Publisher: release-on-main.yml on sarm333/angles-python-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file angles_python_client_sarm333-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for angles_python_client_sarm333-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8aca36ba082b00c438cce680212b07c4918998d1801cf886ded36cb28870194c
MD5 7e59ff87cf8a63a2fc95ecc779d2f845
BLAKE2b-256 78b05819e1989d7fe2e78779c3dc84fe893c19fcb62e763426985672e3f20fce

See more details on using hashes here.

Provenance

The following attestation bundles were made for angles_python_client_sarm333-1.0.1-py3-none-any.whl:

Publisher: release-on-main.yml on sarm333/angles-python-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page