Release 0.50.0a3#515
Open
khoroshevskyi wants to merge 1 commit into
Open
Conversation
- Adapting new pephub api to work with phc module. - New login method in phc module
There was a problem hiding this comment.
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) andpephubclient schemaCLI 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
tagfilter.
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!" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes:
TODO: