Skip to main content

A standalone client for the NLR's Alfalfa application

Project description

Pacer Client

The purpose of this repository is to provide a standalone client for use with the Alfalfa application. It additionally includes a Historian to quickly/easily enable saving of results from Alfalfa simulations.

Usage

This repo is packaged and hosted on PyPI here.

pip install pacer-client
from pacer_client.pacer_client import PacerClient

client = PacerClient("http://localhost")

Renaming from alfalfa-client: this project was renamed from alfalfa-client/AlfalfaClient to pacer-client/PacerClient. During the transition, both names keep working: AlfalfaClient is an alias of PacerClient, and the alfalfa_client package/pip install alfalfa-client continue to be published with identical functionality (see alfalfa_client/__init__.py). import alfalfa_client (in any form) emits a DeprecationWarning pointing you to pacer_client; the alfalfa-client name and imports will eventually be removed, so new code should prefer pacer_client/PacerClient.

Additional documentation for the functions of pacer-client can be found here.

Development

Prerequisites:

  • poetry for managing environment

Cloning and Installing:

git clone https://github.com/NatLabRockies/alfalfa-client.git
cd alfalfa-client
poetry install

Running Tests: All pacer-client tests currently require a running instance of Alfalfa with at least 2 workers.

poetry run pytest -m integration

Releasing

Every PR must carry at least one categorization label (breaking, enhancement, bug, dependencies, github_actions, python, documentation, add test, or do not publish to exclude it) — this is enforced by the Verify Pull Request Labeling CI check and is what allows GitHub to group the auto-generated release notes correctly, per .github/release.yml.

  1. Confirm all PRs intended for the release are merged into develop, are labeled correctly, and CI is passing.
  2. Bump the version on develop (assume version is 0.1.2): poetry version 0.1.2, open a PR, and merge it once tests pass.
  3. Fast-forward main to develop so both branches point at the same commit (do not create a merge commit):
    git checkout main
    git merge --ff-only develop
    git push origin main
    
    If --ff-only fails, main and develop have diverged (e.g. a hotfix landed only on main) — reconcile that first so the release doesn't leave the branches out of sync.
  4. Draft a release on the GitHub repository targeting main (tag v0.1.2) and click "Generate release notes" (UI), or run gh release create v0.1.2 --target main --generate-notes --draft — do not publish yet.
  5. Copy the generated "## What's Changed" notes into CHANGELOG.md under the # Unreleased section, then (as part of the release) rename that header to # pacer-client Version 0.1.2 and add the **Full Changelog** line.
  6. Commit this alongside the version bump PR, or as a quick follow-up commit on main.
  7. Publish the drafted release. This triggers the PyPIRelease workflow (.github/workflows/pypi_release.yml), which builds the package twice (once as pacer-client, once with the name swapped to alfalfa-client) and publishes both to PyPI via trusted publishing — no manual poetry build/poetry publish needed. Both distributions have identical contents; this keeps pip install alfalfa-client working during the rename transition (see the note in the README's Usage section). Publishing to alfalfa-client requires a Trusted Publisher to be configured on that PyPI project pointing at the pypi_release_alfalfa environment — set this up once on pypi.org before the first release after this change.
  8. Confirm the new version appears on both pacer-client and alfalfa-client on PyPI, and that the release notes and CHANGELOG.md match.

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

alfalfa_client-1.1.0rc1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

alfalfa_client-1.1.0rc1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file alfalfa_client-1.1.0rc1.tar.gz.

File metadata

  • Download URL: alfalfa_client-1.1.0rc1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for alfalfa_client-1.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 023c08c1c3f3208d70a0fc0c99702f79a544137215be97e112272545cc2d4881
MD5 b311babcd36b6ee8624bb85d64e32f41
BLAKE2b-256 8729a945dfa4c1f22ba32262b33d1261c6250219f834d982522e01c3a87c7f0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for alfalfa_client-1.1.0rc1.tar.gz:

Publisher: pypi_release.yml on NatLabRockies/alfalfa-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 alfalfa_client-1.1.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for alfalfa_client-1.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 7acf78c32c86440d9176f5e975c7827f7686b744d50a9b9ceabf2b4dc24b35e0
MD5 3c543c65beb92ac212b40e6be988f2b6
BLAKE2b-256 161c2260ba5e777f622b2ab4698e4336474d0956674b95553702cce401224491

See more details on using hashes here.

Provenance

The following attestation bundles were made for alfalfa_client-1.1.0rc1-py3-none-any.whl:

Publisher: pypi_release.yml on NatLabRockies/alfalfa-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