Skip to content

Commit

Permalink
pandatools -> pandaclient
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaeno committed Aug 17, 2021
1 parent 839f7f5 commit eee3914
Show file tree
Hide file tree
Showing 42 changed files with 79 additions and 75 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
** Release Notes

current
* renamed pandatools to pandaclient

1.4.81
* added --execWithRealFileNames to prun
* added --useAthenaPackages and --relayHost to pflow
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include *.txt *.py *.cfg
recursive-include pandatools *.py
recursive-include pandaclient *.py
recursive-include share *
recursive-include scripts *
recursive-include glade *
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pandatools/PBookCore.py → pandaclient/PBookCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# from . import BookConfig
from . import PLogger
from . import PsubUtils
from pandatools import queryPandaMonUtils
from pandatools import localSpecs
from pandatools import PsubUtils
from pandaclient import queryPandaMonUtils
from pandaclient import localSpecs
from pandaclient import PsubUtils


def is_reqid(id):
Expand Down
14 changes: 7 additions & 7 deletions pandatools/PBookScript.py → pandaclient/PBookScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import signal
import tempfile

from pandatools.MiscUtils import commands_get_output
from pandaclient.MiscUtils import commands_get_output
try:
long()
except Exception:
Expand All @@ -31,8 +31,8 @@ def list_parallel_exec(func, array):
import argparse
import readline

from pandatools import Client
from pandatools import PandaToolsPkgInfo
from pandaclient import Client
from pandaclient import PandaToolsPkgInfo

# readline support
readline.parse_and_bind('tab: complete')
Expand Down Expand Up @@ -79,14 +79,14 @@ def _onExit(dirName,hFile):
for path in sys.path:
if path == '':
path = '.'
if os.path.exists(path) and os.path.isdir(path) and 'pandatools' in os.listdir(path) \
and os.path.exists('%s/pandatools/__init__.py' % path):
if os.path.exists(path) and os.path.isdir(path) and 'pandaclient' in os.listdir(path) \
and os.path.exists('%s/pandaclient/__init__.py' % path):
# make symlink for module name
os.symlink('%s/pandatools' % path,'%s/taskbuffer' % tmpDir)
os.symlink('%s/pandaclient' % path,'%s/taskbuffer' % tmpDir)
break
sys.path = [tmpDir]+sys.path

from pandatools import PBookCore # noqa: E402
from pandaclient import PBookCore # noqa: E402

orig_help = help

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions pandatools/PathenaScript.py → pandaclient/PathenaScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shutil
import atexit
import argparse
from pandatools.Group_argparse import GroupArgParser
from pandaclient.Group_argparse import GroupArgParser
import random
import pickle
import json
Expand Down Expand Up @@ -448,8 +448,8 @@
help='Max walltime for each job in hours. Note that this option works only ' \
'when the nevents metadata of input files are available in rucio')

from pandatools import MiscUtils
from pandatools.MiscUtils import commands_get_output, commands_get_status_output, commands_get_status_output_with_env
from pandaclient import MiscUtils
from pandaclient.MiscUtils import commands_get_output, commands_get_status_output, commands_get_status_output_with_env

# parse options
# check against the removed options first
Expand Down Expand Up @@ -499,15 +499,15 @@
print('')

# display version
from pandatools import PandaToolsPkgInfo
from pandaclient import PandaToolsPkgInfo
if options.version:
print("Version: %s" % PandaToolsPkgInfo.release_version)
sys.exit(0)

from pandatools import Client
from pandatools import PsubUtils
from pandatools import AthenaUtils
from pandatools import PLogger
from pandaclient import Client
from pandaclient import PsubUtils
from pandaclient import AthenaUtils
from pandaclient import PLogger

# update panda-client
if options.update:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys

from pandatools import pcontainer_core
from pandaclient import pcontainer_core

os.environ['PANDA_EXEC_STRING'] = 'pcontainer'

Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions pandatools/PflowScript.py → pandaclient/PflowScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import shlex
import atexit

from pandatools.Group_argparse import GroupArgParser
from pandatools import PLogger
from pandatools import PandaToolsPkgInfo
from pandatools import MiscUtils
from pandatools import Client
from pandatools import PsubUtils
from pandatools import PrunScript
from pandaclient.Group_argparse import GroupArgParser
from pandaclient import PLogger
from pandaclient import PandaToolsPkgInfo
from pandaclient import MiscUtils
from pandaclient import Client
from pandaclient import PsubUtils
from pandaclient import PrunScript

try:
from urllib import quote
Expand Down
12 changes: 6 additions & 6 deletions pandatools/PhpoScript.py → pandaclient/PhpoScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import copy
import atexit

