Skip to content

Pure python fixes #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 == '' }}