Skip to content

Commit 1377b85

Browse files
authored
Merge pull request #9 from Cadair/pure_python_fixes
Pure python fixes
2 parents 325f53d + 50dbe07 commit 1377b85

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.github/workflows/test_action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
pull_request:
66

77
jobs:
8-
build_wheels:
9-
name: Test build-python-dist action
8+
build_pure:
9+
name: Test action (pure wheel)
1010
runs-on: ubuntu-20.04
1111

1212
steps:
@@ -17,3 +17,15 @@ jobs:
1717
pure_python_wheel: true
1818
test_extras: test
1919
test_command: pytest --pyargs test_package
20+
build_non_pure:
21+
name: Test action (not pure wheel)
22+
runs-on: ubuntu-20.04
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
- id: build_not_pure
27+
uses: ./
28+
with:
29+
pure_python_wheel: "false"
30+
test_extras: test
31+
test_command: pytest --pyargs test_package

action.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ inputs:
88
description: Any extras_requires modifier that should be used to install the package for testing
99
required: false
1010
default: ''
11+
type: string
1112
test_command:
1213
description: The command to run to test the package (will be run in a temporary directory)
1314
required: false
1415
default: ''
16+
type: string
1517
pure_python_wheel:
1618
description: Whether to build a pure Python wheel in addition to the source distribution
1719
required: false
1820
default: false
21+
type: string
1922
runs:
2023
using: "composite"
2124
steps:
@@ -61,7 +64,7 @@ runs:
6164
- name: Build pure Python wheel distribution
6265
shell: bash
6366
run: python -m build --wheel .
64-
if: ${{ inputs.pure_python_wheel }}
67+
if: ${{ inputs.pure_python_wheel == 'true' }}
6568

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

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

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

0 commit comments

Comments
 (0)