Skip to content

Commit b5bc7f2

Browse files
authored
build: Bump version 0.24.0 (#618)
Added pyfluent dependency version 0.37.0 which contains the secure grpc options. There is no source code change, only the CIs have been updated to generate and use certificates.
1 parent d35aa0b commit b5bc7f2

File tree

12 files changed

+613
-34
lines changed

12 files changed

+613
-34
lines changed

.ci/pull_fluent_image.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/sh
22

33
# Image name
4-
_IMAGE_NAME="ghcr.io/ansys/pyfluent:${FLUENT_IMAGE_TAG:-latest}"
4+
_IMAGE_NAME="ghcr.io/ansys/fluent:${FLUENT_IMAGE_TAG:-latest}"
55

66
# Pull fluent image based on tag
77
docker pull $_IMAGE_NAME
88

99
# Remove all dangling images
10-
docker image prune -f
10+
docker image prune -f

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
exclude = venv, __init__.py, doc/_build, .venv
2+
exclude = venv, __init__.py, doc/_build, .venv, tests/generate_certs.py
33
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
44
count = True
55
max-complexity = 10

.github/workflows/ci_cd.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ env:
2525
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
2626
MAIN_PYTHON_VERSION: "3.11"
2727
LIBRARY_NAME: 'ansys-fluent-visualization'
28-
PYFLUENT_TIMEOUT_FORCE_EXIT: 5
28+
PYFLUENT_TIMEOUT_FORCE_EXIT: 60
2929
PYFLUENT_LAUNCH_CONTAINER: 1
30+
PYFLUENT_LAUNCH_FLUENT_TIMEOUT: 60
3031

3132
jobs:
3233

@@ -104,12 +105,12 @@ jobs:
104105
if: matrix.os == 'public-ubuntu-latest-8-cores'
105106
run: make docker-pull
106107
env:
107-
FLUENT_IMAGE_TAG: v25.2.0
108+
FLUENT_IMAGE_TAG: v25.2.3
108109

109110
- name: Test with pytest
110111
run: make unittest
111112
env:
112-
FLUENT_IMAGE_TAG: v25.2.0
113+
FLUENT_IMAGE_TAG: v25.2.3
113114

114115
- name: Upload 25.2 Coverage Artifacts
115116
if: matrix.os == 'windows-latest' && matrix.python-version == '3.12'
@@ -118,7 +119,7 @@ jobs:
118119
name: coverage_report
119120
path: ./htmlcov
120121
env:
121-
FLUENT_IMAGE_TAG: v25.2.0
122+
FLUENT_IMAGE_TAG: v25.2.3
122123

123124
- name: Remove all docker images
124125
if: always()
@@ -132,7 +133,7 @@ jobs:
132133
contents: read
133134
packages: read
134135
env:
135-
DOC_DEPLOYMENT_IMAGE_TAG: v25.2.0
136+
DOC_DEPLOYMENT_IMAGE_TAG: v25.2.3
136137
DOCUMENTATION_CNAME: "visualization.fluent.docs.pyansys.com"
137138
XDG_RUNTIME_DIR: /tmp/runtime-${{ github.run_id }}
138139

@@ -227,7 +228,7 @@ jobs:
227228
permissions:
228229
contents: write
229230
env:
230-
DOC_DEPLOYMENT_IMAGE_TAG: v25.2.0
231+
DOC_DEPLOYMENT_IMAGE_TAG: v25.2.3
231232
needs: [ docs ]
232233
steps:
233234
- name: "Deploy the stable documentation"

.github/workflows/nightly-doc-build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ permissions:
1212
env:
1313
DOCUMENTATION_CNAME: 'visualization.fluent.docs.pyansys.com'
1414
MAIN_PYTHON_VERSION: '3.11'
15-
DOC_DEPLOYMENT_IMAGE_TAG: v25.2.0
15+
DOC_DEPLOYMENT_IMAGE_TAG: v25.2.3
1616
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
17-
PYFLUENT_TIMEOUT_FORCE_EXIT: 5
17+
PYFLUENT_TIMEOUT_FORCE_EXIT: 60
18+
PYFLUENT_LAUNCH_FLUENT_TIMEOUT: 60
1819
PYFLUENT_LAUNCH_CONTAINER: 1
1920
XDG_RUNTIME_DIR: /tmp/runtime-${{ github.run_id }}
2021

.github/workflows/nightly-test-run.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ jobs:
5454
if: matrix.os == 'public-ubuntu-latest-8-cores'
5555
run: make docker-pull
5656
env:
57-
FLUENT_IMAGE_TAG: v25.2.0
57+
FLUENT_IMAGE_TAG: v25.2.3
5858

5959
- name: Test with pytest
6060
run: make unittest
6161
env:
62-
FLUENT_IMAGE_TAG: v25.2.0
62+
FLUENT_IMAGE_TAG: v25.2.3
6363

6464
- name: Remove all docker images
6565
if: always()

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@ docker-pull:
1717

1818
unittest:
1919
@pip install -r requirements/requirements_tests.txt
20+
@pip install cryptography==45.0.7
21+
@python tests/generate_certs.py
2022
@pytest -v --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html
2123

2224
build-doc:
2325
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
2426
@pip install -r requirements/requirements_doc.txt
27+
@pip install cryptography==45.0.7
2528
@python doc/api_rstgen.py
29+
@python tests/generate_certs.py
2630
@xvfb-run make -C doc html
2731
@touch doc/_build/html/.nojekyll
2832
@echo "$(DOCS_CNAME)" >> doc/_build/html/CNAME

doc/source/conf.py

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
from datetime import datetime
44
import os
5+
from pathlib import Path
56
import platform
7+
import shutil
68
import subprocess
79
import sys
810

911
import ansys.fluent.core as pyfluent
12+
from ansys.fluent.core.docker.utils import get_grpc_launcher_args_for_gh_runs
1013
from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black
1114
import numpy as np
1215
import pyvista
@@ -135,21 +138,33 @@
135138
copybutton_prompt_is_regexp = True
136139

137140

138-
def _stop_fluent_container(gallery_conf, fname):
139-
try:
140-
is_linux = platform.system() == "Linux"
141-
container_names = (
142-
subprocess.check_output(
143-
"docker container ls --format {{.Names}}", shell=is_linux
141+
def _reset_modules_hook(gallery_conf, fname, when):
142+
if when == "before":
143+
# Absolute path to doc/source/
144+
doc_src = Path(gallery_conf["src_dir"])
145+
# Project root = parent of the examples_root
146+
project_root = doc_src.parent.parent
147+
# Source = top-level project directory / certs
148+
source = project_root / "certs"
149+
# Destination = directory of the example file / certs
150+
destination = project_root / "examples" / "00-post_processing" / "certs"
151+
print(f"Copying certs from {source} to {destination}")
152+
shutil.copytree(source, destination, dirs_exist_ok=True)
153+
elif when == "after":
154+
try:
155+
is_linux = platform.system() == "Linux"
156+
container_names = (
157+
subprocess.check_output(
158+
"docker container ls --format {{.Names}}", shell=is_linux
159+
)
160+
.decode("utf-8")
161+
.strip()
162+
.split()
144163
)
145-
.decode("utf-8")
146-
.strip()
147-
.split()
148-
)
149-
for container_name in container_names:
150-
subprocess.run(f"docker stop {container_name}", shell=is_linux)
151-
except Exception:
152-
pass
164+
for container_name in container_names:
165+
subprocess.run(f"docker stop {container_name}", shell=is_linux)
166+
except Exception:
167+
pass
153168

154169

155170
# -- Sphinx Gallery Options ---------------------------------------------------
@@ -176,8 +191,8 @@ def _stop_fluent_container(gallery_conf, fname):
176191
"doc_module": "ansys-fluent-core",
177192
"image_scrapers": ("pyvista", "matplotlib"),
178193
"thumbnail_size": (350, 350),
179-
"reset_modules_order": "after",
180-
"reset_modules": (_stop_fluent_container,),
194+
"reset_modules_order": "both",
195+
"reset_modules": (_reset_modules_hook,),
181196
}
182197

183198

@@ -288,3 +303,19 @@ def _stop_fluent_container(gallery_conf, fname):
288303

289304
# PyAnsys tags configuration
290305
html_context = {"pyansys_tags": ["Fluids"]}
306+
307+
308+
# TODO: Remove this workaround when a cleaner solution to override
309+
# pyfluent launch args is available.
310+
311+
launch_fluent_original = pyfluent.launch_fluent
312+
313+
314+
def launch_fluent_secure(*args, **kwargs):
315+
"""Launch Fluent in secure mode for documentation generation."""
316+
kwargs.update(get_grpc_launcher_args_for_gh_runs())
317+
return launch_fluent_original(*args, **kwargs)
318+
319+
320+
if "FLUENT_IMAGE_TAG" in os.environ:
321+
pyfluent.launch_fluent = launch_fluent_secure

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55
[tool.poetry]
66
# Check https://python-poetry.org/docs/pyproject/ for all available sections
77
name = "ansys-fluent-visualization"
8-
version = "0.24.dev0"
8+
version = "0.24.0"
99
description = "A python wrapper for ansys Fluent visualization"
1010
license = "MIT"
1111
authors = ["ANSYS, Inc. <[email protected]>"]
@@ -25,7 +25,7 @@ packages = [
2525
[tool.poetry.dependencies]
2626
python = ">=3.10,<3.14"
2727
importlib-metadata = {version = "^4.0", python = "<3.9"}
28-
ansys-fluent-core = "~=0.37.dev0"
28+
ansys-fluent-core = "~=0.37.0"
2929
pyvista = ">=0.44.0"
3030
matplotlib = ">=3.6.0"
3131
pyvistaqt = { version = "~=0.11.1", optional = true }

requirements/requirements_doc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ autodocsumm==0.2.14
1616
pyvista[trame]>=0.43.3
1717
matplotlib>=3.8.3
1818
quarto-cli==1.5.57
19-
pdf2image==1.17.0
19+
pdf2image==1.17.0

0 commit comments

Comments
 (0)