Licenses actions#

Licenses actions verify that any dependency used by a Python library uses PyAnsys authorized open source licenses.

Check licenses action#

Verifies if the licenses of the dependencies installed in the current environment are compliant with PyAnsys guidelines. This action is assumed to be used in its own job step. It clones the project and installs the project with its runtime dependencies.

Note

This action relies on PyPI metadata to identify the license for each package.

If the metadata are flawed or not included, it may lead to inconclusive results. In those cases, please perform a thorough review of the package you are using. Additionally, it is advised not to blindly rely on PyPI metadata. Even though packages may define their license as of a certain type, the package could be not applying properly its licensing conditions.

Accepted third party licenses
  • Ansys

  • Apache

  • BSD

  • GNU

  • HPND

  • ISC

  • MIT

  • MPL

  • PSF

Ignored packages
  • aiohappyeyeballs

  • ansys-corba

  • ansys-turbogrid-api

  • defusedxml

  • distlib

  • filelock

  • matplotlib

  • pypiwin32

  • pywin32

  • reuse

  • typing

  • typing-extensions

  • typing_extensions

  • usd-core

  • WMI

Projects requiring additional licenses or packages

If a certain project requires a license or package that is not supported, open an issue in the official ansys/actions repository. For additional support, please contact the PyAnsys support.

Source code for this action

Input

Description

Required

Type

Default

python-version

Python version used for installing and executing licence check.

False

string

3.10

use-python-cache

Whether to use the Python cache for installing previously downloaded libraries. If true, previously downloaded libraries are installed from the Python cache. If false, libraries are downloaded from the PyPI index.

False

boolean

True

target

Optional target used during the building process.

False

string

whitelist-license-check

Optional list of packages to ignore during the license check. Separated by a comma.

False

string

skip-install

Whether to skip the installation of the project. The default is false. If used in combination with other actions, it might not be needed to install the project.

False

boolean

False

checkout

Whether to clone the repository in the CI/CD machine. Default value is true.

False

boolean

True

Examples#

Check library dependencies ship with valid licenses
check-licenses:
  name: "Check library dependencies ship with valid licenses"
  runs-on: ubuntu-latest
  steps:
    - name: "Validate third party licenses"
      uses: ansys/actions/check-licenses@v8.1
      with:
        python-version: ${{ env.MAIN_PYTHON_VERSION }}