runem 0.0.13__py3-none-any.whl → 0.0.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- runem/runem.py +30 -23
- {runem-0.0.13.dist-info → runem-0.0.14.dist-info}/METADATA +1 -1
- {runem-0.0.13.dist-info → runem-0.0.14.dist-info}/RECORD +7 -7
- {runem-0.0.13.dist-info → runem-0.0.14.dist-info}/LICENSE +0 -0
- {runem-0.0.13.dist-info → runem-0.0.14.dist-info}/WHEEL +0 -0
- {runem-0.0.13.dist-info → runem-0.0.14.dist-info}/entry_points.txt +0 -0
- {runem-0.0.13.dist-info → runem-0.0.14.dist-info}/top_level.txt +0 -0
runem/runem.py
CHANGED
@@ -651,13 +651,22 @@ def _get_test_function(
|
|
651
651
|
function_to_load: str,
|
652
652
|
) -> JobFunction:
|
653
653
|
"""Given a job-description dynamically loads the test-function so we can call it."""
|
654
|
+
|
655
|
+
# first locate the module relative to the config file
|
656
|
+
abs_module_file_path: pathlib.Path = (
|
657
|
+
cfg_filepath.parent / module_file_path
|
658
|
+
).absolute()
|
659
|
+
|
654
660
|
# load the function
|
655
661
|
module_spec = importlib.util.spec_from_file_location(
|
656
|
-
function_to_load,
|
662
|
+
function_to_load, abs_module_file_path
|
657
663
|
)
|
658
664
|
if not module_spec:
|
659
665
|
raise FunctionNotFound(
|
660
|
-
|
666
|
+
(
|
667
|
+
f"unable to load '${function_to_load}' from '{str(module_file_path)} "
|
668
|
+
f"relative to '{str(cfg_filepath)}"
|
669
|
+
)
|
661
670
|
)
|
662
671
|
|
663
672
|
module = importlib.util.module_from_spec(module_spec)
|
@@ -671,7 +680,7 @@ def _get_test_function(
|
|
671
680
|
raise FunctionNotFound(
|
672
681
|
(
|
673
682
|
f"ERROR! Check that function '{function_to_load}' "
|
674
|
-
f"exists in '{module_file_path}' as expected in "
|
683
|
+
f"exists in '{str(module_file_path)}' as expected in "
|
675
684
|
f"your config at '{str(cfg_filepath)}"
|
676
685
|
)
|
677
686
|
) from err
|
@@ -683,6 +692,7 @@ def _find_job_module(cfg_filepath: pathlib.Path, module_file_path: str) -> pathl
|
|
683
692
|
module_path: pathlib.Path = pathlib.Path(module_file_path)
|
684
693
|
|
685
694
|
module_path_cands = [
|
695
|
+
module_path,
|
686
696
|
module_path.absolute(),
|
687
697
|
(cfg_filepath.parent / module_file_path).absolute(),
|
688
698
|
]
|
@@ -697,7 +707,7 @@ def _find_job_module(cfg_filepath: pathlib.Path, module_file_path: str) -> pathl
|
|
697
707
|
)
|
698
708
|
)
|
699
709
|
module_path = module_path.absolute()
|
700
|
-
return module_path.relative_to(
|
710
|
+
return module_path.relative_to(cfg_filepath.parent.absolute())
|
701
711
|
|
702
712
|
|
703
713
|
def get_test_function(job_config: JobConfig, cfg_filepath: pathlib.Path) -> JobFunction:
|
@@ -719,26 +729,16 @@ def get_test_function(job_config: JobConfig, cfg_filepath: pathlib.Path) -> JobF
|
|
719
729
|
)
|
720
730
|
) from err
|
721
731
|
|
732
|
+
anchored_file_path = cfg_filepath.parent / module_file_path
|
733
|
+
assert (
|
734
|
+
anchored_file_path.exists()
|
735
|
+
), f"{module_file_path} not found at {anchored_file_path}!"
|
736
|
+
|
722
737
|
module_name = module_file_path.stem.replace(" ", "_").replace("-", "_")
|
723
738
|
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
)
|
728
|
-
except FunctionNotFound:
|
729
|
-
print(
|
730
|
-
(
|
731
|
-
f"WARNING: job: '{job_config['label']}': Failed to find "
|
732
|
-
f"function file {job_config['addr']['file']}"
|
733
|
-
)
|
734
|
-
)
|
735
|
-
# re-write the file entry in the job
|
736
|
-
job_config["addr"]["file"] = __file__
|
737
|
-
module_file_path = pathlib.Path(job_config["addr"]["file"])
|
738
|
-
# the follow may throw if the fun isn't in this file, as intended
|
739
|
-
function = _get_test_function(
|
740
|
-
cfg_filepath, module_name, module_file_path, function_to_load
|
741
|
-
)
|
739
|
+
function = _get_test_function(
|
740
|
+
cfg_filepath, module_name, module_file_path, function_to_load
|
741
|
+
)
|
742
742
|
|
743
743
|
# re-write the job-config file-path for the module with the one that worked
|
744
744
|
job_config["addr"]["file"] = str(module_file_path)
|
@@ -804,6 +804,10 @@ def filter_jobs(
|
|
804
804
|
verbose: bool,
|
805
805
|
) -> PhaseGroupedJobs:
|
806
806
|
"""Filters the jobs to match requested tags."""
|
807
|
+
print(f"filtering for tags {tags_to_run}", end="")
|
808
|
+
if tags_to_avoid:
|
809
|
+
print("excluding jobs with tags {tags_to_avoid}", end="")
|
810
|
+
print()
|
807
811
|
filtered_jobs: PhaseGroupedJobs = defaultdict(list)
|
808
812
|
for phase in config_metadata.phases:
|
809
813
|
if phase not in phases_to_run:
|
@@ -825,7 +829,7 @@ def filter_jobs(
|
|
825
829
|
print(
|
826
830
|
(
|
827
831
|
f"will run {len(filtered_jobs[phase])} jobs "
|
828
|
-
f"for phase '{phase}'
|
832
|
+
f"for phase '{phase}'"
|
829
833
|
)
|
830
834
|
)
|
831
835
|
print(f"\t{[job['label'] for job in filtered_jobs[phase]]}")
|
@@ -1021,6 +1025,9 @@ def _main( # noqa: C901 # pylint: disable=too-many-branches,too-many-statements
|
|
1021
1025
|
if args.verbose:
|
1022
1026
|
print(f"loaded config from {cfg_filepath}")
|
1023
1027
|
|
1028
|
+
# first anchor the cwd to the config-file, so that git ls-files works
|
1029
|
+
os.chdir(cfg_filepath.parent)
|
1030
|
+
|
1024
1031
|
file_lists: FilePathListLookup = _find_files(config_metadata)
|
1025
1032
|
assert file_lists
|
1026
1033
|
print(f"found {len(file_lists)} batches, ", end="")
|
@@ -4,11 +4,11 @@ runem/base.py,sha256=EZfR7FIlwEdU9Vfe47Wk2DOO8GQqpKxxLNKp6YHueZ4,316
|
|
4
4
|
runem/cli.py,sha256=YFwon1P7uSpAYNuJxe2f0wo0HpI3OYTQ-UBWx6xU1iY,145
|
5
5
|
runem/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
runem/run_command.py,sha256=eYArn2gwPOTHID2040NxLoaM7yrvPnaWgWvPreRhrm0,3685
|
7
|
-
runem/runem.py,sha256=
|
7
|
+
runem/runem.py,sha256=LWoRiQLM2O3DUNha8BtYTz00RfGoTXebGXm5YubK4Rw,35906
|
8
8
|
scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
runem-0.0.
|
10
|
-
runem-0.0.
|
11
|
-
runem-0.0.
|
12
|
-
runem-0.0.
|
13
|
-
runem-0.0.
|
14
|
-
runem-0.0.
|
9
|
+
runem-0.0.14.dist-info/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
10
|
+
runem-0.0.14.dist-info/METADATA,sha256=8ppZEqvPTA7Cj-4lvqXr0GHH0qYrXdAzTTpUwAAc0oE,15909
|
11
|
+
runem-0.0.14.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
12
|
+
runem-0.0.14.dist-info/entry_points.txt,sha256=nu0g_vBeuPihYtimbtlNusxWovylMppvJ8UxdJlJfvM,46
|
13
|
+
runem-0.0.14.dist-info/top_level.txt,sha256=rd8MZEjuPdjwXuLZlbdZEg8_WGxrY1c8M36uHjNjbNk,14
|
14
|
+
runem-0.0.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|