Skip to content

SDK-93: Use HIRUNDO_API_* env vars and add deprecation fallback for legacy names#224

Open
mishana wants to merge 7 commits into
mainfrom
codex/linear-mention-sdk-93-rename-api_key-and-api_endpoint-to-h
Open

SDK-93: Use HIRUNDO_API_* env vars and add deprecation fallback for legacy names#224
mishana wants to merge 7 commits into
mainfrom
codex/linear-mention-sdk-93-rename-api_key-and-api_endpoint-to-h

Conversation

@mishana
Copy link
Copy Markdown
Contributor

@mishana mishana commented May 3, 2026

User description

Motivation

  • Standardize configuration environment variables to HIRUNDO_API_KEY and HIRUNDO_API_HOST and provide a migration path from the legacy API_KEY/API_HOST names.

Description

  • Add _get_env_with_deprecation in hirundo/_env.py to prefer HIRUNDO_API_* and fall back to API_* while emitting a DeprecationWarning when legacy names are used.
  • Update API_HOST/API_KEY lookup and check_api_key message to reference the new HIRUNDO_API_* names.
  • Change CLI commands in hirundo/cli.py to write HIRUNDO_API_KEY and HIRUNDO_API_HOST via upsert_env for set-api-key, change-remote, and setup flows.
  • Update documentation (README.md, docs/index.rst) and example notebooks to reference HIRUNDO_API_KEY and HIRUNDO_API_HOST instead of the old names.

Testing

  • No automated tests were run for this change.

Codex Task


Note

Medium Risk
Moderate risk because it changes how API credentials/host are sourced and written, which can break client configuration if users rely on the old variable names or .env contents. Backward compatibility is provided via fallback reads, but behavior now emits DeprecationWarnings.

Overview
Standardizes configuration on HIRUNDO_API_KEY/HIRUNDO_API_HOST across the SDK.

The env loader now prefers the new variable names and falls back to legacy API_KEY/API_HOST while emitting a DeprecationWarning, and the CLI setup/set-api-key/change-remote commands now write the new variable names into .env/~/.hirundo.conf. Docs and example notebooks are updated to reference the new names, and the missing-key error message now points to HIRUNDO_API_KEY.

Reviewed by Cursor Bugbot for commit 4f1689a. Configure here.


Generated description

Below is a concise technical summary of the changes proposed in this PR:
Standardize SDK credential sourcing by reading HIRUNDO_API_HOST/HIRUNDO_API_KEY (with _get_env_with_deprecation fallback) and adjust the hirundo.cli flows to persist the new variables along with updated user messaging. Align documentation, notebooks, and CLI guidance to mention the new env vars and upgrade dependency pins in pyproject.toml to remediate several CVEs.

TopicDetails
Dependency updates Upgrade key tooling dependencies such as python-dotenv, requests, transformers, pytest, uv, authlib, and cryptography to their patched versions to close the listed CVEs and keep the build/test toolchain secure.
Modified files (1)
  • pyproject.toml
Latest Contributors(2)
UserCommitDate
mishana4life@gmail.comUpdate pyproject.tomlMay 04, 2026
blewis@hirundo.ioSDK-87: Migrate to `uv...February 11, 2026
Other Other files
Modified files (1)
  • uv.lock
Latest Contributors(2)
UserCommitDate
mishana4life@gmail.comSDK-93: Use stable tra...May 04, 2026
blewis@hirundo.ioSDK-87: Migrate to `uv...February 11, 2026
Env config migration Migrate configuration handling to prefer HIRUNDO_API_HOST/HIRUNDO_API_KEY, emit DeprecationWarnings when the legacy names are present, and ensure the CLI setup, set-api-key, and change-remote flows plus docs/notebooks consistently write and mention the new values so users load the correct credentials.
Modified files (7)
  • README.md
  • docs/index.rst
  • hirundo/_env.py
  • hirundo/cli.py
  • notebooks/Cancel_Dataset_QA_Run.ipynb
  • notebooks/Hirundo_Dataset_Optimization_S3.ipynb
  • notebooks/Hirundo_QA_Dataset_HuggingFace.ipynb
Latest Contributors(2)
UserCommitDate
mishana4life@gmail.comSDK-93: Fix duplicated...May 03, 2026
blewis@hirundo.ioSDK-54: Docs update ad...February 11, 2026
This pull request is reviewed by Baz. Review like a pro on (Baz).

@mishana mishana requested a review from a team as a code owner May 3, 2026 21:45
@mishana mishana requested a review from a team as a code owner May 3, 2026 21:45
@mishana mishana added the codex label May 3, 2026
Comment thread notebooks/Cancel_Dataset_QA_Run.ipynb
Comment thread hirundo/_env.py
@benglewis benglewis changed the title Use HIRUNDO_API_* env vars and add deprecation fallback for legacy names SDK-93: Use HIRUNDO_API_* env vars and add deprecation fallback for legacy names May 4, 2026
benglewis
benglewis previously approved these changes May 4, 2026
Copy link
Copy Markdown
Contributor

@benglewis benglewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mishana mishana added this pull request to the merge queue May 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
@mishana mishana added this pull request to the merge queue May 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
@mishana mishana requested a review from a team as a code owner May 4, 2026 09:31
@mishana mishana requested a review from benglewis May 4, 2026 09:41
Copy link
Copy Markdown
Contributor

@benglewis benglewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few last fixes

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Co-authored-by: Ben Lewis <blewis@hirundo.io>
Signed-off-by: Michael Leybovich <mishana4life@gmail.com>
mishana and others added 2 commits May 4, 2026 16:19
Co-authored-by: Ben Lewis <blewis@hirundo.io>
Signed-off-by: Michael Leybovich <mishana4life@gmail.com>
Co-authored-by: Ben Lewis <blewis@hirundo.io>
Signed-off-by: Michael Leybovich <mishana4life@gmail.com>
@mishana mishana requested a review from benglewis May 4, 2026 13:20
Copy link
Copy Markdown
Contributor

@benglewis benglewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mishana mishana added this pull request to the merge queue May 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
@mishana mishana added this pull request to the merge queue May 4, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants