Skip to content

Commit

Permalink
Correct location of pyext in samples and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosbento authored Mar 27, 2024
2 parents f78b1cb + b413f4f commit d297852
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ add_custom_command(
COMMAND
${CMAKE_COMMAND} -E rm -rf ${CMAKE_CURRENT_BINARY_DIR}/build_python_api/_build
COMMAND
${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_BINARY_DIR}/Pyext/python3"
${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_BINARY_DIR}/libs/pyext/python3"
${SPHINX_EXECUTABLE} -M html
${CMAKE_CURRENT_SOURCE_DIR}/build_python_api
${CMAKE_CURRENT_BINARY_DIR}/build_python_api/_build
Expand Down Expand Up @@ -88,7 +88,7 @@ add_custom_target(ecflow_python_docs DEPENDS generate_ecflow_python_docs)
add_custom_command(
OUTPUT generate_ecflow_docs
COMMAND
${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_BINARY_DIR}/Pyext/python3"
${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_BINARY_DIR}/libs/pyext/python3"
${SPHINX_EXECUTABLE} -M html
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/_build
Expand Down
4 changes: 2 additions & 2 deletions libs/pyext/migrate/py_u_TestMigrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_root_source_dir():
print(" Found Jamroot.jam in " + cwd)
return cwd

if tail != "Pyext" and tail != "migrate":
if tail != "pyext" and tail != "migrate":
# in cmake, we may be in the build directory, hence we need to determine source directory
file = cwd + "/CTestTestfile.cmake"
#print(" searching for " + file)
Expand Down Expand Up @@ -59,7 +59,7 @@ def tearDown(self):
pass

def locate(self,file):
return self.workspace_dir + "/Pyext/" + file
return self.workspace_dir + "/libs/pyext/" + file

def testMigrateVersionNumber(self):
list_of_defs_lines =[ "# 3.1.2"]
Expand Down
8 changes: 4 additions & 4 deletions libs/pyext/samples/TestBench.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_root_source_dir():
print(" Found Jamroot.jam in " + cwd)
return cwd

if tail != "Pyext" and tail != "migrate":
if tail != "pyext" and tail != "migrate":
# in cmake, we may be in the build directory, hence we need to determine source directory
file = cwd + "/CTestTestfile.cmake"
#print " searching for " + file
Expand Down Expand Up @@ -121,7 +121,7 @@ def traverse_container(node_container):
This programs assumes that ecflow module is accessible
example:
python Pyext/samples/TestBench.py --port=3141 --verbose=True ANode/parser/test/data/good_defs/trigger/late.def
python libs/pyext/samples/TestBench.py --port=3141 --verbose=True ANode/parser/test/data/good_defs/trigger/late.def
"""

print("####################################################################")
Expand Down Expand Up @@ -157,12 +157,12 @@ def traverse_container(node_container):
ARGS.defs_file = os.path.expandvars(ARGS.defs_file) # expand references to any environment variables
print(ARGS )

# If running on local work space, use /Pyext/test/data/CUSTOMER/ECF_HOME as ecf_home
# If running on local work space, use /libs/pyext/test/data/CUSTOMER/ECF_HOME as ecf_home
using_workspace = False;
ecflow_source_dir = ""
try:
ecflow_source_dir = get_root_source_dir();
ARGS.ecf_home = ecflow_source_dir + "/Pyext/test/data/CUSTOMER/ECF_HOME"
ARGS.ecf_home = ecflow_source_dir + "/libs/pyext/test/data/CUSTOMER/ECF_HOME"
using_workspace = True
if ARGS.verbose:
print("Workspace is defined ecflow_source_dir: ",ecflow_source_dir)
Expand Down
2 changes: 1 addition & 1 deletion libs/pyext/samples/TestBenchConfluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def traverse_container(node_container):
ARGS.defs_file = os.path.expandvars(ARGS.defs_file) # expand references to any environment variables
print(ARGS)

# If running on local work space, use /Pyext/test/data/CUSTOMER/ECF_HOME as ecf_home
# If running on local work space, use /libs/pyext/test/data/CUSTOMER/ECF_HOME as ecf_home
if ARGS.verbose:
print("Using ECF_HOME=" + ARGS.ecf_home)

Expand Down
4 changes: 2 additions & 2 deletions libs/pyext/samples/TestGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def ecf_home(self):
return os.getcwd() + "/test_gui/data/ecf_home_debug_" + str(self.port_)
return os.getcwd() + "/test_gui/data/ecf_home_release_" + str(self.port_)

def ecf_includes(self) : return os.getcwd() + "/Pyext/test/data/includes"
def ecf_includes(self) : return os.getcwd() + "/libs/pyext/test/data/includes"
def log_file_path(self): return "./" + gethostname() + "." + self.port_ + ".ecf.log"
def checkpt_file_path(self): return "./" + gethostname() + "." + self.port_ + ".ecf.check"
def backup_checkpt_file_path(self): return "./" + gethostname() + "." + self.port_ + ".ecf.check.b"
Expand Down Expand Up @@ -1449,7 +1449,7 @@ def test_gui(self):
This should allow GUI (1 second poll), to see the effects of this test.
To debug this tests, just set sync_sleep = 0, this will also preserve the test data.
- Test data is created in directory: test_gui, this will deleted at the end of the test.
- Assumes includes head.h and tail.h are in CWD + /Pyext/test/data/includes
- Assumes includes head.h and tail.h are in CWD + /libs/pyext/test/data/includes
- We will look for the ecflow_client in the embedded child commands in the generated scripts,
o first look in the current cmake build tree of the ecflow module(this may no longer exist)
o Next will use /usr/local/apps/ecflow/ with same version as this ecflow python api *IF* it exists
Expand Down
3 changes: 1 addition & 2 deletions libs/pyext/samples/TestJobGenPerf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def traverse_container(node_container):
ARGS.defs_file = os.path.expandvars(ARGS.defs_file) # expand references to any environment variables
print(ARGS)

# If running on local work space, use /Pyext/test/data/CUSTOMER/ECF_HOME as ecf_home
# If running on local work space, use /libs/pyext/test/data/CUSTOMER/ECF_HOME as ecf_home
if not ARGS.ecf_home:
if os.getenv("WK") is None:
print("No ecf_home specified. Please specify a writable directory")
Expand Down Expand Up @@ -153,4 +153,3 @@ def traverse_container(node_container):
newDefs = ARGS.ecf_home + "/../" + os.path.basename(ARGS.defs_file)
print("Saving modified defs as " + newDefs)
DEFS.save_as_defs(newDefs)

3 changes: 1 addition & 2 deletions libs/pyext/samples/confluence_add_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_add_attachment_id(self):
print("space key:",space_key," page id:",page_id)

comment = "production release"
file = "/var/tmp/ma0/workspace/ecflow/Pyext/samples/test.tar.gz"
file = "/var/tmp/ma0/workspace/ecflow/libs/pyext/samples/test.tar.gz"
for space_key in space_key_list:
page_id = self.c.get_page_id(space_key,title)

Expand All @@ -52,4 +52,3 @@ def test_add_attachment_id(self):
if __name__ == '__main__':
unittest.main()
print("All Tests pass")

4 changes: 2 additions & 2 deletions libs/pyext/samples/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ def test_1(self, test_ok=1):
export SUITE=mc ECF_HOST=localhost ECF_PORT=5001
./mirror.py -p /mirror/mc -r # load mirror on source server # might be destination or another server yet
# ImportError: No module named ecf # ecf shall be in the path, at least it can found in ecflow distrib as
# ecflow/Pyext/samples/api/ecf.py
# ecflow/libs/pyext/samples/api/ecf.py
# ('#MSG: replacing /mirror/test in ', 'localhost', '5001', #5.7.0 # loading OK
# begin mirror -
# Script OK? mirror.py undef ECF_FILES directory?
Expand Down Expand Up @@ -1030,5 +1030,5 @@ def test_1(self, test_ok=1):
ECF_HOST=localhost ECF_PORT=31415 ./mirror.py -m localhost:31415 -p /mc
/tmp/map/work/git/ecflow/Pyext/samples/mirror.py
/tmp/map/work/git/ecflow/libs/pyext/samples/mirror.py
"""
4 changes: 2 additions & 2 deletions libs/pyext/samples/run_batches_with_delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def run_chunk(ci,list_of_task_paths):

DESC = """
example:
python3 Pyext/samples/run_batches_with_delay.py -h polonius -p 4141 -b 4 -s 4 -n "/ecflow/cron /limit_basic"
python3 libs/pyext/samples/run_batches_with_delay.py -h polonius -p 4141 -b 4 -s 4 -n "/ecflow/cron /limit_basic"
The list of paths can be obtained from the GUI, using:
sh $WK/Pyext/samples/run_batches_with_delay.sh -h %ECF_HOST% -p %ECF_PORT% -b 10 -s 2 -n '<full_name>'
sh $WK/libs/pyext/samples/run_batches_with_delay.sh -h %ECF_HOST% -p %ECF_PORT% -b 10 -s 2 -n '<full_name>'
"""

print("####################################################################")
Expand Down
4 changes: 2 additions & 2 deletions libs/pyext/samples/run_batches_with_delay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Example of running a shell command from the GUI.
# Use the following in ecflowUI:
# sh $WK/Pyext/samples/run_batches_with_delay.sh -h %ECF_HOST% -p %ECF_PORT% -b 10 -s 2 -n '<full_name>'
# sh $WK/libs/pyext/samples/run_batches_with_delay.sh -h %ECF_HOST% -p %ECF_PORT% -b 10 -s 2 -n '<full_name>'
# - sh at the front is required
# - the tick quotes on <full_name> are required
#
Expand Down Expand Up @@ -57,4 +57,4 @@ for path in $node_paths; do
echo $path
done

python3 /var/tmp/ma0/workspace/ecflow/Pyext/samples/run_batches_with_delay.py --host $host --port $port --batch_size $batch_size --sleep_between_batch $sleep_between_batch --paths "$node_paths"
python3 /var/tmp/ma0/workspace/ecflow/libs/pyext/samples/run_batches_with_delay.py --host $host --port $port --batch_size $batch_size --sleep_between_batch $sleep_between_batch --paths "$node_paths"
2 changes: 1 addition & 1 deletion libs/pyext/test/py_u_TestTraversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ def all_files(root, patterns='*', single_level=False, yield_folders=False):
# try the mega_def. Commented out since it takes to long
#mega_def = os.path.join( os.path.dirname(cwd), "libs/node/parser/test/data/single_defs/mega.def")
#check_traversal(mega_def)
print("All Tests pass")
print("All Tests pass")

0 comments on commit d297852

Please sign in to comment.