diff --git a/.github/workflows/_reusable-package-build.yml b/.github/workflows/_reusable-package-build.yml index ed566d60..af2de13b 100644 --- a/.github/workflows/_reusable-package-build.yml +++ b/.github/workflows/_reusable-package-build.yml @@ -4,7 +4,8 @@ on: workflow_call: inputs: package-name: - description: The name of the package to build and install. + description: The name of the package to build, install, and import (this must + be the package's importable name). required: true type: string python-versions-array: @@ -66,13 +67,23 @@ jobs: - name: Test installing wheel shell: bash run: pip install dist/*.whl + - name: Test importing ${{ env.PACKAGE_NAME }} + run: python -c "import ${{ env.PACKAGE_NAME }}" - name: Uninstall wheel - run: pip uninstall --yes "${{ env.PACKAGE_NAME }}" + shell: bash + run: | + pip uninstall -y ${{ env.PACKAGE_NAME }} + pip freeze | xargs pip uninstall -y - name: Test installing tarball shell: bash run: pip install dist/*.tar.gz + - name: Test importing ${{ env.PACKAGE_NAME }} + run: python -c "import ${{ env.PACKAGE_NAME }}" - name: Uninstall tarball - run: pip uninstall --yes "${{ env.PACKAGE_NAME }}" + shell: bash + run: | + pip uninstall -y ${{ env.PACKAGE_NAME }} + pip freeze | xargs pip uninstall -y # Check that all jobs passed check-build-and-install-passed: if: ${{ !cancelled() }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f79b61e1..da0b49f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,11 @@ Valid subsections within a version are: Things to be included in the next release go here. +### Added + +- Updated the `_reusable-package-build.yml` file to include a step that will test importing the built package to check for any missing dependencies. + - IMPORTANT: This workflow now requires the `package-name` input be the python-importable name of the package to be built, e.g. `python -c "import package_name"`. + ### Changed - Bumped dependency versions. diff --git a/workflows/package-build.md b/workflows/package-build.md index 2af9130b..ac76f65d 100644 --- a/workflows/package-build.md +++ b/workflows/package-build.md @@ -41,11 +41,11 @@ and operating system specified. ## Inputs -| Input variable | Necessity | Description | Default | -| ------------------------- | --------- | ----------------------------------------------------------------------------------------- | ---------------------------------- | -| `package-name` | required | The name of the package to build and install. | | -| `python-versions-array` | required | A valid JSON array of Python versions to validate the package can be installed with. | | -| `operating-systems-array` | optional | A valid JSON array of operating system names to validate the package can be installed on. | `'["ubuntu", "windows", "macos"]'` | +| Input variable | Necessity | Description | Default | +| ------------------------- | --------- | --------------------------------------------------------------------------------------------------- | ---------------------------------- | +| `package-name` | required | The name of the package to build, install, and import (this must be the package's importable name). | | +| `python-versions-array` | required | A valid JSON array of Python versions to validate the package can be installed with. | | +| `operating-systems-array` | optional | A valid JSON array of operating system names to validate the package can be installed on. | `'["ubuntu", "windows", "macos"]'` | ## Example