Skip to content

Commit 003fd0f

Browse files
Merge pull request #367 from vincentcasseau/dev
Github actions: generate doc automatically
2 parents 2ae9e06 + 39660c5 commit 003fd0f

File tree

18 files changed

+167
-40
lines changed

18 files changed

+167
-40
lines changed

.github/workflows/version-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ jobs:
3838
- name: Deploy docs
3939
run: |
4040
export CASSIOPEE=$GITHUB_WORKSPACE
41-
cd $CASSIOPEE/Cassiopee/KCore/doc
42-
./install
41+
cd $CASSIOPEE/Cassiopee
42+
./install --doc
4343
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
4444
VERSION=${GITHUB_REF#refs/tags/}
4545
mike deploy --push --update-aliases "$VERSION" latest

Cassiopee/CPlot/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import CPlot
9-
__version__ = CPlot.__version__
8+
try:
9+
import CPlot
10+
__version__ = CPlot.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../CPlot/CPlot.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Compressor/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,16 @@
1515
import sys
1616
import os
1717

18-
import Compressor
19-
__version__ = Compressor.__version__
18+
try:
19+
import Compressor
20+
__version__ = Compressor.__version__
21+
except ModuleNotFoundError:
22+
__version__ = 'undefined'
23+
with open('../../Compressor/Compressor.py') as f:
24+
for line in f:
25+
if '__version__' in line:
26+
__version__ = line.split('=')[1].strip()
27+
break
2028

2129
# If extensions (or modules to document with autodoc) are in another directory,
2230
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Connector/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import Connector
9-
__version__ = Connector.__version__
8+
try:
9+
import Connector
10+
__version__ = Connector.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../Connector/Connector.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Converter/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import Converter
9-
__version__ = Converter.__version__
8+
try:
9+
import Converter
10+
__version__ = Converter.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../Converter/Converter.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Dist2Walls/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import Dist2Walls
9-
__version__ = Dist2Walls.__version__
8+
try:
9+
import Dist2Walls
10+
__version__ = Dist2Walls.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../Dist2Walls/Dist2Walls.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Distributor2/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import Distributor2
9-
__version__ = Distributor2.__version__
8+
try:
9+
import Distributor2
10+
__version__ = Distributor2.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../Distributor2/Distributor2.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Generator/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import Generator
9-
__version__ = Generator.__version__
8+
try:
9+
import Generator
10+
__version__ = Generator.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../Generator/Generator.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Geom/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import Geom
9-
__version__ = Geom.__version__
8+
try:
9+
import Geom
10+
__version__ = Geom.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../Geom/Geom.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

Cassiopee/Initiator/doc/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@
55
import sys
66
import os
77

8-
import Initiator
9-
__version__ = Initiator.__version__
8+
try:
9+
import Initiator
10+
__version__ = Initiator.__version__
11+
except ModuleNotFoundError:
12+
__version__ = 'undefined'
13+
with open('../../Initiator/Initiator.py') as f:
14+
for line in f:
15+
if '__version__' in line:
16+
__version__ = line.split('=')[1].strip()
17+
break
1018

1119
# If extensions (or modules to document with autodoc) are in another directory,
1220
# add these directories to sys.path here. If the directory is relative to the

0 commit comments

Comments
 (0)