Skip to content

Commit 54ecbf5

Browse files
committed
Add spin config and install Python sources
1 parent dc65a3c commit 54ecbf5

File tree

14 files changed

+258
-66
lines changed

14 files changed

+258
-66
lines changed

pydatastructs/graphs/meson.build

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'_extensions.py',
7+
'adjacency_list.py',
8+
'adjacency_matrix.py',
9+
'algorithms.py',
10+
'graph.py'
11+
],
12+
subdir: 'pydatastructs/graphs'
13+
)
14+
15+
python.install_sources(
16+
['_backend/__init__.py', '_backend/cpp/__init__.py'],
17+
subdir: 'pydatastructs/graphs/_backend'
18+
)
19+
20+
py_include = include_directories('../utils/_backend/cpp')
21+
22+
python.extension_module(
23+
'pydatastructs.graphs._backend.cpp._graph',
24+
'_backend/cpp/graph.cpp',
25+
include_directories: py_include,
26+
install: true,
27+
subdir: 'pydatastructs/graphs'
28+
)
29+
30+
python.extension_module(
31+
'pydatastructs.graphs._backend.cpp._algorithms',
32+
'_backend/cpp/algorithms.cpp',
33+
include_directories: py_include,
34+
install: true,
35+
subdir: 'pydatastructs/graphs'
36+
)
37+
38+
subdir('tests')
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'test_adjacency_list.py',
7+
'test_adjacency_matrix.py',
8+
'test_algorithms.py'
9+
],
10+
subdir: 'pydatastructs/graphs/tests',
11+
install_tag: 'tests'
12+
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'_extensions.py',
7+
'algorithms.py',
8+
'arrays.py',
9+
'linked_lists.py'
10+
],
11+
subdir: 'pydatastructs/linear_data_structures'
12+
)
13+
14+
python.install_sources(
15+
['_backend/__init__.py', '_backend/cpp/__init__.py'],
16+
subdir: 'pydatastructs/linear_data_structures/_backend'
17+
)
18+
19+
python.extension_module(
20+
'pydatastructs.linear_data_structures._backend.cpp._arrays',
21+
'_backend/cpp/arrays/arrays.cpp',
22+
install: true,
23+
subdir: 'pydatastructs/linear_data_structures'
24+
)
25+
26+
python.extension_module(
27+
'pydatastructs.linear_data_structures._backend.cpp._algorithms',
28+
'_backend/cpp/algorithms/algorithms.cpp',
29+
install: true,
30+
subdir: 'pydatastructs/linear_data_structures'
31+
)
32+
33+
subdir('tests')
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'benchmarks/__init__.py',
7+
'benchmarks/test_algorithms.py',
8+
'benchmarks/test_arrays.py',
9+
'test_algorithms.py',
10+
'test_arrays.py',
11+
'test_linked_lists.py'
12+
],
13+
subdir: 'pydatastructs/linear_data_structures/tests',
14+
install_tag: 'tests'
15+
)

pydatastructs/meson.build

Lines changed: 8 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,10 @@
11
python = import('python').find_installation(pure: false)
22

