Skip to content

Commit

Permalink
Merge pull request #9 from Cadair/pure_python_fixes
Browse files Browse the repository at this point in the history
Pure python fixes
  • Loading branch information
Cadair authored Apr 6, 2022
2 parents 325f53d + 50dbe07 commit 1377b85
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
pull_request:

jobs:
build_wheels:
name: Test build-python-dist action
build_pure:
name: Test action (pure wheel)
runs-on: ubuntu-20.04

steps:
Expand All @@ -17,3 +17,15 @@ jobs:
pure_python_wheel: true
test_extras: test
test_command: pytest --pyargs test_package
build_non_pure:
name: Test action (not pure wheel)
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- id: build_not_pure
uses: ./
with:
pure_python_wheel: "false"
test_extras: test
test_command: pytest --pyargs test_package
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ inputs:
description: Any extras_requires modifier that should be used to install the package for testing
required: false
default: ''
type: string
test_command:
description: The command to run to test the package (will be run in a temporary directory)
required: false
default: ''
type: string
pure_python_wheel:
description: Whether to build a pure Python wheel in addition to the source distribution
required: false
default: false
type: string
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -61,7 +64,7 @@ runs:
- name: Build pure Python wheel distribution
shell: bash
run: python -m build --wheel .
if: ${{ inputs.pure_python_wheel }}
if: ${{ inputs.pure_python_wheel == 'true' }}

# TODO: check that the resulting wheel is indeed pure Python

Expand All @@ -74,7 +77,7 @@ runs:
python -m pip install --force-reinstall `find dist -name "*.whl"`[${{ inputs.test_extras }}]
cd ${{ runner.temp }}
${{ inputs.test_command }}
if: ${{ inputs.pure_python_wheel && inputs.test_command != '' && inputs.test_extras != '' }}
if: ${{ inputs.pure_python_wheel == 'true' && inputs.test_command != '' && inputs.test_extras != '' }}

- name: Test pure Python wheel distribution
shell: bash
Expand All @@ -85,4 +88,4 @@ runs:
python -m pip install --force-reinstall `find dist -name "*.whl"`
cd ${{ runner.temp }}
${{ inputs.test_command }}
if: ${{ inputs.pure_python_wheel && inputs.test_command != '' && inputs.test_extras == '' }}
if: ${{ inputs.pure_python_wheel == 'true' && inputs.test_command != '' && inputs.test_extras == '' }}

0 comments on commit 1377b85

Please sign in to comment.