Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / gudhi / remove_explicit_PYTHONPATH.patch
blob2b8284ba216d50d5182c2e639e11c2e8fd48683d
1 diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
2 index 86a409b6..09544fb5 100644
3 --- a/src/python/CMakeLists.txt
4 +++ b/src/python/CMakeLists.txt
5 @@ -329,15 +329,6 @@ if(PYTHONINTERP_FOUND)
6 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7 COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/setup.py" "build_ext" "--inplace")
9 - add_custom_target(python ALL DEPENDS gudhi.so
10 - COMMENT "Do not forget to add ${CMAKE_CURRENT_BINARY_DIR}/ to your PYTHONPATH before using examples or tests")
12 - # Path separator management for windows
13 - if (WIN32)
14 - set(GUDHI_PYTHON_PATH_ENV "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR};$ENV{PYTHONPATH}")
15 - else(WIN32)
16 - set(GUDHI_PYTHON_PATH_ENV "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:$ENV{PYTHONPATH}")
17 - endif(WIN32)
18 # Documentation generation is available through sphinx - requires all modules
19 # Make it first as sphinx test is by far the longest test which is nice when testing in parallel
20 if(SPHINX_PATH)
21 @@ -358,13 +349,13 @@ if(PYTHONINTERP_FOUND)
22 # sphinx target requires gudhi.so, because conf.py reads gudhi version from it
23 add_custom_target(sphinx
24 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc
25 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
26 + COMMAND ${CMAKE_COMMAND} -E env
27 ${SPHINX_PATH} -b html ${CMAKE_CURRENT_SOURCE_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/sphinx
28 DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/gudhi.so"
29 COMMENT "${GUDHI_SPHINX_MESSAGE}" VERBATIM)
30 add_test(NAME sphinx_py_test
31 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
32 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
33 + COMMAND ${CMAKE_COMMAND} -E env
34 ${SPHINX_PATH} -b doctest ${CMAKE_CURRENT_SOURCE_DIR}/doc ${CMAKE_CURRENT_BINARY_DIR}/doctest)
35 # Set missing or not modules
36 set(GUDHI_MODULES ${GUDHI_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MODULES")
37 @@ -408,13 +399,13 @@ if(PYTHONINTERP_FOUND)
38 # Cubical
39 add_test(NAME periodic_cubical_complex_barcode_persistence_from_perseus_file_example_py_test
40 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
41 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
42 + COMMAND ${CMAKE_COMMAND} -E env
43 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py"
44 --no-barcode -f ${CMAKE_SOURCE_DIR}/data/bitmap/CubicalTwoSphere.txt)
46 add_test(NAME random_cubical_complex_persistence_example_py_test
47 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
48 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
49 + COMMAND ${CMAKE_COMMAND} -E env
50 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/random_cubical_complex_persistence_example.py"
51 10 10 10)
53 @@ -426,7 +417,7 @@ if(PYTHONINTERP_FOUND)
55 add_test(NAME cubical_complex_sklearn_itf_py_test
56 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
57 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
58 + COMMAND ${CMAKE_COMMAND} -E env
59 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/cubical_complex_sklearn_itf.py")
60 endif()
62 @@ -435,7 +426,7 @@ if(PYTHONINTERP_FOUND)
63 # Bottleneck and Alpha
64 add_test(NAME alpha_rips_persistence_bottleneck_distance_py_test
65 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
66 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
67 + COMMAND ${CMAKE_COMMAND} -E env
68 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/alpha_rips_persistence_bottleneck_distance.py"
69 -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -t 0.15 -d 3)
70 endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 5.1.0)
71 @@ -443,7 +434,7 @@ if(PYTHONINTERP_FOUND)
72 # Tangential
73 add_test(NAME tangential_complex_plain_homology_from_off_file_example_py_test
74 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
75 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
76 + COMMAND ${CMAKE_COMMAND} -E env
77 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/tangential_complex_plain_homology_from_off_file_example.py"
78 --no-diagram -i 2 -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off)
80 @@ -452,13 +443,13 @@ if(PYTHONINTERP_FOUND)
81 # Witness complex
82 add_test(NAME euclidean_strong_witness_complex_diagram_persistence_from_off_file_example_py_test
83 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
84 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
85 + COMMAND ${CMAKE_COMMAND} -E env
86 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py"
87 --no-diagram -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -a 1.0 -n 20 -d 2)
89 add_test(NAME euclidean_witness_complex_diagram_persistence_from_off_file_example_py_test
90 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
91 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
92 + COMMAND ${CMAKE_COMMAND} -E env
93 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py"
94 --no-diagram -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -a 1.0 -n 20 -d 2)
96 @@ -467,7 +458,7 @@ if(PYTHONINTERP_FOUND)
97 # Bottleneck
98 add_test(NAME bottleneck_basic_example_py_test
99 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
100 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
101 + COMMAND ${CMAKE_COMMAND} -E env
102 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/bottleneck_basic_example.py")
104 add_gudhi_py_test(test_bottleneck_distance)
105 @@ -479,26 +470,26 @@ if(PYTHONINTERP_FOUND)
106 file(COPY ${CMAKE_SOURCE_DIR}/data/points/COIL_database/lucky_cat_PCA1 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
107 add_test(NAME cover_complex_nerve_example_py_test
108 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
109 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
110 + COMMAND ${CMAKE_COMMAND} -E env
111 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/nerve_of_a_covering.py"
112 -f human.off -c 2 -r 10 -g 0.3)
114 add_test(NAME cover_complex_coordinate_gic_example_py_test
115 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
116 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
117 + COMMAND ${CMAKE_COMMAND} -E env
118 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/coordinate_graph_induced_complex.py"
119 -f human.off -c 0 -v)
121 add_test(NAME cover_complex_functional_gic_example_py_test
122 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
123 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
124 + COMMAND ${CMAKE_COMMAND} -E env
125 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/functional_graph_induced_complex.py"
126 -o lucky_cat.off
127 -f lucky_cat_PCA1 -v)
129 add_test(NAME cover_complex_voronoi_gic_example_py_test
130 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
131 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
132 + COMMAND ${CMAKE_COMMAND} -E env
133 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/voronoi_graph_induced_complex.py"
134 -f human.off -n 700 -v)
136 @@ -506,15 +497,15 @@ if(PYTHONINTERP_FOUND)
137 # Alpha
138 add_test(NAME alpha_complex_from_points_example_py_test
139 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
140 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
141 + COMMAND ${CMAKE_COMMAND} -E env
142 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/alpha_complex_from_points_example.py")
143 add_test(NAME alpha_complex_from_generated_points_on_sphere_example_py_test
144 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
145 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
146 + COMMAND ${CMAKE_COMMAND} -E env
147 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/alpha_complex_from_generated_points_on_sphere_example.py")
148 add_test(NAME alpha_complex_diagram_persistence_from_off_file_example_py_test
149 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
150 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
151 + COMMAND ${CMAKE_COMMAND} -E env
152 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/alpha_complex_diagram_persistence_from_off_file_example.py"
153 --no-diagram -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off)
154 add_gudhi_py_test(test_alpha_complex)
155 @@ -532,19 +523,19 @@ if(PYTHONINTERP_FOUND)
156 # Rips
157 add_test(NAME rips_complex_diagram_persistence_from_distance_matrix_file_example_py_test
158 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
159 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
160 + COMMAND ${CMAKE_COMMAND} -E env
161 ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py"
162 --no-diagram -f ${CMAKE_SOURCE_DIR}/data/distance_matrix/lower_triangular_distance_matrix.csv -s , -e 12.0 -d 3)
164 add_test(NAME rips_complex_diagram_persistence_from_off_file_example_py_test
165 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
166 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
167 + COMMAND ${CMAKE_COMMAND} -E env
168 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example/rips_complex_diagram_persistence_from_off_file_example.py
169 --no-diagram -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -e 0.25 -d 3)
171 add_test(NAME rips_complex_from_points_example_py_test
172 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
173 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
174 + COMMAND ${CMAKE_COMMAND} -E env
175 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example/rips_complex_from_points_example.py)
177 add_gudhi_py_test(test_rips_complex)
178 @@ -552,7 +543,7 @@ if(PYTHONINTERP_FOUND)
179 # Simplex tree
180 add_test(NAME simplex_tree_example_py_test
181 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
182 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
183 + COMMAND ${CMAKE_COMMAND} -E env
184 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example/simplex_tree_example.py)
186 add_gudhi_py_test(test_simplex_tree)
187 @@ -565,7 +556,7 @@ if(PYTHONINTERP_FOUND)
188 # Witness
189 add_test(NAME witness_complex_from_nearest_landmark_table_py_test
190 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
191 - COMMAND ${CMAKE_COMMAND} -E env "${GUDHI_PYTHON_PATH_ENV}"
192 + COMMAND ${CMAKE_COMMAND} -E env
193 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example/witness_complex_from_nearest_landmark_table.py)
195 add_gudhi_py_test(test_witness_complex)