Skip to content
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

Build wheels for windows with LuaJit #273

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ jobs:
if: contains(matrix.os, 'ubuntu') && matrix.lua-version != 'bundle'
run: sudo apt-get install lib${{ matrix.lua-version }}-dev

- name: Setup Visual Studio
if: contains(matrix.os, 'windows')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- name: Build wheel
run: python setup.py sdist ${{ contains(matrix.python-version, '3.') && 'build_ext -j6' || '' }} bdist_wheel
env:
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ jobs:
brew install automake libtool
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize

- name: Setup Visual Studio for x64
if: contains(matrix.os, 'windows') && contains(matrix.only, 'win_amd64')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- name: Setup Visual Studio for x86
if: contains(matrix.os, 'windows') && contains(matrix.only, 'win32')
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x86

- name: Build wheels
uses: pypa/[email protected]
with:
Expand Down Expand Up @@ -266,7 +278,7 @@ jobs:
- name: Install dependencies
run: |
export PATH=$PYTHON_BIN_DIR:$PATH
python -m pip install setuptools wheel -r requirements.txt
python -m pip install wheel -r requirements.txt

- name: Build wheels
run: |
Expand Down
21 changes: 16 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,40 @@ environment:
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
# - python: 27-x64
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- python: 312
arch: x86
- python: 312-x64
arch: x64
- python: 311
arch: x86
- python: 311-x64
arch: x64
- python: 310
arch: x86
- python: 310-x64
arch: x64
- python: 39
arch: x86
- python: 39-x64
arch: x64
- python: 38
arch: x86
- python: 38-x64
arch: x64
- python: 37
arch: x86
- python: 37-x64
- python: 36
- python: 36-x64
- python: 35
- python: 35-x64
arch: x64

install:
- SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%
- python -m pip.__main__ install -U pip wheel setuptools
- python -m pip.__main__ install -U pip wheel "setuptools!=72.0.0"
- pip install -r requirements.txt
- git submodule update --init --recursive

build: off
build_script:
- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%
- python -u setup.py clean
- python -u setup.py build install --use-bundle
- python -u setup.py bdist_wheel --use-bundle
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["Cython>=3.0.9", "setuptools", "wheel"]
requires = ["Cython>=3.0.9", "setuptools!=72.0.0", "wheel"]

[tool.cibuildwheel]
build-verbosity = 2
Expand All @@ -26,6 +26,7 @@ environment = {CFLAGS = "-O3 -g1 -pipe -fPIC -flto -march=armv8-a -mtune=cortex-

[tool.cibuildwheel.windows]
archs = ["AMD64", "x86"]
test-command = "python -c \"import lupa\" && python -c \"import lupa.lua54\" && python -c \"import lupa.luajit21\" "
scoder marked this conversation as resolved.
Show resolved Hide resolved

[tool.cibuildwheel.macos]
# https://cibuildwheel.readthedocs.io/en/stable/faq/#what-to-provide suggests to provide
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Cython>=3.0.9
setuptools
setuptools!=72.0.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def has_option(name):
or (platform == 'darwin' and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
# Couldn't get the Windows build to work. See
# https://luajit.org/install.html#windows
or (platform.startswith('win') and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
or (get_machine() not in ("AMD64", "x86_64") and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
# Let's restrict LuaJIT to x86_64 for now.
or (get_machine() not in ("x86_64", "AMD64") and 'luajit' in os.path.basename(lua_bundle_path.rstrip(os.sep)))
)
Expand Down