Skip to content

Commit 0618222

Browse files
committed
Use spin build system and update CI
1 parent 54ecbf5 commit 0618222

File tree

13 files changed

+51
-24
lines changed

13 files changed

+51
-24
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ jobs:
4040
sudo apt-get install -y lcov
4141
4242
- name: Build package
43+
env:
44+
CXXFLAGS: "-std=c++17 --coverage"
45+
CFLAGS: "--coverage"
4346
run: |
44-
CXXFLAGS="-std=c++17 --coverage" CFLAGS="--coverage" python scripts/build/install.py
47+
spin build -v
4548
# coverage tests
4649
- name: Run tests
4750
run: |
48-
python -m pytest --doctest-modules --cov=./ --cov-report=xml -s
51+
spin test -v
4952
5053
- name: Capture Coverage Data with lcov
5154
run: |
@@ -101,12 +104,14 @@ jobs:
101104
python -m pip install -r docs/requirements.txt
102105
103106
- name: Build package
107+
env:
108+
CXXFLAGS: "-std=c++17"
104109
run: |
105-
CXXFLAGS="-std=c++17" python scripts/build/install.py
110+
spin build -v
106111
107112
- name: Run tests
108113
run: |
109-
python -c "import pydatastructs; pydatastructs.test(only_benchmarks=True)"
114+
spin test -v
110115
111116
- name: Build Documentation
112117
run: |
@@ -144,11 +149,12 @@ jobs:
144149
- name: Build package
145150
env:
146151
MACOSX_DEPLOYMENT_TARGET: 11.0
152+
CXXFLAGS: "-std=c++17"
147153
run: |
148-
CXXFLAGS="-std=c++17" python scripts/build/install.py
154+
spin build -v
149155
- name: Run tests
150156
run: |
151-
python -c "import pydatastructs; pydatastructs.test()"
157+
spin test -v
152158
153159
- name: Build Documentation
154160
run: |
@@ -194,11 +200,11 @@ jobs:
194200
env:
195201
CL: "/std:c++17"
196202
run: |
197-
python scripts/build/install.py
203+
spin build -v
198204
199205
- name: Run tests
200206
run: |
201-
python -c "import pydatastructs; pydatastructs.test()"
207+
spin test -v
202208
203209
- name: Build Documentation
204210
run: |

environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ dependencies:
99
- pip:
1010
- codecov
1111
- pytest-cov
12+
- spin
13+
- meson
1214
- sphinx==5.0
1315
- sphinx-readable-theme==1.3.0
1416
- myst_nb==0.17.2

pydatastructs/graphs/meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ python.install_sources(
2020
py_include = include_directories('../utils/_backend/cpp')
2121

2222
python.extension_module(
23-
'pydatastructs.graphs._backend.cpp._graph',
23+
'_graph',
2424
'_backend/cpp/graph.cpp',
2525
include_directories: py_include,
2626
install: true,
27-
subdir: 'pydatastructs/graphs'
27+
subdir: 'pydatastructs/graphs/_backend/cpp'
2828
)
2929

3030
python.extension_module(
31-
'pydatastructs.graphs._backend.cpp._algorithms',
31+
'_algorithms',
3232
'_backend/cpp/algorithms.cpp',
3333
include_directories: py_include,
3434
install: true,
35-
subdir: 'pydatastructs/graphs'
35+
subdir: 'pydatastructs/graphs/_backend/cpp'
3636
)
3737

3838
subdir('tests')

pydatastructs/linear_data_structures/meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ python.install_sources(
1717
)
1818

1919
python.extension_module(
20-
'pydatastructs.linear_data_structures._backend.cpp._arrays',
20+
'_arrays',
2121
'_backend/cpp/arrays/arrays.cpp',
2222
install: true,
23-
subdir: 'pydatastructs/linear_data_structures'
23+
subdir: 'pydatastructs/linear_data_structures/_backend/cpp'
2424
)
2525

2626
python.extension_module(
27-
'pydatastructs.linear_data_structures._backend.cpp._algorithms',
27+
'_algorithms',
2828
'_backend/cpp/algorithms/algorithms.cpp',
2929
install: true,
30-
subdir: 'pydatastructs/linear_data_structures'
30+
subdir: 'pydatastructs/linear_data_structures/_backend/cpp'
3131
)
3232

3333
subdir('tests')

pydatastructs/miscellaneous_data_structures/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ python.install_sources(
2222
)
2323

2424
python.extension_module(
25-
'pydatastructs.miscellaneous_data_structures._backend.cpp._stack',
25+
'_stack',
2626
'_backend/cpp/stack/stack.cpp',
2727
install: true,
28-
subdir: 'pydatastructs/miscellaneous_data_structures'
28+
subdir: 'pydatastructs/miscellaneous_data_structures/_backend/cpp'
2929
)
3030

3131
subdir('tests')

pydatastructs/trees/_backend/__init__.py

Whitespace-only changes.

pydatastructs/trees/_backend/cpp/__init__.py

Whitespace-only changes.

pydatastructs/trees/meson.build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,16 @@ python.install_sources(
1212
subdir: 'pydatastructs/trees'
1313
)
1414

15+
python.install_sources(
16+
['_backend/__init__.py', '_backend/cpp/__init__.py'],
17+
subdir: 'pydatastructs/trees/_backend'
18+
)
19+
1520
python.extension_module(
16-
'pydatastructs.trees._backend.cpp._trees',
21+
'_trees',
1722
'_backend/cpp/trees.cpp',
1823
install: true,
19-
subdir: 'pydatastructs/trees'
24+
subdir: 'pydatastructs/trees/_backend/cpp'
2025
)
2126

2227
subdir('tests')

pydatastructs/utils/_backend/__init__.py

Whitespace-only changes.

pydatastructs/utils/_backend/cpp/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)