Skip to content

Commit b039388

Browse files
kshitij-mathsndem0
andauthored
Fix docs rendering workflow. (#290)
* fix: LaTeX rendering issue * Update deployer workflow and docs configuration * Update create-tag workflow * Update pyproject.toml --------- Co-authored-by: Nicola Demo <demo.nicola@gmail.com>
1 parent 044eb2e commit b039388

File tree

4 files changed

+90
-48
lines changed

4 files changed

+90
-48
lines changed

.github/workflows/create-tag.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create Git Tag
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag_name:
7+
description: "Tag name (eg. v1.3.0)"
8+
required: true
9+
type: string
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
create_tag:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # serve per i tag
23+
24+
- name: Configure Git
25+
run: |
26+
git config user.name "github-actions[bot]"
27+
git config user.email "github-actions[bot]@users.noreply.github.com"
28+
29+
- name: Check if the tag is already existing
30+
run: |
31+
TAG="${{ inputs.tag_name }}"
32+
git fetch --tags
33+
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
34+
echo "❌ Tag $TAG esiste già"
35+
exit 1
36+
fi
37+
38+
- name: Create and push the tag
39+
run: |
40+
TAG="${{ inputs.tag_name }}"
41+
git tag "$TAG"
42+
git push origin "$TAG"

.github/workflows/sphinx-build.yml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
1-
name: "Deploy Documentation"
1+
name: "Continuous Deployment"
22

33
on:
44
push:
55
tags:
66
- "*"
77

88
jobs:
9-
docs:
10-
runs-on: ubuntu-18.04
9+
10+
#############################################################################
11+
# Create and online deployment of the documentation #########################
12+
docs: #######################################################################
13+
runs-on: ubuntu-latest
1114
steps:
12-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1316

1417
- name: Setup miniconda
15-
uses: conda-incubator/setup-miniconda@v2
18+
uses: conda-incubator/setup-miniconda@v3
1619
with:
1720
auto-update-conda: true
18-
python-version: 3.7
19-
20-
- name: Conda install dependecies
21-
shell: bash -l {0}
22-
run: conda install --yes -c conda-forge pythonocc-core=7.4.0 numpy scipy matplotlib vtk nose setuptools coveralls sphinx_rtd_theme sphinx python=3.7
23-
24-
- name: Conda info
25-
shell: bash -l {0}
26-
run: conda info
21+
python-version: 3.10
2722

28-
- name: Conda info
29-
shell: bash -l {0}
30-
run: cd docs && sphinx-build -b html -d build/doctrees --keep-going --no-color -w '/tmp/sphinx-log' source build/html
31-
32-
#- name: Create the new documentation
33-
#uses: ammaraskar/sphinx-action@master
34-
#with:
35-
#docs-folder: "docs/"
36-
#pre-build-command: "ls -l /usr/share"
37-
#build-command: "sphinx-build -b html -d build/doctrees --keep-going --no-color -w '/tmp/sphinx-log' source build/html"
23+
- name: Install Dependencies (conda and pip)
24+
shell: bash
25+
run: |
26+
conda install --yes -c conda-forge pythonocc-core
27+
python -m pip install --upgrade pip
28+
python -m pip install .[doc]
3829
30+
- name: Build Documentation
31+
run: |
32+
make html
33+
working-directory: docs/
3934

4035
- name: Deploy
4136
uses: peaceiris/actions-gh-pages@v3
4237
with:
4338
github_token: ${{ secrets.GITHUB_TOKEN }}
44-
#deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }}
4539
publish_dir: ./docs/build/html
4640
allow_empty_commit: true
41+
42+
#############################################################################
43+
## Create a public "Release" on the Github page #############################
44+
release_github: #############################################################
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
steps:
49+
- uses: actions/checkout@v4
50+
- uses: ncipollo/release-action@v1
51+
with:
52+
token: ${{ secrets.GITHUB_TOKEN }}

docs/source/conf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
]
4646

4747
intersphinx_mapping = {
48-
"python": ("http://docs.python.org/3", None),
49-
"numpy": ("http://docs.scipy.org/doc/numpy/", None),
50-
"scipy": ("http://docs.scipy.org/doc/scipy/reference/", None),
51-
"matplotlib": ("http://matplotlib.sourceforge.net/", None),
48+
"python": ("https://docs.python.org/3", None),
49+
"numpy": ("https://numpy.org/doc/stable/", None),
50+
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
51+
"matplotlib": ("https://matplotlib.org/stable", None),
5252
}
5353

5454
# Add any paths that contain templates here, relative to this directory.
@@ -87,7 +87,7 @@
8787
#
8888
# This is also used if you do content translation via gettext catalogs.
8989
# Usually you set "language" from the command line for these cases.
90-
language = None
90+
language = "en"
9191

9292
# There are two options for replacing |today|: either, you set today to some
9393
# non-false value, then it is used:
@@ -133,7 +133,7 @@
133133
# classes and attributes. As side effects, this option ... ???
134134
# If false, ... ???.
135135
# The default is True.
136-
viewcode_import = True
136+
# viewcode_import = True
137137

138138

139139
# -- Options for HTML output ----------------------------------------------
@@ -149,7 +149,7 @@
149149
# html_theme_options = {}
150150

151151
# Add any paths that contain custom themes here, relative to this directory.
152-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
152+
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
153153

154154
# The name for this set of Sphinx documents. If None, it defaults to
155155
# "<project> v<release> documentation".

pyproject.toml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
[build-system]
2-
requires = ["setuptools>=45", "wheel"]
3-
build-backend = "setuptools.build_meta"
4-
51
[project]
62
name = "pygem"
7-
dynamic = ["version"]
3+
dynamic = "2.0.1"
84
description = "Python Geometrical Morphing"
95
readme = {file = "README.md", content-type = "text/markdown"}
10-
keywords = ["dimension_reduction", "mathematics", "ffd", "morphing", "iges", "stl", "vtk", "openfoam"]
6+
keywords = [
7+
"vtk", "free-form-deformation", "iges", "radial-basis-function",
8+
"deformation", "shape design", "inverse-distance-weighting",
9+
"custom deformation", "mesh parameterization"
10+
]
1111
authors = [
1212
{name = "Marco Tezzele", email = "marcotez@gmail.com"},
1313
{name = "Nicola Demo", email = "demo.nicola@gmail.com"},
@@ -68,21 +68,15 @@ dev = [
6868
"pylint"
6969
]
7070

71+
[build-system]
72+
requires = ["setuptools>=45", "wheel"]
73+
build-backend = "setuptools.build_meta"
74+
7175
[tool.setuptools]
7276
include-package-data = true
7377

7478
[tool.setuptools.packages.find]
75-
where = ["."]
7679
include = ["pygem*"]
77-
exclude = ["tests*", "docs*", "tutorials*"]
78-
79-
[tool.setuptools.dynamic]
80-
version = { attr = "pygem.meta.__version__" }
8180

8281
[tool.black]
8382
line-length = 80
84-
target-version = ['py39']
85-
86-
[tool.flake8]
87-
ignore = "F401"
88-

0 commit comments

Comments
 (0)