Skip to content

Commit

Permalink
Merge pull request #544 from ErlendHaa/python311-wheels
Browse files Browse the repository at this point in the history
Build python wheels for 3.11
  • Loading branch information
ErlendHaa authored Dec 21, 2022
2 parents a63601d + 113842e commit 6107089
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,27 @@ on: [push, pull_request]

jobs:
wheels:
name: Build wheels on ${{ matrix.os }}
name: Build wheels on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macOS-10.15]
arch: [auto]
include:
- os: windows-2019
cmake_generator: "Visual Studio 16 2019"
cmake_generator_platform: "x64"
cibw-arch: AMD64
arch: AMD64
- os: windows-2019
cmake_generator: "Visual Studio 16 2019"
cmake_generator_platform: "Win32"
cibw-arch: x86
arch: x86
- os: ubuntu-20.04
arch: x86_64
- os: ubuntu-20.04
arch: aarch64
- os: ubuntu-20.04
arch: i686
- os: macOS-10.15
arch: x86_64

steps:
- uses: actions/checkout@v2
Expand All @@ -33,17 +37,15 @@ jobs:
name: Set up QEMU

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.3.1
run: python -m pip install cibuildwheel

- name: Build wheels
env:
CIBW_ENVIRONMENT_WINDOWS: >
CMAKE_GENERATOR="${{ matrix.cmake_generator }}"
CMAKE_GENERATOR_PLATFORM="${{ matrix.cmake_generator_platform }}"
CIBW_ARCHS_WINDOWS: ${{ matrix.cibw-arch }}
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_SKIP: pp* *-musllinux_* cp311*
COMSPEC: C:\Program Files\PowerShell\7\pwsh.EXE
CIBW_SKIP: pp* *-musllinux_*
CIBW_ARCHS: ${{ matrix.arch }}
run: |
python -m cibuildwheel --output-dir wheelhouse python/
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ are available:
standard-mandated textual header, and `1..n` are the optional extended
headers.

The text headers are returned as 3200-byte string-like blobs (bytes in
Python 3, str in Python 2), as it is in the file. The `segyio.tools.wrap`
function can create a line-oriented version of this string.
The text headers are returned as 3200-byte byte-like blobs as it is in the
file. The `segyio.tools.wrap` function can create a line-oriented version
of this string.

* `bin`

Expand All @@ -311,7 +311,7 @@ are available:

>>> text = f.text[0]
>>> type(text)
<type 'bytes'> # 'str' in Python 2
<type 'bytes'>

>>> f.trace[10] = np.zeros(len(f.samples))
```
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.9.10
* Distribute wheels for Python 3.11

# 1.9.9
* Packaging updates

Expand Down
20 changes: 6 additions & 14 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,18 @@ requires = [
]

[tool.cibuildwheel]
# To make sure that the library is built for the right arch (i686, amd64 etc)
# then the host arch is added onto the build dir. This *must* be expanded by
# cibuildwheel since the build host (runner) might be different than the target
# emulated by the docker image. Ideally there would be a variable that holds
# what's currently being compiled, but I've yet to find it.
#
# Since the command is issued through subprocess.run() then it runs on the
# system native shell, which means all sorts of problems if that shell is
# cmd.exe, since it doesn't understand substitution $(). On windows you change
# the default shell by setting COMSPEC to either bash or powershell (or
# something else that understands $()), but there is little to gain from
# running cibuildwheel on a non-CI windows.
before-build = [
"""cmake \
-S . \
-B "cibw-$(python -c 'import platform;print(platform.machine())')/" \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON=OFF \
-DBUILD_BIN=OFF \
""",
"""cmake \
--build "cibw-$(python -c 'import platform;print(platform.machine())')/" \
--build build \
--parallel \
--target install \
--config Release \
Expand Down Expand Up @@ -69,5 +57,9 @@ test-command = [
[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux2010"

[[tool.cibuildwheel.overrides]]
select = "cp311*"
manylinux-x86_64-image = "manylinux2014"

[tool.cibuildwheel.macos]
environment = { CXXFLAGS="-L/usr/local/lib" }
2 changes: 1 addition & 1 deletion python/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
version = 1.9.9
version = 1.9.10

[aliases]
test=pytest
Expand Down
7 changes: 5 additions & 2 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,12 @@ def src(x):
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Software Development :: Libraries',
Expand Down
2 changes: 1 addition & 1 deletion python/test/segy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def test_assign_all_traces(small):


def test_traceaccess_from_array():
a = np.arange(10, dtype=np.int)
a = np.arange(10, dtype=int)
b = np.arange(10, dtype=np.int32)
c = np.arange(10, dtype=np.int64)
d = np.arange(10, dtype=np.intc)
Expand Down

0 comments on commit 6107089

Please sign in to comment.