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 3621ce0 commit 102e2de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .github/actions/build-python-from-source/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ runs:
fi
# Build it!
if [ "${{ runner.os }}" != "Windows" ]; then
./configure --prefix=$prefix $configure_options --enable-optimizations
./configure --prefix=$prefix CFLAGS="-O3" CXXFLAGS="-O3" $configure_options
make -j $(nproc) # Use all available processors to speed up the build.
else
# Use the build script provided for Windows in the Python source.
./PCbuild/build.bat -e -d
set CFLAGS=/Ox
set CXXFLAGS=/Ox
./PCbuild/build.bat -e -d $configure_options
fi
# Install the built Python version.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
#- os: ubuntu-latest
# python-version: '3.12.7'
# build-from-source: false
#- os: ubuntu-latest
# python-version: '3.13.0-rc.3'
# build-from-source: false
- os: ubuntu-latest
python-version: '3.13.0-rc.3'
build-from-source: false
#- os: windows-latest
# python-version: '3.13.0-rc.3'
# build-from-source: false
Expand Down
12 changes: 0 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,12 @@ def check_venv() -> None:
)


def patch_out() -> None:
"""
Patch out certain modules to prevent import conflicts on Windows.
"""
# On windows mock gets imported from _msvccompiler which then tries to import asyncio
# which causes a name conflict on concurrent. This prevents that.
if sys.platform.startswith("win"):
sys.modules["unittest"] = type(sys)("unittest")
sys.modules["unittest.mock"] = type(sys)("mock")


def check_compiler() -> None:
"""
Check the default compiler for the current platform and fix up name clashed on windows.
Prints the found compiler class.
"""
patch_out()
import distutils.ccompiler as cc

plat = os.name
Expand Down

0 comments on commit 102e2de

Please sign in to comment.