-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from CBIIT/bugfix/bento-mdb#6/fix-prop-duplica…
…tion Bugfix/bento mdb#6/fix prop duplication
- Loading branch information
Showing
9 changed files
with
58 additions
and
103 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[project] | ||
name = "bento-meta" | ||
version = "0.2.3" | ||
version = "0.2.4" | ||
description = "Python drivers for Bento Metamodel Database" | ||
authors = [ | ||
{ name="Mark A. Jensen", email = "[email protected]"}, | ||
|
@@ -20,7 +20,7 @@ classifiers = [ | |
|
||
[tool.poetry] | ||
name = "bento-meta" | ||
version = "0.2.3" | ||
version = "0.2.4" | ||
description = "Python drivers for Bento Metamodel Database" | ||
authors = [ | ||
"Mark A. Jensen <[email protected]>", | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
bento_meta.util.changelog | ||
Common functions shared by changelog generation scripts | ||
""" | ||
import configparser | ||
import logging | ||
from typing import Generator, Optional | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def get_initial_changeset_id(config_file_path: str) -> int: | ||
"""Gets initial changeset id from changelog config file""" | ||
config = configparser.ConfigParser() | ||
config.read(config_file_path) | ||
try: | ||
return config.getint(section="changelog", option="changeset_id") | ||
except (configparser.NoSectionError, configparser.NoOptionError) as error: | ||
logger.error(f"Reading changeset ID failed: {error}") | ||
raise | ||
|
||
|
||
def changeset_id_generator(config_file_path: str) -> Generator[int, None, None]: | ||
"""Generates sequential changeset IDs by reading the latest ID from a config file.""" | ||
i = get_initial_changeset_id(config_file_path) | ||
while True: | ||
yield i | ||
i += 1 | ||
|
||
|
||
def update_config_changeset_id(config_file_path: str, new_changeset_id: int) -> None: | ||
"""Updates changelog config file with new changeset id.""" | ||
config = configparser.ConfigParser() | ||
config.read(config_file_path) | ||
config.set(section="changelog", option="changeset_id", value=str(new_changeset_id)) | ||
with open(file=config_file_path, mode="w", encoding="UTF-8") as config_file: | ||
config.write(fp=config_file) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[changelog] | ||
changeset_id = 6855 | ||
changeset_id = 1 | ||
|
This file contains 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