Skip to content

Commit

Permalink
Add python source build
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicField committed Oct 7, 2024
1 parent 102e2de commit 9222a4e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 5 additions & 7 deletions .github/actions/build-python-from-source/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,15 @@ runs:
echo "C:/Python/${{ inputs.python-version }}" >> $GITHUB_PATH
fi
# Make sure we use our version of python.
- name: Set LOCAL_PYTHON envvar
run: echo "LOCAL_PYTHON=$prefix/bin/python3" >> $GITHUB_ENV

# Ensure python is in the path and log out the version to help with debug.
- name: Verify Python Installation
run: |
python --version
shell: bash

# Set the output variable 'python-path' to the path of the installed Python executable.
- name: Set output path
id: set-path
$LOCAL_PYTHON --version
shell: bash
run: echo "::set-output name=python-path::$prefix/bin/python3"

# Example of how to use this action in a workflow:
#
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ jobs:
python-version: ${{ matrix.python-version }}
nogil: ${{ matrix.nogil }}

# Make sure we use our version of python, this is set in the build-from-source
# action os set it here for consistency if not building from source.
- name: Set LOCAL_PYTHON envvar
if: matrix.build-from-source == false
run: echo "LOCAL_PYTHON=python" >> $GITHUB_ENV

# Upgrade pip to the latest version.
- name: Upgrade pip
run: |
Expand All @@ -98,9 +104,9 @@ jobs:
- name: Build
run: |
if [ "${{ matrix.build-from-source }}" = "true" ]; then
python -P setup.py bdist_wheel --wheel-suffix=_nogil
$LOCAL_PYTHON -P setup.py bdist_wheel --wheel-suffix=_nogil
else
python -P setup.py bdist_wheel
$LOCAL_PYTHON -P setup.py bdist_wheel
fi
shell: bash

Expand All @@ -116,5 +122,5 @@ jobs:
run: |
mkdir test_dir
cd test_dir
python -m ft_utils.tests.test_run_all
$LOCAL_PYTHON -m ft_utils.tests.test_run_all
working-directory: ${{github.workspace}}

0 comments on commit 9222a4e

Please sign in to comment.