Skip to content

Commit

Permalink
feat: Enable importing the built package during the package-build w…
Browse files Browse the repository at this point in the history
…orkflow
  • Loading branch information
nfelt14 committed Sep 11, 2024
1 parent 0b0b30f commit 9a2c16b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/_reusable-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -66,13 +67,19 @@ 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 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 freeze | xargs pip uninstall -y
# Check that all jobs passed
check-build-and-install-passed:
if: ${{ !cancelled() }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ 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.

### Changed

- Bumped dependency versions.
Expand Down
10 changes: 5 additions & 5 deletions workflows/package-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a2c16b

Please sign in to comment.