Skip to content

Commit 108008f

Browse files
committed
WIP: testin sphinx build + artifacts x16
1 parent 2f6d813 commit 108008f

File tree

2 files changed

+47
-19
lines changed

2 files changed

+47
-19
lines changed

.github/workflows/documentation.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,13 @@ jobs:
7171
auto-update-conda: true
7272
python-version: 3.9.1
7373

74-
# - name: Restore conda environment cache
75-
# uses: actions/cache@v2
76-
# with:
77-
# path: C:\Miniconda\envs\diff_check
78-
# key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
79-
# restore-keys: |
80-
# ${{ runner.os }}-conda-
81-
82-
- name: Create diff_check conda environment
83-
run: |
84-
conda env create -f environment.yml
74+
- name: Restore conda environment cache
75+
uses: actions/cache@v2
76+
with:
77+
path: C:\Miniconda\envs\diff_check
78+
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
79+
restore-keys: |
80+
${{ runner.os }}-conda-
8581
8682
- name: Activate diff_check conda environment
8783
run: |
@@ -98,22 +94,26 @@ jobs:
9894
run: |
9995
ls doc
10096
101-
# TODO: testing if it works for dlls import
102-
- name: Set environment variables
103-
run: |
104-
$env:PATH += ";$PWD"
105-
$env:PYTHONPATH += ";$PWD"
106-
- name: Set environment variables x2
97+
# TODO: testing import with test file test_pybind_dll_smoke.py to remove
98+
- name: tester test_pybind_dll_smoke.py
10799
run: |
108-
$env:PATH += ";${{ github.workspace }}\\doc"
109-
$env:PYTHONPATH += ";${{ github.workspace }}\\doc"
100+
python doc/test_pybind_dll_smoke.py
101+
working-directory: ${{github.workspace}}
110102

111103
- name: Sphinx build
112104
run: |
113105
conda run --name diff_check --no-capture-output sphinx-build doc _build
114106
working-directory: ${{github.workspace}}
115107

116108

109+
110+
111+
112+
113+
114+
115+
116+
117117
# page-deployement:
118118
# runs-on: windows-latest
119119
## FIXME: we should replace this with the action to deploy to gh-pages

doc/test_pybind_dll_smoke.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
""" This file contains a simple test for the Python bindings to the C++ code (dlls reading, pyd importing etc). """
2+
3+
import pytest
4+
import os
5+
import sys
6+
7+
# Import the C++ bindings
8+
extra_dll_dir = os.path.join(os.path.dirname(__file__), "./")
9+
os.add_dll_directory(extra_dll_dir) # For finding DLL dependencies on Windows
10+
sys.path.append(extra_dll_dir) # Add this directory to the Python path
11+
try:
12+
import diffcheck_bindings as dfb
13+
except ImportError as e:
14+
print(f"Failed to import diffcheck_bindings: {e}")
15+
print("Current sys.path directories:")
16+
for path in sys.path:
17+
print(path)
18+
print("Current files in the directory:")
19+
for file in os.listdir(extra_dll_dir):
20+
print(file)
21+
sys.exit(1)
22+
23+
# def test_dfb_test_simple():
24+
# assert dfb.dfb_test.test() == True, "The test function should return True"
25+
26+
# if __name__ == "__main__":
27+
# pytest.main()
28+
print(">>>>>>>>>>>>>>>>> test_pybind_dll_smoke.py succeded <<<<<<<<<<<<<<<<<<<<")

0 commit comments

Comments
 (0)