Skip to content

Commit ed7c400

Browse files
committed
Create a python-only version of the app4triqs skeleton
1 parent b7dafbd commit ed7c400

File tree

18 files changed

+9
-495
lines changed

18 files changed

+9
-495
lines changed

CMakeLists.txt

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -59,38 +59,6 @@ if(NOT CMAKE_BUILD_TYPE)
5959
endif()
6060
message(STATUS "-------- BUILD-TYPE: ${CMAKE_BUILD_TYPE} --------")
6161

62-
# Build static libraries
63-
set(BUILD_SHARED_LIBS OFF)
64-
65-
# Export the list of compile-commands into compile_commands.json
66-
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
67-
68-
# Global compiler options
69-
add_compile_options(
70-
$<$<CONFIG:Debug>:-Og>
71-
$<$<CONFIG:Debug>:-ggdb3>
72-
)
73-
74-
# Create an Interface target for compiler warnings
75-
add_library(project_warnings INTERFACE)
76-
install(TARGETS project_warnings EXPORT app4triqs-targets)
77-
target_compile_options(project_warnings
78-
INTERFACE
79-
-Wall
80-
-Wextra
81-
-Wpedantic
82-
-Wno-sign-compare
83-
$<$<CXX_COMPILER_ID:GNU>:-Wshadow=local>
84-
$<$<CXX_COMPILER_ID:Clang>:-Wshadow>
85-
$<$<CXX_COMPILER_ID:Clang>:-Wno-gcc-compat>
86-
)
87-
88-
# #############
89-
# Build Project
90-
91-
# Build and install the app4triqs library
92-
add_subdirectory(c++/app4triqs)
93-
9462
# Tests
9563
option(Build_Tests "Build tests" ON)
9664
if(Build_Tests)

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To adapt this skeleton for a new TRIQS application, the following steps are nece
1212
* Run the following commands in order after replacing **appname** accordingly
1313

1414
```bash
15-
git clone https://github.com/triqs/app4triqs --branch unstable appname
15+
git clone https://github.com/triqs/app4triqs --branch python_only appname
1616
cd appname
1717
./share/squash_history.sh
1818
./share/replace_and_rename.sh appname
@@ -36,7 +36,7 @@ You can merge future changes to the app4triqs skeleton into your project with th
3636

3737
```bash
3838
git remote update
39-
git merge app4triqs_remote/unstable -m "Merge latest app4triqs skeleton changes"
39+
git merge app4triqs_remote/python_only -m "Merge latest app4triqs skeleton changes"
4040
```
4141

4242
If you should encounter any conflicts resolve them and `git commit`.
@@ -54,10 +54,7 @@ After setting up your application as described above you should customize the fo
5454
according to your needs (replace app4triqs in the following by the name of your application)
5555

5656
* Adjust or remove the `README.md` and `doc/ChangeLog.md` file
57-
* In the `c++/app4triqs` subdirectory adjust the example files `app4triqs.hpp` and `app4triqs.cpp` or add your own source files.
58-
* In the `test/c++` subdirectory adjust the example test `basic.cpp` or add your own tests.
5957
* In the `python/app4triqs` subdirectory add your Python source files.
60-
Be sure to remove the `app4triqs_module_desc.py` file unless you want to generate a Python module from your C++ source code.
6158
* In the `test/python` subdirectory adjust the example test `Basic.py` or add your own tests.
6259
* Adjust any documentation examples given as `*.rst` files in the doc directory.
6360
* Adjust the sphinx configuration in `doc/conf.py.in` as necessary.
@@ -66,10 +63,6 @@ according to your needs (replace app4triqs in the following by the name of your
6663
### Optional ###
6764
----------------
6865

69-
* If you want to wrap C++ classes and/or functions provided in the `c++/app4triqs/app4triqs.hpp` rerun the `c++2py` tool with
70-
```bash
71-
c++2py -r app4triqs_module_desc.py
72-
```
7366
* Add your email address to the bottom section of `Jenkinsfile` for Jenkins CI notification emails
7467
```
7568
End of build log:

c++/app4triqs/CMakeLists.txt

Lines changed: 0 additions & 74 deletions
This file was deleted.

c++/app4triqs/app4triqs.cpp

Lines changed: 0 additions & 37 deletions
This file was deleted.

c++/app4triqs/app4triqs.hpp

Lines changed: 0 additions & 77 deletions
This file was deleted.

doc/CMakeLists.txt

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,6 @@
11
# Generate the sphinx config file
22
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY)
33

