Skip to content

Commit 699e67d

Browse files
committed
Merge branch 'docu'
2 parents be44027 + 499e805 commit 699e67d

File tree

129 files changed

+2429
-1052
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2429
-1052
lines changed

Diff for: .github/workflows/doc-build.yml

+148
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: doc-build
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: write
7+
pages: write
8+
id-token: write
9+
10+
jobs:
11+
build-source:
12+
runs-on: windows-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup conda environment
19+
uses: conda-incubator/setup-miniconda@v2
20+
with:
21+
auto-update-conda: true
22+
python-version: 3.9.1
23+
24+
- name: Create diff_check conda environment
25+
run: |
26+
conda env create -f environment.yml
27+
28+
- name: Cache conda environment cache
29+
uses: actions/cache@v2
30+
with:
31+
path: C:\Miniconda\envs\diff_check
32+
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
33+
34+
- name: Cmake Configure
35+
run: |
36+
conda run --name diff_check --no-capture-output cmake -S . -B build -A x64 -DBUILD_PYTHON_MODULE=ON -DBUILD_TESTS=OFF -DRUN_TESTS=OFF
37+
38+
- name: CMake Build
39+
run: conda run --name diff_check --no-capture-output cmake --build build --config Release
40+
41+
# upload artifacts
42+
- name: Move dlls and pyd files to single directories
43+
run: |
44+
mkdir $env:GITHUB_WORKSPACE\artifacts_dlls
45+
mkdir $env:GITHUB_WORKSPACE\artifacts_pyds
46+
Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\bin\Release -Filter *.dll -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts_dlls
47+
Get-ChildItem -Path $env:GITHUB_WORKSPACE\build\Release -Filter *.pyd -Recurse | Move-Item -Destination $env:GITHUB_WORKSPACE\artifacts_pyds
48+
shell: pwsh
49+
- name: Upload artifacts - dlls
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: __build_artifacts_dlls__
53+
path: ${{ github.workspace }}/artifacts_dlls/*
54+
- name: Upload artifacts - pyds
55+
uses: actions/upload-artifact@v2
56+
with:
57+
name: __build_artifacts_pyds__
58+
path: ${{ github.workspace }}/artifacts_pyds/*
59+
60+
61+
build-docs:
62+
runs-on: windows-latest
63+
needs: build-source
64+
65+
steps:
66+
- name: Checkout repository
67+
uses: actions/checkout@v4
68+
69+
- name: Setup conda environment
70+
uses: conda-incubator/setup-miniconda@v2
71+
with:
72+
auto-update-conda: true
73+
python-version: 3.9.1
74+
75+
- name: Restore conda environment cache
76+
uses: actions/cache@v2
77+
with:
78+
path: C:\Miniconda\envs\diff_check
79+
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
80+
restore-keys: |
81+
${{ runner.os }}-conda-
82+
83+
# download artifacts
84+
- name: Download dlls for doc folder
85+
uses: actions/download-artifact@v2
86+
with:
87+
name: __build_artifacts_dlls__
88+
path: ${{github.workspace}}/doc
89+
- name: Download pyds for doc folder
90+
uses: actions/download-artifact@v2
91+
with:
92+
name: __build_artifacts_pyds__
93+
path: ${{github.workspace}}/doc
94+
- name: Download dlls for diffCheck py package
95+
uses: actions/download-artifact@v2
96+
with:
97+
name: __build_artifacts_dlls__
98+
path: ${{github.workspace}}/src/gh/diffCheck/diffCheck/dlls
99+
- name: Download pyds for diffCheck py package
100+
uses: actions/download-artifact@v2
101+
with:
102+
name: __build_artifacts_pyds__
103+
path: ${{github.workspace}}/src/gh/diffCheck/diffCheck
104+
105+
- name: Sphinx build
106+
run: |
107+
conda run --name diff_check --no-capture-output sphinx-build -b html -v doc _build
108+
109+
- name: Upload documentation
110+
uses: actions/upload-artifact@v2
111+
with:
112+
name: __build_sphx_docs__
113+
path: ${{ github.workspace }}/_build
114+
115+
116+
page-deployement:
117+
environment:
118+
name: github-pages
119+
url: ${{ steps.deployment.outputs.page_url }}
120+
runs-on: ubuntu-latest
121+
needs: build-docs
122+
# Run only on pushes to the default branch
123+
if: github.ref == 'refs/heads/main'
124+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
125+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
126+
concurrency:
127+
group: "pages"
128+
cancel-in-progress: false
129+
130+
steps:
131+
- name: Checkout repository
132+
uses: actions/checkout@v4
133+
134+
- name: Download sphinx docs
135+
uses: actions/download-artifact@v2
136+
with:
137+
name: __build_sphx_docs__
138+
path: ${{github.workspace}}/_build
139+
140+
- name: Setup Pages
141+
uses: actions/configure-pages@v5
142+
- name: Upload artifact
143+
uses: actions/upload-pages-artifact@v3
144+
with:
145+
path: '_build'
146+
- name: Deploy to GitHub Pages
147+
id: deployment
148+
uses: actions/deploy-pages@v4

Diff for: .github/workflows/py-sanity-check.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: py-sanity-checks
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: windows-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Setup conda environment
13+
uses: conda-incubator/setup-miniconda@v2
14+
with:
15+
auto-update-conda: true
16+
python-version: 3.9.1
17+
- name: Cache conda environment cache
18+
uses: actions/cache@v2
19+
with:
20+
path: C:\Miniconda\envs\diff_check
21+
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }}
22+
restore-keys: |
23+
${{ runner.os }}-conda-
24+
id: cache-conda
25+
- name: Create diff_check conda environment if not cached
26+
if: steps.cache-conda.outputs.cache-hit != 'true'
27+
run: |
28+
conda env create -f environment.yml
29+
30+
- name: Cache pre-commit hooks
31+
uses: actions/cache@v2
32+
with:
33+
path: ~/.cache/pre-commit
34+
key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
35+
- name: Install pre-commit
36+
run: pip install pre-commit
37+
- name: Run pre-commit
38+
run: conda run --name diff_check --no-capture-output pre-commit run --all-files

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,9 @@ cython_debug/
247247

248248
# egg-info
249249
*.egg-info/
250+
251+
#######################################
252+
## Sphinx
253+
#######################################
254+
# get rid of output folder
255+
_build/

Diff for: .gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
path = deps/googletest
33
url = https://github.com/google/googletest
44
branch = main
5-
[submodule "deps/eigen"]
6-
path = deps/eigen
7-
url = https://gitlab.com/libeigen/eigen.git
85
[submodule "deps/open3d"]
96
path = deps/open3d
107
url = https://github.com/diffCheckOrg/submodule-open3d.git
@@ -20,3 +17,6 @@
2017
[submodule "deps/submodule-cilantro"]
2118
path = deps/submodule-cilantro
2219
url = https://github.com/diffCheckOrg/submodule-cilantro.git
20+
[submodule "deps/eigen"]
21+
path = deps/eigen
22+
url = https://gitlab.com/libeigen/eigen.git

Diff for: .pre-commit-config.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Install the pre-commit hooks below with
2+
# 'pre-commit install'
3+
4+
# Auto-update the version of the hooks with
5+
# 'pre-commit autoupdate'
6+
7+
# Run the hooks on all files with
8+
# 'pre-commit run --all'
9+
10+
repos:
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v4.6.0
13+
hooks:
14+
- id: check-ast
15+
exclude: ^deps/
16+
- id: check-merge-conflict
17+
- id: end-of-file-fixer
18+
# only include python files
19+
files: \.py$
20+
- id: trailing-whitespace
21+
# only include python files
22+
files: \.py$
23+
- id: end-of-file-fixer
24+
# only include python files
25+
files: \.py$
26+
27+
- repo: https://github.com/pre-commit/mirrors-mypy
28+
rev: 'v1.11.0'
29+
hooks:
30+
- id: mypy
31+
files: (src/gh|tests|invokes\.py)
32+
exclude: src/gh/components/
33+
additional_dependencies: [
34+
types-requests==2.31.0,
35+
numpy==2.0.1,
36+
pytest==8.3.1,
37+
types-setuptools>=71.1.0.20240818
38+
]
39+
args: [--config=pyproject.toml]
40+
41+
- repo: https://github.com/astral-sh/ruff-pre-commit
42+
rev: v0.4.4
43+
hooks:
44+
- id: ruff

Diff for: CMakeLists.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ if (BUILD_PYTHON_MODULE)
137137
set(PYBINDMODULE_NAME diffcheck_bindings)
138138
set(PYPI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/gh/diffCheck/diffCheck)
139139
set(TARGET_DLL_PYPI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/gh/diffCheck/diffCheck/dlls)
140+
set(SPHINX_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc)
140141

141142
download_submodule_project(pybind11)
142143
add_subdirectory(deps/pybind11)
@@ -162,12 +163,18 @@ if (BUILD_PYTHON_MODULE)
162163
${PYPI_DIR}
163164
)
164165
copy_dlls(${TARGET_DLL_PYPI_DIR} ${PYBINDMODULE_NAME})
166+
# copy the pyd/dlls for the sphinx documentation
167+
add_custom_command(TARGET ${PYBINDMODULE_NAME} POST_BUILD
168+
COMMAND ${CMAKE_COMMAND} -E copy
169+
$<TARGET_FILE:${PYBINDMODULE_NAME}>
170+
${SPHINX_DOC_DIR}
171+
)
172+
copy_dlls(${SPHINX_DOC_DIR} ${PYBINDMODULE_NAME})
165173
endif()
166174

167175
#--------------------------------------------------------------------------
168176
# Tests
169177
#--------------------------------------------------------------------------
170178
if(BUILD_TESTS)
171179
include(tests)
172-
endif()
173-
180+
endif()

0 commit comments

Comments
 (0)