Skip to content

Bump black from 24.8.0 to 24.10.0 #1115

Bump black from 24.8.0 to 24.10.0

Bump black from 24.8.0 to 24.10.0 #1115

Workflow file for this run

name: GitHub CI
# run only on main branch. This avoids duplicated actions on PRs
on:
pull_request:
push:
tags:
- "*"
branches:
- main
env:
MAIN_PYTHON_VERSION: "3.10"
PACKAGE_NAME: "ansys-systemcoupling-core"
PACKAGE_NAMESPACE: "ansys.systemcoupling.core"
DOCUMENTATION_CNAME: "systemcoupling.docs.pyansys.com"
DOC_BUILD_SYC_VERSION: 24_2
FLUENT_IMAGE_VERSION: "v24.2.0"
SYC_IMAGE_VERSION: "v24.2.0"
MAPDL_IMAGE_VERSION: "v24.2-ubuntu"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
doc-style:
name: "Documentation style check"
runs-on: ubuntu-latest
steps:
- name: "PySystemCoupling documentation style checks"
uses: ansys/actions/doc-style@v7
with:
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
vale-version: "3.4.1"
style:
name: Code style
runs-on: ubuntu-latest
steps:
- name: PyAnsys code style checks
uses: ansys/actions/code-style@v7
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
smoke-tests:
name: Build and smoke tests
needs: [style]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ['3.10', '3.11', '3.12']
steps:
- name: "Build wheelhouse and perform smoke test"
uses: ansys/actions/build-wheelhouse@v7
with:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
build:
name: Build package, incl. API generation
needs: [smoke-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Create initial wheel and install
run: make build-install
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
- name: Generate API for v231
uses: ./.github/actions/generate-api
with:
image-tag: v23.1.0
- name: Generate API for v232
uses: ./.github/actions/generate-api
with:
image-tag: v23.2.0
- name: Generate API for v241
uses: ./.github/actions/generate-api
with:
image-tag: v24.1.0
- name: Generate API for v242
uses: ./.github/actions/generate-api
with:
image-tag: v24.2.0
- name: Generate API for latest
uses: ./.github/actions/generate-api
with:
image-tag: latest
- name: Clean out dist
run: rm -rf dist
- name: Build library source and wheel artifacts
# Note: Use our own build-library action as the
# ansys/actions one no longer supports the
# `checkout` option.
# We need this to prevent generated code from
# being deleted and not included in library.
uses: ./.github/actions/build-library
with:
checkout: false
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
test:
name: Testing
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Download package
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}-artifacts
path: dist
- name: Install pysystemcoupling with test dependencies
run: |
wheel_name=`echo dist/*.whl`
pip install -q --force-reinstall ${wheel_name}[tests] > /dev/null
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
- name: Unit Test v23.1.0
uses: ./.github/actions/unit-test
with:
image-tag: v23.1.0
upload-coverage: false
- name: Unit Test v23.2.0
uses: ./.github/actions/unit-test
with:
image-tag: v23.2.0
upload-coverage: false
- name: Unit Test v24.1.0
uses: ./.github/actions/unit-test
with:
image-tag: v24.1.0
upload-coverage: false
- name: Unit Test v24.2.0
uses: ./.github/actions/unit-test
with:
image-tag: v24.2.0
upload-coverage: false
- name: Unit Test latest
uses: ./.github/actions/unit-test
with:
image-tag: latest
upload-coverage: true
env:
ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}"
docs:
name: Build Documentation
needs: [doc-style, build]
runs-on: public-ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- name: Download package
uses: actions/download-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}-artifacts
path: dist
- name: Install pysystemcoupling with doc dependencies
run: |
wheel_name=`echo dist/*.whl`
pip install -q --force-reinstall ${wheel_name}[doc] > /dev/null
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Required Docker Images
run: |
echo "Pulling pysystem-coupling Image Version ${SYC_IMAGE_VERSION}"
echo "Pulling pyfluent Image Version ${FLUENT_IMAGE_VERSION}"
echo "Pulling mapdl Image Version ${MAPDL_IMAGE_VERSION}"
docker pull ghcr.io/ansys/pysystem-coupling:${SYC_IMAGE_VERSION} &
docker pull ghcr.io/ansys/pyfluent:${FLUENT_IMAGE_VERSION} &
docker pull ghcr.io/ansys/mapdl:${MAPDL_IMAGE_VERSION} &
# Wait for the background processes to finish
wait
env:
SYC_IMAGE_VERSION: ${{ env.SYC_IMAGE_VERSION }}
FLUENT_IMAGE_VERSION: ${{ env.FLUENT_IMAGE_VERSION }}
MAPDL_IMAGE_VESRION: ${{ env.MAPDL_IMAGE_VERSION }}
- name: Build HTML
run: |
export SYC_CONTAINER_USER=$(id -u):$(id -g)
make -C doc clean
make -C doc html SPHINXERRWARN="-W"
env:
PYSYC_DOC_BUILD_VERSION: ${{ env.DOC_BUILD_SYC_VERSION }}
PYSYC_BUILD_SPHINX_GALLERY: 1
ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}"
SYC_LAUNCH_CONTAINER: 1
SYC_IMAGE_TAG: ${{ env.SYC_IMAGE_VERSION }}
PYFLUENT_LAUNCH_CONTAINER: 1
FLUENT_IMAGE_TAG: ${{ env.FLUENT_IMAGE_VERSION }}
PYMAPDL_START_INSTANCE: FALSE
DOCKER_IMAGE: ghcr.io/ansys/mapdl:v24.2-ubuntu
#- name: Build PDF Documentation
# run: |
# sudo apt update
# sudo apt-get install -y texlive-latex-extra latexmk
# make -C doc pdf SPHINXERRWARN=""
# env:
# PYSYC_DOC_BUILD_VERSION: ${{ env.DOC_BUILD_SYC_VERSION }}
# extra_mem_bot: 20000000
# extra_mem_top: 30000000
- name: Upload HTML Documentation
uses: actions/upload-artifact@v4
with:
name: documentation-html
path: doc/_build/html
retention-days: 7
#- name: Upload PDF Documentation
# uses: actions/upload-artifact@v4
# with:
# name: documentation-pdf
# path: doc/_build/latex/*.pdf
# retention-days: 7
upload_dev_docs:
name: Upload dev documentation
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [docs]
steps:
- name: Deploy the latest documentation
uses: ansys/actions/doc-deploy-dev@v7
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: "documentation-html"
release:
name: Release project
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [test, docs]
runs-on: ubuntu-latest
steps:
- name: Release to the private PyPI repository
uses: ansys/actions/release-pypi-private@v7
with:
library-name: ${{ env.PACKAGE_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
- name: "Release to the public PyPI repository"
uses: ansys/actions/release-pypi-public@v7
with:
library-name: ${{ env.PACKAGE_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYPI_TOKEN }}
# TODO: We can't use ansys/actions/release-github as it assumes PDF doc.
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- name: "Release to GitHub"
uses: softprops/action-gh-release@v2
with:
files: |
./**/*.whl
./**/*.tar.gz
documentation-html 
upload_docs_release:
name: "Upload release documentation"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [release]
steps:
- name: Deploy the stable documentation
uses: ansys/actions/doc-deploy-stable@v7
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}