Skip to content

Release 0.50.0a3#515

Open
khoroshevskyi wants to merge 1 commit into
peppy0_50from
peppy0_50_a3
Open

Release 0.50.0a3#515
khoroshevskyi wants to merge 1 commit into
peppy0_50from
peppy0_50_a3

Conversation

@khoroshevskyi

@khoroshevskyi khoroshevskyi commented Jun 27, 2026

Copy link
Copy Markdown
Member

Changes:

  • Added schemas to pephubclient module.
  • Improved Pephubclient Token caching.
  • Adopted pephub api changes due to peprs module

TODO:

- Adapting new pephub api to work with phc module.
- New login method in phc module
@khoroshevskyi
khoroshevskyi changed the base branch from master to peppy0_50 June 27, 2026 17:35
@khoroshevskyi
khoroshevskyi requested a review from Copilot June 27, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR prepares the peppy.pephubclient package for the 0.50.0a3 release by updating client behavior to match PEPhub API changes, improving auth token persistence/caching, and introducing first-class schema registry support (API + CLI).

Changes:

  • Added a new schema subclient (PEPHubSchema) and pephubclient schema CLI commands for fetching/creating/updating/deleting schemas and versions.
  • Reworked auth token persistence to cache both JWT + base URL in a TOML file, and updated login behavior to optionally register a provided token and/or override the host URL.
  • Updated project/sample payload field naming to match updated PEPhub API expectations, and extended project search with an optional tag filter.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/phctests/test_pephubclient.py Updates mocks for token caching changes and adds tests for new login behaviors (token + URL).
tests/phctests/conftest.py Updates test PEP fixture keys to match new samples/subsamples naming.
pyproject.toml Adds toml dependency required for token cache persistence.
peppy/pephubclient/schemas/schema.py Implements schema CRUD/version endpoints via a new PEPHubSchema RequestManager.
peppy/pephubclient/schemas/schema_cli.py Adds Typer CLI commands for schema operations.
peppy/pephubclient/schemas/models.py Introduces pydantic models for schema record/version request/response payloads.
peppy/pephubclient/schemas/constants.py Adds PEPhub schema endpoint URL constants.
peppy/pephubclient/schemas/init.py Adds package marker for the new schemas module.
peppy/pephubclient/pephubclient.py Integrates cached token/base_url, adds schema subclient, updates URL construction, upload payload keys, and search tag filtering.
peppy/pephubclient/pephub_oauth/pephub_oauth.py Adds base URL override support for device-code OAuth endpoints.
peppy/pephubclient/pephub_oauth/const.py Refactors OAuth URIs into relative paths to support base URL override.
peppy/pephubclient/models.py Renames API-facing project fields to samples/subsamples while preserving internal aliases.
peppy/pephubclient/helpers.py Adds schema file open/save helpers and schema path parsing.
peppy/pephubclient/files_manager.py Implements TOML-backed cached token read/write.
peppy/pephubclient/exceptions.py Adds a new file-not-found exception type.
peppy/pephubclient/constants.py Adds CachedToken, base URL defaults, and updates cache file location semantics (PH_HOME support).
peppy/pephubclient/cli.py Extends login CLI to accept optional token and url, and adds the schema subcommand tree.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"""Credentials persisted to the TOML cache file."""

token: str | None = None
base_url: str = DEFAULT_BASE_URL
Comment on lines 25 to +28
with suppress(FileNotFoundError):
with open(path, "r") as f:
return f.read()
return CachedToken(**toml.load(f))
return CachedToken()
Comment on lines +41 to +45
self.__base_url = cached.base_url.rstrip("/") + "/"

self.__view = PEPHubView(self.__jwt_data)
self.__sample = PEPHubSample(self.__jwt_data)
self.__schema = PEPHubSchema(self.__jwt_data)
"q": query_string,
"limit": limit,
"offset": offset,
"tag": tag,

class UpdateSchemaVersionFields(BaseModel):
contributors: str | None = None
schema_value: str | None = None
Comment on lines +375 to +377
_LOGGER.info(
f"Schema record '{namespace}/{schema_name}' was updated successfully!"
)
Comment on lines +422 to +424
_LOGGER.info(
f"Schema version '{namespace}/{schema_name}:{version}' was updated successfully!"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants