Skip to content
Snippets Groups Projects
Commit 17711315 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

Merge remote-tracking branch 'origin/feature/dune-python-migration'

Conflicts:
	python/setup.py
parents 7cdfcfa6 23b90512
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules"
#include the dune macros
include(DuneMacros)
set(DUNE_PYTHON_INSTALL_EDITABLE 1)
# start a dune project with information from dune.module
dune_project()
......
dune_install_python_script(SCRIPT process_measurements.py
REQUIRES pandas
)
dune_install_python_script(SCRIPT plot_measurements.py
REQUIRES pandas matplotlib
)
dune_install_python_script(SCRIPT performance_regression.py
REQUIRES pandas
)
dune_python_install_package(PATH .)
dune_symlink_to_source_files(FILES make_graph.sh
knltimings.sh
......
#!/usr/bin/env python
#
# This is a bogus package to install all the python scripts that we need
# in the bin folder into the Dune virtualenv.
#
from setuptools import setup
setup(name='perftoolcoveniencescripts',
version='0.1',
description='Some convenience scripts',
author='Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>',
install_requires=['pandas', 'matplotlib'],
scripts=['performance_regression.py',
'plot_measurements.py',
'process_measurements.py',
])
......@@ -109,7 +109,7 @@ function(add_generated_executable)
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/StandardMain.cmake ${GEN_MAIN})
add_custom_command(OUTPUT ${GEN_OPERATOR} ${GEN_DRIVER}
COMMAND ${CMAKE_BINARY_DIR}/dune-env ufl2pdelab
COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env ufl2pdelab
--project-basedir ${CMAKE_BINARY_DIR}
--operator-file ${GEN_OPERATOR}
--driver-file ${GEN_DRIVER}
......
......@@ -33,7 +33,7 @@ function(dune_add_formcompiler_system_test)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMTEST_INIFILE} ${CMAKE_CURRENT_BINARY_DIR}/tmp_${SYSTEMTEST_INIFILE})
# expand the given meta ini file into the build tree
execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env dune_expand_metaini.py --cmake --ini ${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMTEST_INIFILE} --dir ${CMAKE_CURRENT_BINARY_DIR} --section formcompiler
execute_process(COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env dune_expand_metaini.py --cmake --ini ${CMAKE_CURRENT_SOURCE_DIR}/${SYSTEMTEST_INIFILE} --dir ${CMAKE_CURRENT_BINARY_DIR} --section formcompiler
OUTPUT_VARIABLE output)
parse_python_data(PREFIX INIINFO INPUT "${output}")
......@@ -66,7 +66,7 @@ function(dune_add_formcompiler_system_test)
add_dependencies(build_tests ${tname})
_add_test(NAME ${tname}
COMMAND ${CMAKE_BINARY_DIR}/dune-env ${SYSTEMTEST_SCRIPT}
COMMAND ${CMAKE_BINARY_DIR}/run-in-dune-env ${SYSTEMTEST_SCRIPT}
--exec ${tname}
--ini "${CMAKE_CURRENT_BINARY_DIR}/${inifile}"
--source ${CMAKE_CURRENT_SOURCE_DIR}
......
......@@ -2,24 +2,22 @@
#
# Install path.py in version 7.7 is to avoid a bug in
# IPythons dependency pickleshare.
execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env python -m pip install path.py==7.7 tornado>=4.0 ipython>=4.0.0 jupyter>=1.0.0)
# Create an ipython notebook wrapper!
create_virtualenv_wrapper(COMMANDS python -m IPython notebook
NAME notebook)
dune_execute_process(COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pip install path.py==7.7 tornado>=4.0 ipython>=4.0.0 jupyter>=1.0.0
ERROR_MESSAGE "Error installing jupyter in virtualenv")
# Install all the external packages that we have as submodules
dune_install_python_package(PATH pytools)
dune_install_python_package(PATH cgen)
dune_install_python_package(PATH pymbolic)
dune_install_python_package(PATH loopy)
dune_install_python_package(PATH ufl)
dune_python_install_package(PATH pytools)
dune_python_install_package(PATH cgen)
dune_python_install_package(PATH pymbolic)
dune_python_install_package(PATH loopy)
dune_python_install_package(PATH ufl)
# Install our python package
dune_install_python_package(PATH .)
dune_python_install_package(PATH .)
add_python_test_command(COMMAND python -m pytest --pep8
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/dune/perftool
REQUIRED_PACKAGES pytest pytest-pep8)
dune_python_add_test(NAME pep8-ourcode
COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pytest --pep8
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/dune/perftool
)
add_subdirectory(test)
......@@ -57,7 +57,7 @@ def read_ufl(uflfile):
namespace = globals()
ini = get_option("ini_file")
if ini:
from dune.common.parametertree.parser import parse_ini_file
from dune.testtools.parametertree.parser import parse_ini_file
ini = parse_ini_file(ini)
for k, v in ini.get("formcompiler.ufl_variants", {}).items():
......
......@@ -4,7 +4,7 @@ from argparse import ArgumentParser
from os.path import abspath
from pytools import ImmutableRecord, memoize
from dune.common.parametertree.parser import parse_ini_file
from dune.testtools.parametertree.parser import parse_ini_file
class PerftoolOption(ImmutableRecord):
......
......@@ -39,8 +39,7 @@ setup(name='dune.perftool',
'dune.perftool.ufl',
'dune.perftool.ufl.transformations',
],
install_requires=['dune.testtools', 'sympy', 'frozendict'],
tests_require=['pytest'],
install_requires=['dune.testtools', 'sympy', 'frozendict', 'pytest', 'pytest-pep8'],
cmdclass={'test': PyTest},
entry_points = {
"console_scripts": [
......
add_python_test_command(COMMAND python -m pytest --pep8
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/test/dune/perftool/generation
REQUIRED_PACKAGES pytest pytest-pep8)
dune_python_add_test(NAME pytest
COMMAND ${DUNE_PYTHON_VIRTUALENV_EXECUTABLE} -m pytest --pep8
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/python/test/dune/perftool/generation
)
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