Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

## [0.5.1] - 2026-03-18
### Fixed
- Fixed saving project to pephub [#55](https://github.com/pepkit/pephubclient/issues/55)

## [0.5.0] - 2026-01-26
### Added
Expand Down
2 changes: 1 addition & 1 deletion pephubclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import coloredlogs

__app_name__ = "pephubclient"
__version__ = "0.5.0"
__version__ = "0.5.1"
__author__ = "Oleksandr Khoroshevskyi, Rafal Stepien"


Expand Down
24 changes: 17 additions & 7 deletions pephubclient/pephubclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing_extensions import deprecated

import peppy
from peppy.const import NAME_KEY
from peppy.const import NAME_KEY, CONFIG_KEY
import urllib3
from pydantic import ValidationError
from ubiquerg import parse_registry_path
Expand Down Expand Up @@ -167,14 +167,15 @@ def upload(
:param force: overwrite project if it exists
:return: None
"""
pep_dict = project.to_dict(
extended=True,
orient="records",
)
if name:
project[NAME_KEY] = name
pep_dict[CONFIG_KEY][NAME_KEY] = name

upload_data = ProjectUploadData(
pep_dict=project.to_dict(
extended=True,
orient="records",
),
pep_dict=pep_dict,
tag=tag,
is_private=is_private,
overwrite=force,
Expand All @@ -201,8 +202,17 @@ def upload(
"User does not have permission to write to this namespace!"
)
else:
detail = ""
try:
detail = self.decode_response(pephub_response, output_json=True).get(
"detail", ""
)
except Exception:
pass
raise ResponseError(
f"Unexpected Response Error. {pephub_response.status_code}"
f"Unexpected Response Error. {pephub_response.status_code}: {detail}"
if detail
else f"Unexpected Response Error. {pephub_response.status_code}"
)
return None

Expand Down
1 change: 0 additions & 1 deletion pephubclient/schemas/schema_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def add_version(
tags: List[str] = typer.Option(list(), help="Tags of the version"),
release_notes: str = typer.Option("", help="Version release notes"),
):

schema_value = open_schema(schema)
call_client_func(
_client_schema.add_version,
Expand Down
3 changes: 0 additions & 3 deletions tests/test_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

# @pytest.mark.skip("Tests are not implemented yet")
class TestSchemas:

def test_get_schema(self, mocker, test_jwt):
jwt_mock = mocker.patch(
"pephubclient.files_manager.FilesManager.load_jwt_data_from_file",
Expand Down Expand Up @@ -119,7 +118,6 @@ def test_update_schema(self, mocker, test_jwt):
assert requests_mock.called

def test_delete_schema(self, mocker, test_jwt):

jwt_mock = mocker.patch(
"pephubclient.files_manager.FilesManager.load_jwt_data_from_file",
return_value=test_jwt,
Expand Down Expand Up @@ -188,7 +186,6 @@ def test_update_version(self, mocker, test_jwt):
assert requests_mock.called

def test_delete_version(self, mocker, test_jwt):

jwt_mock = mocker.patch(
"pephubclient.files_manager.FilesManager.load_jwt_data_from_file",
return_value=test_jwt,
Expand Down
Loading