3-
# Install pure python sources
4-
install_subdir(
5-
'.',
6-
install_dir: python.get_install_dir(subdir: 'pydatastructs'),
7-
)
8-
9-
# utils extension modules
10-
python.extension_module(
11-
'pydatastructs.utils._backend.cpp._nodes',
12-
'utils/_backend/cpp/nodes.cpp',
13-
install: true,
14-
subdir: 'pydatastructs/utils'
15-
)
16-
python.extension_module(
17-
'pydatastructs.utils._backend.cpp._graph_utils',
18-
'utils/_backend/cpp/graph_utils.cpp',
19-
install: true,
20-
subdir: 'pydatastructs/utils'
21-
)
22-
23-
# linear_data_structures extension modules
24-
python.extension_module(
25-
'pydatastructs.linear_data_structures._backend.cpp._arrays',
26-
'linear_data_structures/_backend/cpp/arrays/arrays.cpp',
27-
install: true,
28-
subdir: 'pydatastructs/linear_data_structures'
29-
)
30-
python.extension_module(
31-
'pydatastructs.linear_data_structures._backend.cpp._algorithms',
32-
'linear_data_structures/_backend/cpp/algorithms/algorithms.cpp',
33-
install: true,
34-
subdir: 'pydatastructs/linear_data_structures'
35-
)
36-
37-
# miscellaneous_data_structures extension module
38-
python.extension_module(
39-
'pydatastructs.miscellaneous_data_structures._backend.cpp._stack',
40-
'miscellaneous_data_structures/_backend/cpp/stack/stack.cpp',
41-
install: true,
42-
subdir: 'pydatastructs/miscellaneous_data_structures'
43-
)
44-
45-
# trees extension module
46-
python.extension_module(
47-
'pydatastructs.trees._backend.cpp._trees',
48-
'trees/_backend/cpp/trees.cpp',
49-
install: true,
50-
subdir: 'pydatastructs/trees'
51-
)
52-
53-
# graphs extension modules
54-
py_include = include_directories('utils/_backend/cpp')
55-
python.extension_module(
56-
'pydatastructs.graphs._backend.cpp._graph',
57-
'graphs/_backend/cpp/graph.cpp',
58-
include_directories: py_include,
59-
install: true,
60-
subdir: 'pydatastructs/graphs'
61-
)
62-
python.extension_module(
63-
'pydatastructs.graphs._backend.cpp._algorithms',
64-
'graphs/_backend/cpp/algorithms.cpp',
65-
include_directories: py_include,
66-
install: true,
67-
subdir: 'pydatastructs/graphs'
68-
)
3+
python.install_sources(['__init__.py'], subdir: 'pydatastructs')
4+
5+
subdir('utils')
6+
subdir('linear_data_structures')
7+
subdir('miscellaneous_data_structures')
8+
subdir('trees')
9+
subdir('graphs')
10+
subdir('strings')
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'_extensions.py',
7+
'algorithms.py',
8+
'multiset.py',
9+
'sparse_table.py',
10+
'disjoint_set.py',
11+
'queue.py',
12+
'binomial_trees.py',
13+
'segment_tree.py',
14+
'stack.py'
15+
],
16+
subdir: 'pydatastructs/miscellaneous_data_structures'
17+
)
18+
19+
python.install_sources(
20+
['_backend/__init__.py', '_backend/cpp/__init__.py'],
21+
subdir: 'pydatastructs/miscellaneous_data_structures/_backend'
22+
)
23+
24+
python.extension_module(
25+
'pydatastructs.miscellaneous_data_structures._backend.cpp._stack',
26+
'_backend/cpp/stack/stack.cpp',
27+
install: true,
28+
subdir: 'pydatastructs/miscellaneous_data_structures'
29+
)
30+
31+
subdir('tests')
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'test_binomial_trees.py',
7+
'test_disjoint_set.py',
8+
'test_multiset.py',
9+
'test_queue.py',
10+
'test_range_query_dynamic.py',
11+
'test_range_query_static.py',
12+
'test_stack.py'
13+
],
14+
subdir: 'pydatastructs/miscellaneous_data_structures/tests',
15+
install_tag: 'tests'
16+
)

pydatastructs/strings/meson.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'algorithms.py',
7+
'trie.py'
8+
],
9+
subdir: 'pydatastructs/strings'
10+
)
11+
12+
subdir('tests')
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'test_algorithms.py',
7+
'test_trie.py'
8+
],
9+
subdir: 'pydatastructs/strings/tests',
10+
install_tag: 'tests'
11+
)

pydatastructs/trees/meson.build

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
python = import('python').find_installation(pure: false)
2+
3+
python.install_sources(
4+
[
5+
'__init__.py',
6+
'_extensions.py',
7+
'binary_trees.py',
8+
'heaps.py',
9+
'm_ary_trees.py',
10+
'space_partitioning_trees.py'
11+
],
12+
subdir: 'pydatastructs/trees'
13+
)
14+
15+
python.extension_module(
16+
'pydatastructs.trees._backend.cpp._trees',
17+
'_backend/cpp/trees.cpp',
18+
install: true,
19+
subdir: 'pydatastructs/trees'
20+
)
21+
22+
subdir('tests')

0 commit comments

Comments
 (0)