Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder authored Feb 15, 2025
2 parents d904800 + 04696c5 commit f553a5b
Show file tree
Hide file tree
Showing 17 changed files with 135 additions and 297 deletions.
63 changes: 14 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@ jobs:
matrix:
os:
- windows-2019
- ubuntu-20.04
- macos-12
- ubuntu-latest
- macos-latest
python-version:
- "2.7"
- "3.14-dev"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7"
- "3.6"
- "pypy-2.7"
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
- "pypy-3.10"
Expand All @@ -36,10 +32,6 @@ jobs:
- "luajit-5.1"

exclude:
- os: windows-2019
python-version: "2.7"
- os: windows-2019
python-version: pypy-2.7
- os: windows-2019
lua-version: lua5.2
- os: windows-2019
Expand All @@ -49,25 +41,6 @@ jobs:
- os: windows-2019
lua-version: luajit-5.1

- os: macos-12
python-version: "2.7"
- os: macos-latest
python-version: "2.7"
- os: macos-latest
python-version: "3.6"
- os: macos-latest
python-version: "3.7"
- os: macos-latest
python-version: pypy-3.7

- os: macos-12
lua-version: lua5.2
- os: macos-12
lua-version: lua5.3
- os: macos-12
lua-version: lua5.4
- os: macos-12
lua-version: luajit-5.1
- os: macos-latest
lua-version: lua5.2
- os: macos-latest
Expand All @@ -92,45 +65,37 @@ jobs:
run: git submodule update --init --recursive

- name: Set up Python ${{ matrix.python-version }}
if: startsWith(matrix.python-version, '3.') || startsWith(matrix.python-version, 'pypy') || !startsWith(matrix.os, 'ubuntu')
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Set up Python2 (Linux)
if: matrix.python-version == '2.7' && startsWith(matrix.os, 'ubuntu')
run: |
sudo ln -fs python2 /usr/bin/python
sudo apt-get update
sudo apt-get install python-setuptools python2.7 python2.7-dev
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py
ls -l /usr/bin/pip* /usr/local/bin/pip*
which pip
- name: Set up Python packages
run: |
python -m pip install -U ${{ startsWith(matrix.python-version, '2.7') && '"pip<21" "setuptools<45"' || 'pip setuptools' }}
python -m pip install -U pip setuptools
python -m pip install -U wheel tox virtualenv pytest -r requirements.txt
- name: Set up Lua ${{ matrix.lua-version }}
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
run: python setup.py sdist build_ext -i -j6 bdist_wheel
env:
SETUP_OPTIONS: ${{ !contains(matrix.lua-version, 'luajit') && (contains(matrix.lua-version, 'bundle') && '--use-bundle' || '--no-luajit') || '' }}
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}

- name: Run tests
run: pytest lupa
run: |
bash -c "python -m pip install dist/lupa-*.whl"
pytest lupa
continue-on-error: ${{ contains(matrix.python-version, 'pypy') }}
env:
SETUP_OPTIONS: ${{ !contains(matrix.lua-version, 'luajit') && (contains(matrix.lua-version, 'bundle') && '--use-bundle' || '--no-luajit') || '' }}
CFLAGS: ${{ env.CFLAGS }} ${{ env.CFLAGS_LTO }}
LDFLAGS: ${{ env.CFLAGS_LTO }}

- name: Upload wheels
if: matrix.lua-version == 'bundle' && matrix.os == 'macos-latest'
Expand Down
106 changes: 28 additions & 78 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ permissions: {}

jobs:
sdist:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

