Skip to content
Snippets Groups Projects
Commit 4830c08d authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Delete pyAMI

pyAMI is now built as part of atlasexternals (atlas/atlasexternals!616)
and no longer needed in the athena repository.
parent d9ab657c
No related branches found
No related tags found
No related merge requests found
# The name of the package:
atlas_subdir( pyAMI )
# In "release mode" return right away:
if( ATLAS_RELEASE_MODE )
return()
endif()
# Helper macro for building and installing the package(s). Documentation
# to be written later...
function( _setup_python_package name file md5 )
# Parse the optional argument(s):
cmake_parse_arguments( ARG "" "" "" ${ARGN} )
# Build the package with the help of python's distutils:
ExternalProject_Add( ${name}
PREFIX ${CMAKE_BINARY_DIR}
URL ${file}
URL_MD5 ${md5}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo
"Configuring the build of ${name}"
BUILD_COMMAND
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh
python setup.py build
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_PYTHON_OUTPUT_DIRECTORY}
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
COMMAND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh
python setup.py install --prefix ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
--exec-prefix ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}
--root /
--install-lib ${CMAKE_PYTHON_OUTPUT_DIRECTORY}
--install-scripts ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
# Make the package target depend on this one:
add_dependencies( Package_pyAMI ${name} )
# Get the package directory:
atlas_get_package_dir( pkgDir )
# Add some metadata to the target:
set_property( TARGET ${name} PROPERTY LABEL pyAMI )
set_property( TARGET ${name} PROPERTY FOLDER ${pkgDir} )
# Generate the package installer script:
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/pkgbuildInstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${name}PkgbuildInstall.cmake
@ONLY )
# Use this script for installing the package:
install( SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/${name}PkgbuildInstall.cmake )
endfunction( _setup_python_package )
# Install pyAMI:
#_setup_python_package( pyAMI
# ${CMAKE_CURRENT_SOURCE_DIR}/src/pyAMI-5.0.3.2.tar.gz
# 2fe796f738baeae72e5837ebc0d072c1 )
_setup_python_package( pyAMI
${CMAKE_CURRENT_SOURCE_DIR}/src/pyAMI-5.0.3.2-patched.tar.gz
77b1830e5aaf24a36cd12e0dfb623a55 )
# Clean up:
unset( _setup_python_package )
#
# Script installing a setuptools / distutils based Python package
# during the release installation, under $CMAKE_INSTALL_PREFIX.
#
# Get the destination directory as an absolute path, as the setup.py script
# can't deal with relative paths correctly.
if( NOT "$ENV{DESTDIR}" STREQUAL "" )
get_filename_component( _destdir $ENV{DESTDIR} ABSOLUTE )
endif()
# Install the package:
execute_process(
COMMAND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh
python setup.py install
--prefix ${_destdir}${CMAKE_INSTALL_PREFIX}
--exec-prefix ${_destdir}${CMAKE_INSTALL_PREFIX}
--root /
--install-lib ${_destdir}${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_PYTHONDIR@
--install-scripts ${_destdir}${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@
--record @CMAKE_CURRENT_BINARY_DIR@/@name@_installed.files
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src/@name@ )
# Read in the list of installed files, and select ones put into the
# binary directory.
file( READ @CMAKE_CURRENT_BINARY_DIR@/@name@_installed.files
_installedFiles LIMIT 10000000 )
string( SUBSTRING "${_destdir}${CMAKE_INSTALL_PREFIX}/@CMAKE_INSTALL_BINDIR@"
1 -1 _binDir )
string( REGEX MATCHALL "(^|\n)${_binDir}[^\n]+" _executables
${_installedFiles} )
# Loop over the installed executables:
foreach( _exec ${_executables} )
# And replace the absolute python executable names in them with
# relocatable ones.
string( STRIP ${_exec} _execName )
# This is unfortunately very unportable. But should be hopefully good
# enough on all POSIX platforms at least.
execute_process( COMMAND
sed "s/^#!\\/.*\\/python/#!\\/usr\\/bin\\/env python/"
"/${_execName}"
COMMAND tee /${_execName}Fixed
COMMAND ${CMAKE_COMMAND} -E rename "/${_execName}Fixed" "/${_execName}" )
# For some reason this doesn't work correctly (in CMake 3.3.2) when put at
# the end of the previous execute_process(...) call. Only when used in a
# separate call...
execute_process( COMMAND chmod 755 /${_execName} )
endforeach()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
# Author : Jerome ODIER, Jerome FULACHIER, Fabian LAMBERT, Solveig ALBRAND
#
# Email : jerome.odier@lpsc.in2p3.fr
# jerome.fulachier@lpsc.in2p3.fr
# fabian.lambert@lpsc.in2p3.fr
# solveig.albrand@lpsc.in2p3.fr
#
#############################################################################
import sys, pyAMI.utils, pyAMI.client, pyAMI.exception, pyAMI.atlas.api
#############################################################################
if __name__ == '__main__':
ret = 0
#####################################################################
print('#################### TEST 1 ####################')
try:
client = pyAMI.client.Client('atlas')
print('[SUCCESS]')
except pyAMI.exception.Error as e:
pyAMI.utils.safeprint('[ERROR] %s' % e)
sys.exit(1)
#####################################################################
print('#################### TEST 2 ####################')
try:
command = [
'GetUserInfo',
'-amiLogin=jodier',
]
pyAMI.utils.safeprint(client.execute(command))
print('[SUCCESS]')
except pyAMI.exception.Error as e:
pyAMI.utils.safeprint('[ERROR] %s' % e)
ret = 1
#####################################################################
print('#################### TEST 3 ####################')
try:
pyAMI.utils.safeprint(client.execute('GetUserInfo -amiLogin=jodier', format = 'xml'))
pyAMI.utils.safeprint(client.execute('GetUserInfo -amiLogin=jodier', format = 'json'))
pyAMI.utils.safeprint(client.execute('GetUserInfo -amiLogin=jodier', format = 'csv'))
pyAMI.utils.safeprint(client.execute('GetUserInfo -amiLogin=jodier', format = 'text'))
print('[SUCCESS]')
except pyAMI.exception.Error as e:
pyAMI.utils.safeprint('[ERROR] %s' % e)
ret = 1
#####################################################################
print('#################### TEST 4 ####################')
try:
pyAMI.utils.safeprint(client.execute('GetUserInfo -amiLogin=jodier', format = 'dom_object').get_rows())
pyAMI.utils.safeprint(client.execute('GetUserInfo -amiLogin=jodier', format = 'dict_object').get_rows())
print('[SUCCESS]')
except pyAMI.exception.Error as e:
pyAMI.utils.safeprint('[ERROR] %s' % e)
ret = 1
#####################################################################
print('#################### TEST 5 ####################')
try:
pyAMI.utils.safeprint(pyAMI.atlas.api.list_datasets(client, patterns = 'data14_cos%', type = 'AOD', order = 'run_number', limit = 10))
print('[SUCCESS]')
except pyAMI.exception.Error as e:
pyAMI.utils.safeprint('[ERROR] %s' % e)
ret = 1
#####################################################################
sys.exit(ret)
#############################################################################
File deleted
File deleted
--- pyAMI/object.py-orig 2020-01-07 21:33:33.000000001 +0100
+++ pyAMI/object.py 2020-01-07 21:33:51.000000001 +0100
@@ -144,7 +144,7 @@
for rowset in self.rowsets:
- if not rowset_type or (rowset.attributes.has_key('type') and rowset.attributes['type'].value == rowset_type):
+ if not rowset_type or ('type' in rowset.attributes.keys() and rowset.attributes['type'].value == rowset_type):
for row in rowset.getElementsByTagName('row'):
field_dict = pyAMIDict()
@@ -152,7 +152,7 @@
for field in row.getElementsByTagName('field'):
name = field.attributes['name'].value
- if field.attributes.has_key('table'):
+ if 'table' in field.attributes.keys():
table = field.attributes['table'].value
if self.entity and table and self.entity != table:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd">
<unifiedTestConfiguration>
<rtt xmlns="http://www.hep.ucl.ac.uk/atlas/AtlasTesting/rtt">
<rttContactPerson>pyAMI Team (ami@NOSPAMlpsc.in2p3.fr)</rttContactPerson>
<mailto>ami@NOSPAMlpsc.in2p3.fr</mailto>
<jobList>
<jobTransform userJobId="pyAMITest">
<jobTransformJobName>pyAMITest</jobTransformJobName>
<jobTransformCmd>python pyAMITest.py > pyAMITest.out</jobTransformCmd>
<group>pyAMIRTT</group>
<testToRemove>
<jobGroupName>RTT:Top</jobGroupName>
<testidentifier>CheckFileRunner0</testidentifier>
</testToRemove>
</jobTransform>
</jobList>
<jobGroups>
<jobGroup name="pyAMIRTT" parent="Transform">
<keepFilePattern>pyAMITest*.out</keepFilePattern>
<auxFilePattern>pyAMITest*.py</auxFilePattern>
</jobGroup>
</jobGroups>
</rtt>
</unifiedTestConfiguration>
......@@ -115,7 +115,6 @@
+ Event/xAOD/xAODTruthCnv
+ External/AtlasDataArea
+ External/Pythia8
+ External/pyAMI
+ Generators/Charybdis_i
- Generators/EmbeddedTrackGenerator
- Generators/ExoGraviton_i
......
......@@ -152,7 +152,6 @@
+ Event/xAOD/xAODTruthAthenaPool
+ Event/xAOD/xAODTruthCnv
+ External/AtlasDataArea
+ External/pyAMI
+ Generators/GenInterfaces
+ Generators/GeneratorObjects
+ Generators/GeneratorObjectsAthenaPool
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment