Skip to content
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
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ci
on:
push:
pull_request:
workflow_dispatch:
jobs:
ci:
strategy:
fail-fast: false # https://github.com/actions/runner-images#available-images
matrix: # https://www.lua.org/versions.html
os: [macos-26, macos-26-intel, ubuntu-26.04, ubuntu-26.04-arm]
runs-on: ${{ matrix.os }}
steps:
- run: echo "${{ runner.os }} on ${{ runner.arch }}"
- if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y luarocks
- if: runner.os == 'macOS'
run: brew install luarocks
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: 3.x
pip-install: --editable .
# Dependencies installed. Start testing.
- shell: python # Sanity check
run: |
import lua
lg = lua.globals()
print(f"{lg = }")
print(f"{lg.string = }")
print(f"{lg.string.lower = }")
print(f"{lg.string.lower('Hello world!') = }")
assert lg.string.lower('Hello world!') != 'Hello world!'
assert lg.string.lower('Hello world!') == 'hello world!'
- run: python -m doctest tests/test_lua.py || true
- run: pip install pytest
- run: pytest || true
- run: pytest --doctest-modules || true
17 changes: 10 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/usr/bin/python

import sys
import os
import sys
from distutils.sysconfig import get_python_lib

if sys.version > '3':
PY3 = True
else:
PY3 = False

if PY3:
import subprocess as commands
from setuptools import Extension, setup
from subprocess import getstatusoutput
from sysconfig import get_config_var, get_python_version
else:
import commands
from distutils.core import setup, Extension
from distutils.sysconfig import get_config_var, get_python_lib, get_python_version
from commands import getstatusoutput
from distutils.core import setup, Extension
from distutils.sysconfig import get_config_var, get_python_version

if os.path.isfile("MANIFEST"):
os.unlink("MANIFEST")
Expand All @@ -22,7 +25,7 @@

LUAVERSION = None
for version in lua_versions:
presult, poutput = commands.getstatusoutput("pkg-config --exists lua" + str(version))
presult, poutput = getstatusoutput("pkg-config --exists lua" + str(version))
if presult == 0:
LUAVERSION = version
break
Expand All @@ -43,7 +46,7 @@ def pkgconfig(*packages):

combined_pcoutput = ''
for package in packages:
(pcstatus, pcoutput) = commands.getstatusoutput(
(pcstatus, pcoutput) = getstatusoutput(
"pkg-config --libs --cflags %s" % package)
if pcstatus == 0:
combined_pcoutput += ' ' + pcoutput
Expand Down
Loading