Skip to content

Commit e5804ba

Browse files
committed
Why testing with other versions, try 3.11 for building wheels in wheels script.
Move fields from setup.py to pyproject. Other stuff. Free threading should be off by default! Remove test_version test since it seems to introduce otherwise uneeded dependency. Replace 20.04 with 24.04 because 20.04 runner is deprecated.
1 parent d1796db commit e5804ba

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

.github/workflows/tests.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ jobs:
2020
- macos-latest
2121
- windows-latest
2222
exclude:
23+
# Save time
2324
- os: macos-latest
24-
python-version: '3.10'
25-
- os: macos-latest
26-
python-version: 3.9
25+
python-version: '3.12'
26+
27+
# Both of these have trouble setting up that python on macos.
2728
- os: macos-latest
28-
python-version: '3.11'
29+
python-version: '3.9'
2930
- os: macos-latest
30-
python-version: 'pypy-3.8'
31+
python-version: 'pypy-3.9'
3132
runs-on: ${{ matrix.os }}
3233
name: ${{ matrix.os }} @ ${{ matrix.python-version }}
3334
steps:

.github/workflows/wheels.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,20 @@ jobs:
9292
strategy:
9393
fail-fast: false
9494
matrix:
95-
os: [ubuntu-20.04, windows-2019, macos-12]
95+
os: [ubuntu-24.04, windows-2019, macos-12]
9696
arch: ["x86_64", "arm64"]
9797
include:
9898
- os: windows-2019
9999
arch: win_amd64
100100
- os: windows-2019
101101
arch: win32
102-
- os: ubuntu-20.04
102+
- os: ubuntu-24.04
103103
arch: i686
104-
- os: ubuntu-20.04
104+
- os: ubuntu-24.04
105105
arch: aarch64
106-
- os: ubuntu-20.04
106+
- os: ubuntu-24.04
107107
arch: ppc64le
108-
- os: ubuntu-20.04
108+
- os: ubuntu-24.04
109109
arch: s390x
110110
exclude:
111111
- os: windows-2019
@@ -120,12 +120,19 @@ jobs:
120120
uses: docker/setup-qemu-action@v2
121121
with:
122122
platforms: all
123+
- name: Set up Python
124+
uses: actions/setup-python@v4
125+
with:
126+
python-version: "3.11"
123127
# - name: Build and test wheels
124128
# uses: pypa/cibuildwheel@v2.16.2
125129
# env:
126130
# CIBW_BUILD: "*${{ matrix.arch }}"
127131
- name: Install cibuildwheel
128132
run: python -m pip install cibuildwheel==3.0.0
133+
- name: Linux install LZO
134+
if: runner.os == 'Linux'
135+
run: sudo apt install liblzo2-dev
129136
- name: Build wheels
130137
run: python -m cibuildwheel --output-dir wheelhouse
131138
# to supply options, put them in 'env', like:
@@ -151,6 +158,7 @@ jobs:
151158
python-version: '3.11'
152159
- name: Build sdist
153160
run: |
161+
sudo apt install liblzo2-dev
154162
python -m pip install -U pip
155163
python -m pip install -U build
156164
python -m build -s

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ name = "python-lzo"
1010
version = "1.16"
1111
description = "Python bindings for the LZO data compression library"
1212
readme = "README.md"
13-
requires-python = ">=3.8"
13+
requires-python = ">=3.9"
1414
authors = [
1515
{name = "Markus F.X.J. Oberhumer", email = "markus@oberhumer.com"},
1616
]
@@ -40,4 +40,3 @@ build-verbosity = 3
4040
test-requires = "pytest"
4141
test-command = "pytest {package}/tests"
4242
test-skip = "*-win_arm64"
43-
skip = "*t-win*" # Skip free-threaded Python builds on Windows

setup.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ def run(self):
3434

3535
setup(
3636
name="python-lzo",
37-
version="1.16",
38-
description="Python bindings for the LZO data compression library",
39-
author="Markus F.X.J. Oberhumer",
40-
author_email="markus@oberhumer.com",
41-
maintainer="Joshua D. Boyd",
42-
maintainer_email="jdboyd@jdboyd.net",
43-
url="https://github.com/jd-boyd/python-lzo",
4437
license="GNU General Public License (GPL)",
4538
tests_require=['pytest'],
4639
cmdclass={
@@ -53,7 +46,6 @@ def run(self):
5346
include_dirs=[os.path.join(lzo_dir, "include")],
5447
libraries=['lzo2'] if not sys.platform == "win32" else [],
5548
library_dirs=[os.path.join(lzo_dir, "lib")],
56-
#extra_link_args=["-flat_namespace"] if sys.platform == "darwin" else [],
5749
)
5850
],
5951
long_description="""

tests/test_lzo.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ def gen_raw(src, level=1):
105105
raise lzo.error("internal error 2")
106106
print("compressed %6d -> %6d" % (len(src), len(c)))
107107

108-
def test_version():
109-
if sys.version_info >= (3, 10):
110-
from importlib.metadata import version
111-
pkg_version = version("python-lzo")
112-
else:
113-
import pkg_resources
114-
pkg_version = pkg_resources.require("python-lzo")[0].version
115-
mod_version = lzo.__version__.decode('utf-8')
116-
assert pkg_version == mod_version, \
117-
"%r != %r" %(pkg_version, mod_version)
108+
# def test_version():
109+
# if sys.version_info >= (3, 10):
110+
# from importlib.metadata import version
111+
# pkg_version = version("python-lzo")
112+
# else:
113+
# import pkg_resources
114+
# pkg_version = pkg_resources.require("python-lzo")[0].version
115+
# mod_version = lzo.__version__.decode('utf-8')
116+
# assert pkg_version == mod_version, \
117+
# "%r != %r" %(pkg_version, mod_version)
118118

119119
@pytest.mark.parametrize("src, level", [(b"aaaaaaaaaaaaaaaaaaaaaaaa", 1), (b"abcabcabcabcabcabcabcabc", 1), (b"abcabcabcabcabcabcabcabc", 9)])
120120
def test_lzo(src, level):

0 commit comments

Comments
 (0)