Skip to main content

A client library for accessing FastAPI

Project description

Python Package Template

The template repository for creating python packages, shared across auth-broker.

Python UV Hatchling Ruff Pre-commit Pytest Coverage GitHub Actions PyPI Makefile

🦜🕸️

CI


Template Checklist

  • Create module src/ab_client/your_package_name -> src/ab_client/your_package_name
  • Update pyproject.toml: [project] section based on your package name / versioning etc.
  • Update README.md references of your-package-name -> your-package-name
  • Remove this section

Table of Contents


Introduction

This template repository aims to create a reusable package template which streamlines the creation and publishing of isolated python packages in auth-broker. This is aligned with the engineering vision @ auth-broker for better modularisation and reusability of code.


Quick Start

Since this is just a package, and not a service, there is no real "run" action. But you can run the tests immediately.

Here are a list of available commands via make.

Bare Metal (i.e. your machine)

  1. make install - install the required dependencies.
  2. make test - runs the tests.

Docker

  1. make build-docker - build the docker image.
  2. make run-docker - run the docker compose services.
  3. make test-docker - run the tests in docker.
  4. make clean-docker - remove all docker containers etc.

Installation

For Dev work on the repo

Install uv, (if you haven't already) https://docs.astral.sh/uv/getting-started/installation/#installation-methods

brew install uv

Initialise pre-commit (validates ruff on commit.)

uv run pre-commit install

Install dependencies (including dev dependencies)

uv sync

If you are adding a new dev dependency, please run:

uv add --dev {your-new-package}

Namespaces

Packages all share the same namespace ab_client. To import this package into your project:

from ab_client.template import placeholder_func

We encourage you to make your package available to all of ab via this ab_client namespace. The goal is to streamline development, POCs and overall collaboration.


Usage

Adding the dependency to your project

The library is available on PyPI. You can install it using the following command:

Using pip:

pip install your-package-name

Using UV

Note: there is currently no nice way like poetry, hence we still needd to provide the full url. https://github.com/astral-sh/uv/issues/10140

Add the dependency

uv add your-package-name

Using poetry:

Then run the following command to install the package:

poetry add your-package-name

How tos

Example Usage

# Please update this based on your package!

from ab_client.template import placeholder_func


if __name__ == "__main__":
    print("This is a placeholder: ", placeholdder_func())

Formatting and linting

We use Ruff as the formatter and linter. The pre-commit has hooks which runs checking and applies linting automatically. The CI validates the linting, ensuring main is always looking clean.

You can manually use these commands too:

  1. make lint - check for linting issues.
  2. make format - fix linting issues.

CICD

Publishing to PyPI

We publish to PyPI using Github releases. Steps are as follows:

  1. Manually update the version in pyproject.toml file using a PR and merge to main. Use uv version --bump {patch/minor/major} to update the version.
  2. Create a new release in Github with the tag name as the version number. This will trigger the publish workflow. In the Release window, type in the version number and it will prompt to create a new tag.
  3. Verify the release in PyPI

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

ab_client_auth_client-1.3.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

ab_client_auth_client-1.3.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file ab_client_auth_client-1.3.1.tar.gz.

File metadata

  • Download URL: ab_client_auth_client-1.3.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ab_client_auth_client-1.3.1.tar.gz
Algorithm Hash digest
SHA256 014c147e7608bfc94de1b6dcbf90a382a590f8ccec4dcc30ee9f9a77cbd994d1
MD5 c5f609fb44616bed00c6d6963b9a82d0
BLAKE2b-256 2ab93e4e35d08ad83caecdf5f887c59c19cb446733d37d7ce43483da5ece8a30

See more details on using hashes here.

File details

Details for the file ab_client_auth_client-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: ab_client_auth_client-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ab_client_auth_client-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dbacbd00b01cc70df66fab611c16888c145e1f8b4c290f126d9dc71058fc0976
MD5 a41c717d8bacdc32a27291dcd3ee16a2
BLAKE2b-256 80bc0f35930762c3abe57aa445108a19f171dc23fc36df0587dbd8ce8ea2da5c

See more details on using hashes here.

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