diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 67036d49..79ac86fc 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -15,12 +15,20 @@ on: concurrency: group: pypi jobs: + print-inputs: + runs-on: ubuntu-latest + steps: + - name: Create summary of workflow inputs + run: | + echo "### inputs" >> $GITHUB_STEP_SUMMARY + echo "- release_level: ${{ inputs.release_level }}" >> $GITHUB_STEP_SUMMARY # This job requires a Personal Access Token (Classic) with # the public_repo permission. It also needs a private/public # ssh key pair that can be used for signing. The public key must # be attached to the account as an SSH signing key. pypi-version: name: Update package version + needs: [print-inputs] if: github.repository == 'tektronix/tm_devices' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest environment: package-release-gate @@ -82,7 +90,7 @@ jobs: name: Packages path: dist - name: Upload package to Test PyPI - uses: pypa/gh-action-pypi-publish@v1.8.10 + uses: pypa/gh-action-pypi-publish@v1.8.11 with: repository-url: https://test.pypi.org/legacy/ upload-pypi: @@ -100,7 +108,7 @@ jobs: name: Packages path: dist - name: Upload package to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.10 + uses: pypa/gh-action-pypi-publish@v1.8.11 upload-github: name: Upload package to GitHub Release needs: [upload-pypi] diff --git a/.github/workflows/package-testpypi.yml b/.github/workflows/package-testpypi.yml index e579c5d4..7f28ab86 100644 --- a/.github/workflows/package-testpypi.yml +++ b/.github/workflows/package-testpypi.yml @@ -50,7 +50,7 @@ jobs: name: Packages path: dist - name: Upload package to Test PyPI - uses: pypa/gh-action-pypi-publish@v1.8.10 + uses: pypa/gh-action-pypi-publish@v1.8.11 with: repository-url: https://test.pypi.org/legacy/ test-pypi-install: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57eddf04..e7a982f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - id: check-github-actions - id: check-github-workflows - repo: https://github.com/commitizen-tools/commitizen - rev: 3.12.0 + rev: v3.13.0 hooks: - id: commitizen stages: [commit-msg] diff --git a/SECURITY.md b/SECURITY.md index 4479e53c..684ea158 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,5 +8,5 @@ ## Reporting a Vulnerability -Please reach out directly to the maintainers to report a +Please reach out directly to the maintainers at tmdevicessupport@tektronix.com to report a potential vulnerability. **Do not file a public issue.** diff --git a/examples/miscellaneous/adding_devices.py b/examples/miscellaneous/adding_devices.py index 0a718673..29f0108f 100644 --- a/examples/miscellaneous/adding_devices.py +++ b/examples/miscellaneous/adding_devices.py @@ -1,8 +1,25 @@ """An example of adding devices via Python code.""" from tm_devices import DeviceManager -from tm_devices.helpers import PYVISA_PY_BACKEND, SerialConfig, SYSTEM_DEFAULT_VISA_BACKEND +from tm_devices.helpers import ( + DMConfigOptions, + PYVISA_PY_BACKEND, + SerialConfig, + SYSTEM_DEFAULT_VISA_BACKEND, +) -with DeviceManager(verbose=True) as device_manager: +# Specific config options can optionally be passed in when creating +# the DeviceManager via a dataclass, they are used to update any existing +# configuration options from a config file. +CONFIG_OPTIONS = DMConfigOptions( + setup_cleanup=True, # update the value for this option, all other options will remain untouched +) + + +# Create the DeviceManager, turning on verbosity and passing in some specific configuration values. +with DeviceManager( + verbose=True, # optional argument + config_options=CONFIG_OPTIONS, # optional argument +) as device_manager: # Explicitly specify to use the system VISA backend, this is the default, # **this code is not required** to use the system default. device_manager.visa_library = SYSTEM_DEFAULT_VISA_BACKEND