Skip to content

Commit

Permalink
fix #202, update version and changelog to 0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Aug 26, 2024
1 parent d772d41 commit 402ab1c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.10.2] - 2024-08-26
### Fixed
- add obtaining pephub_path from config file, [#202](https://github.com/pepkit/pipestat/issues/202)

## [0.10.1] - 2024-08-06
### Fixed
- add pipestat summarize and link for pephub backend
Expand Down
2 changes: 1 addition & 1 deletion pipestat/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.10.1"
__version__ = "0.10.2"
10 changes: 7 additions & 3 deletions pipestat/pipestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(

# Load and validate database configuration
# If results_file_path exists, backend is a file else backend is database.
self.cfg["pephub_path"] = pephub_path

self.cfg["config_path"] = select_config(config_file, ENV_VARS["config"])

if config_dict is not None:
Expand All @@ -181,6 +181,10 @@ def __init__(
cfg_schema = load_yaml(CFG_SCHEMA)
validate(self.cfg[CONFIG_KEY].exp, cfg_schema)

self.cfg["pephub_path"] = self.cfg[CONFIG_KEY].priority_get(
"pephub_path", override=pephub_path
)

self.cfg[SCHEMA_PATH] = self.cfg[CONFIG_KEY].priority_get(
"schema_path", env_var=ENV_VARS["schema"], override=schema_path
)
Expand Down Expand Up @@ -244,8 +248,8 @@ def __init__(
if self.cfg[FILE_KEY]:
self.initialize_filebackend(record_identifier, results_file_path, flag_file_dir)

elif pephub_path:
self.initialize_pephubbackend(record_identifier, pephub_path)
elif self.cfg["pephub_path"]:
self.initialize_pephubbackend(record_identifier, self.cfg["pephub_path"])
else:
self.initialize_dbbackend(record_identifier, show_db_logs)

Expand Down
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ def config_file_path():
return get_data_file_path("config.yaml")


@pytest.fixture
def config_file_path_pephub():
return get_data_file_path("config_pephub_url.yaml")


@pytest.fixture
def config_no_schema_file_path():
return get_data_file_path("config_no_schema.yaml")
Expand Down
1 change: 1 addition & 0 deletions tests/data/config_pephub_url.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pephub_path: "databio/pipestat_demo:default"
21 changes: 21 additions & 0 deletions tests/test_pipestat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2589,6 +2589,27 @@ def test_pephub_backend_retrieve_one(

assert len(result.keys()) == 6

@pytest.mark.parametrize(
["rec_id", "val"],
[
("test_pipestat_01", {"name_of_something": "test_name"}),
],
)
def test_pephub_backend_config_file(
self,
rec_id,
val,
config_file_path_pephub,
schema_file_path,
):

# Can pipestat obtain pephub url from config file AND successfully retrieve values?
psm = PipestatManager(config_file=config_file_path_pephub, schema_path=schema_file_path)

result = psm.retrieve_one(record_identifier=rec_id)

assert len(result.keys()) == 6

def test_pephub_backend_retrieve_many(
self,
config_file_path,
Expand Down

0 comments on commit 402ab1c

Please sign in to comment.