from pandatools.Group_argparse import GroupArgParser
from pandatools import PLogger
from pandatools import PandaToolsPkgInfo
from pandatools import MiscUtils
from pandatools import Client
from pandatools import PsubUtils
from pandaclient.Group_argparse import GroupArgParser
from pandaclient import PLogger
from pandaclient import PandaToolsPkgInfo
from pandaclient import MiscUtils
from pandaclient import Client
from pandaclient import PsubUtils

try:
from urllib import quote
Expand Down
22 changes: 11 additions & 11 deletions pandatools/PrunScript.py → pandaclient/PrunScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
import shutil
import atexit
import argparse
from pandatools.Group_argparse import GroupArgParser
from pandaclient.Group_argparse import GroupArgParser
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
import types
import json
import copy
from pandatools.MiscUtils import commands_get_output, commands_get_status_output
from pandaclient.MiscUtils import commands_get_output, commands_get_status_output

try:
unicode
except Exception:
unicode = str

# main
def main(get_taskparams=False, ext_args=None):
def main(get_taskparams=False, ext_args=None, no_sandbox=False):
# default cloud/site
defaultCloud = None
defaultSite = 'AUTO'
Expand Down Expand Up @@ -415,7 +415,7 @@ def main(get_taskparams=False, ext_args=None):
group_build.add_argument("-3", action="store_true", dest="python3", default=False,
help="Use python3")

from pandatools import MiscUtils
from pandaclient import MiscUtils

# parse options

Expand Down Expand Up @@ -464,15 +464,15 @@ def main(get_taskparams=False, ext_args=None):
print('')

# display version
from pandatools import PandaToolsPkgInfo
from pandaclient import PandaToolsPkgInfo
if options.version:
print("Version: %s" % PandaToolsPkgInfo.release_version)
sys.exit(0)

from pandatools import Client
from pandatools import PsubUtils
from pandatools import AthenaUtils
from pandatools import PLogger
from pandaclient import Client
from pandaclient import PsubUtils
from pandaclient import AthenaUtils
from pandaclient import PLogger

# update panda-client
if options.update:
Expand Down Expand Up @@ -531,7 +531,7 @@ def main(get_taskparams=False, ext_args=None):
# load submission configuration from xml file (if provided)
xconfig = None
if options.loadXML is not None:
from pandatools import ParseJobXML
from pandaclient import ParseJobXML
xconfig = ParseJobXML.dom_parser(options.loadXML)
tmpLog.info('dump XML config')
xconfig.dump(options.verbose)
Expand Down Expand Up @@ -978,7 +978,7 @@ def _onExit(dir, files, del_command):
# archive sources and send it to HTTP-reachable location

# create archive
if options.containerImage == '' or options.useSandbox:
if (options.containerImage == '' or options.useSandbox) and not no_sandbox:
if options.inTarBall == '':
# copy RootCore packages
if options.useRootCore:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pandatools/panda_api.py → pandaclient/panda_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def execute_prun(self, args, console_log=True):
status: True if succeeded. Otherwise, False
a dictionary: Task submission attributes including jediTaskID
"""
return self.execute_xyz('prun', 'pandatools.PrunScript', args, console_log)
return self.execute_xyz('prun', 'pandaclient.PrunScript', args, console_log)

# execute pathena
def execute_pathena(self, args, console_log=True):
Expand All @@ -229,7 +229,7 @@ def execute_pathena(self, args, console_log=True):
status: True if succeeded. Otherwise, False
a dictionary: Task submission attributes including jediTaskID
"""
return self.execute_xyz('pathena', 'pandatools.PathenaScript', args, console_log)
return self.execute_xyz('pathena', 'pandaclient.PathenaScript', args, console_log)