permissions:
contents: write # to create GitHub release (softprops/action-gh-release)
Expand Down Expand Up @@ -68,12 +68,6 @@ jobs:
name: sdist
path: dist/*.tar.gz

- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*.tar.gz

generate-wheels-matrix:
# Create a matrix of all architectures & versions to build.
# This enables the next step to run cibuildwheel in parallel.
Expand All @@ -86,13 +80,14 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==2.16.5
run: pipx install cibuildwheel==2.22.0
- id: set-matrix
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
| sed -e '/aarch64/s|ubuntu-latest|ubuntu-24.04-arm|' \
&& cibuildwheel --print-build-identifiers --platform macos \
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows \
Expand Down Expand Up @@ -134,8 +129,20 @@ 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/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.22.0
with:
only: ${{ matrix.only }}

Expand All @@ -146,7 +153,7 @@ jobs:

upload_release_assets:
name: Upload Release Wheels
needs: [ build_wheels, Linux, non-Linux ]
needs: [ build_wheels, Linux ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')

Expand All @@ -171,10 +178,11 @@ jobs:
- name: Release
uses: softprops/action-gh-release@v2
with:
files: ./bdist_downloads/*.whl
files: |
./bdist_downloads/*.whl
./bdist_downloads/*.tar.gz
Linux:
runs-on: ubuntu-latest

strategy:
# Allows for matrix sub-jobs to fail without canceling the rest
Expand All @@ -185,10 +193,17 @@ jobs:
- manylinux2014_x86_64
- manylinux2014_i686
pyversion: ["*"]
os: ubuntu-latest

include:
- image: manylinux2014_aarch64
pyversion: "cp36*"
os: ubuntu-24.04-arm
- image: manylinux2014_aarch64
pyversion: "cp37*"
os: ubuntu-24.04-arm

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -199,7 +214,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.9"
python-version: "3.12"

- name: Install dependencies
run: python -m pip install -r requirements.txt
Expand All @@ -214,68 +229,3 @@ jobs:
name: wheels-${{ matrix.image }}
path: wheelhouse_*/*-m*linux*.whl # manylinux / musllinux
if-no-files-found: ignore

non-Linux:
strategy:
# Allows for matrix sub-jobs to fail without canceling the rest
fail-fast: false

matrix:
os:
- macos-12
#- windows-2019
pyversion:
- "2.7"
- "3.6"
#- "pypy-3.7-v7.3.7"
#- "pypy-3.8-v7.3.7"
#- "pypy-3.9-v7.3.11"
#- "pypy-3.10-v7.3.13"

exclude:
# outdated compilers and probably not worth supporting anymore
- os: windows-2019
pyversion: "2.7"

runs-on: ${{ matrix.os }}
env:
USE_BUNDLE: "true"
MACOSX_DEPLOYMENT_TARGET: "11.0"
LUPA_WITH_LUA_DLOPEN: ${{ startsWith(matrix.os, 'windows') && 'false' || 'true' }}
PYTHON_BIN_DIR: ${{ startsWith(matrix.pyversion, '2.') && '/Library/Frameworks/Python.framework/Versions/2.7/bin' || '' }}

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Check out recursively
run: git submodule update --init --recursive

- name: Set up Python
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
# macOS has Py2.7 installed system wide
if: matrix.pyversion != '2.7'
with:
python-version: ${{ matrix.pyversion }}

- name: Install MacOS dependencies
if: startsWith(matrix.os, 'mac')
run: |
brew install automake libtool
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
- name: Install dependencies
run: |
export PATH=$PYTHON_BIN_DIR:$PATH
python -m pip install setuptools wheel -r requirements.txt
- name: Build wheels
run: |
export PATH=$PYTHON_BIN_DIR:$PATH
python setup.py --with-cython sdist ${{ contains(matrix.pyversion, '3.') && 'build_ext -j6' || '' }} bdist_wheel
- name: Upload wheels
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0
with:
name: wheels-${{ matrix.pyversion }}-${{ matrix.os }}
path: dist/*.whl
if-no-files-found: ignore
21 changes: 21 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
Lupa change log
===============

2.4 (2025-01-10)
----------------

* The windows wheels now bundle LuaJIT 2.0 and 2.1.
(patch by Michal Plichta)

* Failures in the test suite didn't set a non-zero process exit value.


2.3 (2025-01-09)
----------------

* The bundled LuaJIT versions were updated to the latest git branches.

* The bundled Lua 5.4 was updated to 5.4.7.

* Removed support for Python 2.x.

* Built with Cython 3.0.11.


2.2 (2024-06-02)
----------------

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ setter function implementations for a ``LuaRuntime``:
... raise AttributeError(
... 'not allowed to write attribute "%s"' % attr_name)
>>> class X(object):
>>> class X:
... yes = 123
... put = 'abc'
... noway = 2.1
Expand Down
21 changes: 16 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,41 @@ 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
- pip install pytest
- 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
2 changes: 0 additions & 2 deletions lupa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import

from contextlib import contextmanager as _contextmanager

# Find the implementation with the latest Lua version available.
Expand Down
Loading

0 comments on commit f553a5b

Please sign in to comment.