Skip to content

Commit

Permalink
#475: Investigate failing PyPi package (v1.0.1) (#476)
Browse files Browse the repository at this point in the history
* #475: use relative path for imported dir, remove overwrite from package

* #475: fix other case of absolute file path
  • Loading branch information
cwschilly authored Nov 8, 2023
1 parent d1b8633 commit d76f7f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/lbaf/Execution/lbsAlgorithmBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,11 @@ def _update_distributions_and_statistics(self, distributions: dict, statistics:
statistics.setdefault(k, []).append(getattr(stats, f"get_{v}")())

def __print_QOI(self,rank_or_obj):
"""Print list of implemented QOI based on the '-verbosity' command line argument."""
"""Print list of implemented QOI when invalid QOI is given."""
# Initialize file paths
TARGET_DIR = os.path.join(PROJECT_PATH, "src", "lbaf", "Model")
CURRENT_PATH = os.path.abspath(__file__)
TARGET_DIR = os.path.join(
os.path.dirname(os.path.dirname(CURRENT_PATH)), "Model")
RANK_SCRIPT_NAME = "lbsRank.py"
OBJECT_SCRIPT_NAME = "lbsObject.py"

Expand Down
5 changes: 4 additions & 1 deletion src/lbaf/Utils/lbsJSONDataFilesValidatorLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
from lbaf.Utils.lbsWeb import download
# pylint:disable=C0413:wrong-import-position

IMPORT_DIR = os.path.join(PROJECT_PATH, "src", "lbaf", "imported")
CURRENT_PATH = os.path.abspath(__file__)
IMPORT_DIR = os.path.join(
os.path.dirname(os.path.dirname(CURRENT_PATH)),
"imported")
TARGET_SCRIPT_NAME = "JSON_data_files_validator.py"
SCRIPT_URL = f"https://raw.githubusercontent.com/DARMA-tasking/vt/develop/scripts/{TARGET_SCRIPT_NAME}"
SCRIPT_TITLE = "JSON data files validator"
Expand Down
8 changes: 6 additions & 2 deletions src/lbaf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import importlib


__version__ = "1.0.1"
__version__ = "1.0.2"
"""lbaf module version"""

PROJECT_PATH = f"{os.sep}".join(os.path.abspath(__file__).split(os.sep)[:-3])
Expand Down Expand Up @@ -38,7 +38,11 @@ def vt_data_files_validator_loader() -> int:

def vt_data_files_validator():
"""Run vt_data_validator instance."""
JSONDataFilesValidatorLoader().run(overwrite=True)
# If using the lbaf package, don't overwrite
if importlib.util.find_spec('lbaf'):
JSONDataFilesValidatorLoader().run(overwrite=False)
else:
JSONDataFilesValidatorLoader().run(overwrite=True)
from lbaf.imported.JSON_data_files_validator import JSONDataFilesValidator #pylint:disable=C0415:import-outside-toplevel
JSONDataFilesValidator().main()

Expand Down

0 comments on commit d76f7f9

Please sign in to comment.