4-
# -----------------------------------------------------------------------------
5-
# Create an optional target that allows us to regenerate the C++ doc with c++2rst
6-
# -----------------------------------------------------------------------------
7-
add_custom_target(docs_cpp2rst)
8-
include(${PROJECT_SOURCE_DIR}/share/cmake/extract_flags.cmake)
9-
extract_flags(app4triqs_c)
10-
separate_arguments(app4triqs_c_CXXFLAGS)
11-
macro(generate_docs header_file)
12-
add_custom_command(
13-
TARGET docs_cpp2rst
14-
COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
15-
COMMAND
16-
c++2rst
17-
${header_file}
18-
-N app4triqs
19-
--output_directory ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
20-
-I${PROJECT_SOURCE_DIR}/c++
21-
--cxxflags="${app4triqs_c_CXXFLAGS}"
22-
)
23-
endmacro(generate_docs)
24-
25-
generate_docs(${PROJECT_SOURCE_DIR}/c++/app4triqs/app4triqs.hpp)
26-
27-
# --------------------------------------------------------
28-
# Build & Run the C++ doc examples and capture the output
29-
# --------------------------------------------------------
30-
31-
add_custom_target(docs_example_output)
32-
file(GLOB_RECURSE ExampleList RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
33-
foreach(example ${ExampleList})
34-
get_filename_component(f ${example} NAME_WE)
35-
get_filename_component(d ${example} DIRECTORY)
36-
add_executable(doc_${f} EXCLUDE_FROM_ALL ${example})
37-
set_property(TARGET doc_${f} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${d})
38-
target_link_libraries(doc_${f} triqs)
39-
add_custom_command(TARGET doc_${f}
40-
COMMAND doc_${f} > ${CMAKE_CURRENT_SOURCE_DIR}/${d}/${f}.output 2>/dev/null
41-
WORKING_DIRECTORY ${d}
42-
)
43-
add_dependencies(docs_example_output doc_${f})
44-
endforeach()
45-
464
# ---------------------------------
475
# Top Sphinx target
486
# ---------------------------------
@@ -53,16 +11,6 @@ add_custom_command(
5311
COMMAND PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH} ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_SOURCE_DIR} html
5412
)
5513

56-
option(Sphinx_Only "When building the documentation, skip the Python Modules and the generation of C++ Api and example outputs" OFF)
57-
if(NOT Sphinx_Only)
58-
# Autodoc usage requires the python modules to be built first
59-
get_property(CPP2PY_MODULES_LIST GLOBAL PROPERTY CPP2PY_MODULES_LIST)
60-
add_dependencies(docs_sphinx ${CPP2PY_MODULES_LIST})
61-
62-
# Generation of C++ Api and Example Outputs
63-
add_dependencies(docs_sphinx docs_cpp2rst docs_example_output)
64-
endif()
65-
6614
# ---------------------------------
6715
# Install
6816
# ---------------------------------

doc/documentation.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ Table of Contents
2121
changelog
2222
about
2323

24-
C++ reference manual
25-
--------------------
26-
27-
.. toctree::
28-
:maxdepth: 5
29-
30-
cpp2rst_generated/contents
31-
3224
Python reference manual
3325
-----------------------
3426

doc/install.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Installation steps
3333

3434
#. Compile the code, run the tests and install the application::
3535

36-
$ make
3736
$ make test
3837
$ make install
3938

python/app4triqs/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,10 @@ configure_file(version.py.in version.py)
33

44
# All Python files. Copy them in the build dir to have a complete package for the tests.
55
file(GLOB_RECURSE python_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
6-
file(GLOB_RECURSE wrap_generators RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *_desc.py)
7-
list(REMOVE_ITEM python_sources "${wrap_generators}")
86
foreach(file ${python_sources})
97
configure_file(${file} ${file} COPYONLY)
108
endforeach()
119

12-
# Build any python modules
13-
foreach(gen ${wrap_generators})
14-
string(REPLACE "_desc.py" "" module_name ${gen})
15-
add_cpp2py_module(${module_name})
16-
target_link_libraries(${module_name} app4triqs_c)
17-
endforeach()
18-
1910
# Install python modules to proper location
2011
set(PYTHON_LIB_DEST ${TRIQS_PYTHON_LIB_DEST_ROOT}/app4triqs)
21-
get_property(CPP2PY_MODULES_LIST GLOBAL PROPERTY CPP2PY_MODULES_LIST)
22-
install(TARGETS ${CPP2PY_MODULES_LIST} DESTINATION ${PYTHON_LIB_DEST})
2312
install(FILES ${python_sources} ${CMAKE_CURRENT_BINARY_DIR}/version.py DESTINATION ${PYTHON_LIB_DEST})

python/app4triqs/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,4 @@
2525
DOC
2626
2727
"""
28-
from app4triqs_module import Toto, chain
29-
30-
__all__ = ['Toto', 'chain']
28+
__all__ = []

0 commit comments

Comments
 (0)