diff --git a/README.md b/README.md index 0173b69..5e6f626 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,9 @@ Additionally, our client supports pephub authorization. The authorization process is based on pephub device authorization protocol. To upload projects or to download private projects, user must be authorized through pephub. +If you want to use your own pephub instance, you can specify it by setting `PEPHUB_BASE_URL` environment variable. +e.g. `export PEPHUB_BASE_URL=https://pephub.databio.org` (This is original pephub instance) + To login, use the `login` argument; to logout, use `logout`. ---- diff --git a/docs/changelog.md b/docs/changelog.md index 5dbb083..be7aa7e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,10 @@ 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.2.2] - 2024-01-06 +### Added +- customization of the base pephub URL. [#22](https://github.com/pepkit/pephubclient/issues/22) + ## [0.2.1] - 2023-11-01 ### Added - is_registry_path checker function diff --git a/pephubclient/__init__.py b/pephubclient/__init__.py index 60771ac..8e2e1a5 100644 --- a/pephubclient/__init__.py +++ b/pephubclient/__init__.py @@ -1,7 +1,7 @@ from pephubclient.pephubclient import PEPHubClient __app_name__ = "pephubclient" -__version__ = "0.2.1" +__version__ = "0.2.2" __author__ = "Oleksandr Khoroshevskyi, Rafal Stepien" diff --git a/pephubclient/constants.py b/pephubclient/constants.py index 7ee023a..0c4a79f 100644 --- a/pephubclient/constants.py +++ b/pephubclient/constants.py @@ -1,10 +1,11 @@ from enum import Enum from typing import Optional +import os import pydantic from pydantic import BaseModel -PEPHUB_BASE_URL = "https://pephub.databio.org/" +PEPHUB_BASE_URL = os.getenv("PEPHUB_BASE_URL", default="https://pephub.databio.org/") # PEPHUB_BASE_URL = "http://0.0.0.0:8000/" PEPHUB_PEP_API_BASE_URL = f"{PEPHUB_BASE_URL}api/v1/projects/" PEPHUB_PEP_SEARCH_URL = f"{PEPHUB_BASE_URL}api/v1/namespaces/{{namespace}}/projects"