# execute phpo
def execute_phpo(self, args, console_log=True):
Expand All @@ -243,7 +243,7 @@ def execute_phpo(self, args, console_log=True):
status: True if succeeded. Otherwise, False
a dictionary: Task submission attributes including jediTaskID
"""
return self.execute_xyz('phpo', 'pandatools.PhpoScript', args, console_log)
return self.execute_xyz('phpo', 'pandaclient.PhpoScript', args, console_log)

# hello
def hello(self, verbose=False):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/pathena
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
done

if [ -z "$PANDA_PY3" ]; then
/usr/bin/python -u -W ignore -c "import pandatools.PathenaScript" "$@"
/usr/bin/python -u -W ignore -c "import pandaclient.PathenaScript" "$@"
else
/usr/bin/python3 -u -W ignore -c "import pandatools.PathenaScript" "$@"
/usr/bin/python3 -u -W ignore -c "import pandaclient.PathenaScript" "$@"
fi
4 changes: 2 additions & 2 deletions scripts/pbook
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
done

if [ -z "$PANDA_PY3" ]; then
/usr/bin/python -u -W ignore -c 'import pandatools.PBookScript as pbook; pbook.main()' "$@"
/usr/bin/python -u -W ignore -c 'import pandaclient.PBookScript as pbook; pbook.main()' "$@"
else
/usr/bin/python3 -u -W ignore -c 'import pandatools.PBookScript as pbook; pbook.main()' "$@"
/usr/bin/python3 -u -W ignore -c 'import pandaclient.PBookScript as pbook; pbook.main()' "$@"
fi
4 changes: 2 additions & 2 deletions scripts/pcontainer
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
done

if [ -z "$PANDA_PY3" ]; then
/usr/bin/python -u -W ignore -c "import pandatools.PcontainerScript" "$@"
/usr/bin/python -u -W ignore -c "import pandaclient.PcontainerScript" "$@"
else
/usr/bin/python3 -u -W ignore -c "import pandatools.PcontainerScript" "$@"
/usr/bin/python3 -u -W ignore -c "import pandaclient.PcontainerScript" "$@"
fi
4 changes: 2 additions & 2 deletions scripts/pflow
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
done

if [ -z "$PANDA_PY3" ]; then
/usr/bin/python -u -W ignore -c "from pandatools.PflowScript import main; main()" "$@"
/usr/bin/python -u -W ignore -c "from pandaclient.PflowScript import main; main()" "$@"
else
/usr/bin/python3 -u -W ignore -c "from pandatools.PflowScript import main; main()" "$@"
/usr/bin/python3 -u -W ignore -c "from pandaclient.PflowScript import main; main()" "$@"
fi
4 changes: 2 additions & 2 deletions scripts/phpo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
done

if [ -z "$PANDA_PY3" ]; then
/usr/bin/python -u -W ignore -c "import pandatools.PhpoScript" "$@"
/usr/bin/python -u -W ignore -c "import pandaclient.PhpoScript" "$@"
else
/usr/bin/python3 -u -W ignore -c "import pandatools.PhpoScript" "$@"
/usr/bin/python3 -u -W ignore -c "import pandaclient.PhpoScript" "$@"
fi
4 changes: 2 additions & 2 deletions scripts/prun
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ esac
done

if [ -z "$PANDA_PY3" ]; then
/usr/bin/python -u -W ignore -c "from pandatools.PrunScript import main; main()" "$@"
/usr/bin/python -u -W ignore -c "from pandaclient.PrunScript import main; main()" "$@"
else
/usr/bin/python3 -u -W ignore -c "from pandatools.PrunScript import main; main()" "$@"
/usr/bin/python3 -u -W ignore -c "from pandaclient.PrunScript import main; main()" "$@"
fi
33 changes: 17 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
sys.path.insert(0,'.')

# get release version
from pandatools import PandaToolsPkgInfo
from pandaclient import PandaToolsPkgInfo
release_version = PandaToolsPkgInfo.release_version

from setuptools import setup
Expand Down Expand Up @@ -118,20 +118,21 @@ def run (self):
# install
self.data_files = new_data_files
install_data_org.run(self)
# post install
target = os.path.join(self.install_purelib, 'taskbuffer')
if not os.path.exists(target):
os.symlink('pandatools',
os.path.join(self.install_purelib, 'taskbuffer'))
target = os.path.join(self.install_purelib, 'pandaserver')
if not os.path.exists(target):
os.makedirs(target)
target_init = os.path.join(target, '__init__.py')
with open(target_init, 'w'):
pass
target = os.path.join(target, 'taskbuffer')
if not os.path.exists(target):
os.symlink('../pandatools', target)
# post install only for client installation
if not os.path.exists(os.path.join(self.install_purelib, 'pandacommon')):
target = os.path.join(self.install_purelib, 'taskbuffer')
if not os.path.exists(target):
os.symlink('pandaclient',
os.path.join(self.install_purelib, 'taskbuffer'))
target = os.path.join(self.install_purelib, 'pandaserver')
if not os.path.exists(target):
os.makedirs(target)
target_init = os.path.join(target, '__init__.py')
with open(target_init, 'w'):
pass
target = os.path.join(target, 'taskbuffer')
if not os.path.exists(target):
os.symlink('../pandaclient', target)
# delete
for autoGenFile in autoGenFiles:
try:
Expand All @@ -155,7 +156,7 @@ def run (self):
'jupyter': ['pandas', 'jupyter-dash'],
},

packages = [ 'pandatools',
packages = [ 'pandaclient',
],
scripts = [ 'scripts/prun',
'scripts/pcontainer',
Expand Down

0 comments on commit eee3914

Please sign in to comment.