Skip to content

Commit 78baa4c

Browse files
authored
Python 3.11 (openPMD#1323)
* CI: Python 3.11 Build w/ Clang 14 * Docs: Python 3.7 - 3.11 * HDF5: Remove Unused Variable `total_data_size`
1 parent 62aaf6c commit 78baa4c

11 files changed

Lines changed: 44 additions & 41 deletions

File tree

.github/ci/spack-envs/clang12_py38_nompi_h5_ad1_ad2/spack.yaml renamed to .github/ci/spack-envs/clang14_py311_nompi_h5_ad1_ad2/spack.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ spack:
1919
variants: ~mpi ~zfp ~sz ~png ~dataman ~python ~fortran ~ssc ~shared ~bzip2
2020
cmake:
2121
externals:
22-
- spec: cmake@3.23.0
22+
- spec: cmake@3.22.1
2323
prefix: /usr
2424
buildable: False
2525
perl:
2626
externals:
27-
- spec: perl@5.26.1
27+
- spec: perl@5.34.0
2828
prefix: /usr
2929
buildable: False
3030
python:
3131
externals:
32-
- spec: python@3.8.0
32+
- spec: python@3.11.0
3333
prefix: /usr
3434
buildable: False
3535
all:
3636
target: [x86_64]
3737
variants: ~fortran
3838
providers:
3939
mpi: [openmpi]
40-
compiler: [clang@12.0.0]
40+
compiler: [clang@14.0.0]
4141

4242
compilers:
4343
- compiler:
4444
environment: {}
4545
extra_rpaths: []
4646
flags: {}
4747
modules: []
48-
operating_system: ubuntu20.04
48+
operating_system: ubuntu22.04
4949
paths:
50-
cc: /usr/lib/llvm-12/bin/clang
51-
cxx: /usr/lib/llvm-12/bin/clang++
50+
cc: /usr/lib/llvm-14/bin/clang
51+
cxx: /usr/lib/llvm-14/bin/clang++
5252
f77: /usr/bin/gfortran
5353
fc: /usr/bin/gfortran
54-
spec: clang@12.0.0
54+
spec: clang@14.0.0
5555
target: x86_64
5656

5757
config:

.github/workflows/linux.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,26 @@ jobs:
116116
# TODO
117117
# clang7_py36_nompi_h5_ad1_ad2_libstdc++
118118

119-
clang12_py38_nompi_h5_ad1_ad2:
120-
runs-on: ubuntu-20.04
119+
clang14_py311_nompi_h5_ad1_ad2:
120+
runs-on: ubuntu-22.04
121121
if: github.event.pull_request.draft == false
122122
steps:
123123
- uses: actions/checkout@v2
124124
- name: Spack Cache
125125
uses: actions/cache@v2
126-
with: {path: /opt/spack, key: clang12_py38_nompi_h5_ad1_ad2_v2 }
126+
with: {path: /opt/spack, key: clang14_py311_nompi_h5_ad1_ad2_v2 }
127127
- name: Install
128128
run: |
129-
sudo apt-get update
130-
sudo apt-get install clang-12 libhdf5-dev python3 python3-pip python3-numpy python3-pandas
129+
sudo apt update
130+
sudo apt install clang-14 cmake gfortran libhdf5-dev python3.11 python3.11-dev wget
131+
wget https://bootstrap.pypa.io/get-pip.py
132+
python3.11 get-pip.py
133+
python3.11 -m pip install numpy pandas
131134
sudo .github/workflows/dependencies/install_spack
132135
- name: Build
133-
env: {CC: clang-12, CXX: clang++-12, CXXFLAGS: -Werror}
136+
env: {CC: clang-14, CXX: clang++-14, CXXFLAGS: -Werror}
134137
run: |
135-
eval $(spack env activate --sh .github/ci/spack-envs/clang12_py38_nompi_h5_ad1_ad2/)
138+
eval $(spack env activate --sh .github/ci/spack-envs/clang14_py311_nompi_h5_ad1_ad2/)
136139
spack install
137140
138141
share/openPMD/download_samples.sh build
@@ -143,7 +146,8 @@ jobs:
143146
-DopenPMD_USE_ADIOS1=ON \
144147
-DopenPMD_USE_ADIOS2=ON \
145148
-DopenPMD_USE_INVASIVE_TESTS=ON \
146-
-DCMAKE_VERBOSE_MAKEFILE=ON
149+
-DCMAKE_VERBOSE_MAKEFILE=ON \
150+
-DPython_EXECUTABLE=$(which python3.11)
147151
cmake --build build --parallel 2
148152
ctest --test-dir build --output-on-failure
149153

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Changes to "0.14.0"
1717
Features
1818
""""""""
1919

20+
- Python: support of 3.10 and 3.11, removal of 3.6 #1323
2021
- include internally shipped toml11 v3.7.1 #1148 #1227
2122
- pybind11: require version 2.10.1+ #1220 #1322
2223

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ if(CMAKE_VERSION VERSION_LESS 3.18.0)
396396
set(_PY_DEV_MODULE Development)
397397
endif()
398398
if(openPMD_USE_PYTHON STREQUAL AUTO)
399-
find_package(Python 3.6.0 COMPONENTS Interpreter ${_PY_DEV_MODULE})
399+
find_package(Python 3.7.0 COMPONENTS Interpreter ${_PY_DEV_MODULE})
400400
if(Python_FOUND)
401401
if(openPMD_USE_INTERNAL_PYBIND11)
402402
add_subdirectory("${openPMD_SOURCE_DIR}/share/openPMD/thirdParty/pybind11")

Dockerfile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ FROM quay.io/pypa/manylinux2010_x86_64 as build-env
55
# FROM quay.io/pypa/manylinux1_x86_64 as build-env
66
ENV DEBIAN_FRONTEND noninteractive
77

8-
# Python 3.6-3.10 via "36m 37m 38 39 310"
9-
ARG PY_VERSIONS="36m 37m 38 39 310"
8+
# Python 3.7-3.11 via "37m 38 39 311"
9+
ARG PY_VERSIONS="37m 38 39 310 311"
1010

1111
# static libs need relocatable symbols for linking to shared python lib
1212
ENV CFLAGS="-fPIC ${CFLAGS}"
@@ -159,20 +159,6 @@ RUN python3.8 -c "import openpmd_api as io; print(io.__version__); print(
159159
RUN python3.8 -m openpmd_api.ls --help
160160
RUN openpmd-ls --help
161161

162-
# test in fresh env: Ubuntu:18.04 + Python 3.6
163-
FROM ubuntu:18.04
164-
ENV DEBIAN_FRONTEND noninteractive
165-
COPY --from=build-env /wheelhouse/openPMD_api-*-cp36-cp36m-manylinux2010_x86_64.whl .
166-
RUN apt-get update \
167-
&& apt-get install -y --no-install-recommends python3 python3-pip \
168-
&& rm -rf /var/lib/apt/lists/*
169-
RUN python3 --version \
170-
&& python3 -m pip install -U pip \
171-
&& python3 -m pip install openPMD_api-*-cp36-cp36m-manylinux2010_x86_64.whl
172-
RUN python3 -c "import openpmd_api as io; print(io.__version__); print(io.variants)"
173-
RUN python3 -m openpmd_api.ls --help
174-
RUN openpmd-ls --help
175-
176162
# test in fresh env: Debian:Bullseye + Python 3.9
177163
FROM debian:bullseye
178164
ENV DEBIAN_FRONTEND noninteractive
@@ -203,6 +189,20 @@ RUN python3.10 -c "import openpmd_api as io; print(io.__version__); print
203189
RUN python3.10 -m openpmd_api.ls --help
204190
RUN openpmd-ls --help
205191

192+
# test in fresh env: Debian:Bullseye + Python 3.11
193+
FROM debian:bullseye
194+
ENV DEBIAN_FRONTEND noninteractive
195+
COPY --from=build-env /wheelhouse/openPMD_api-*-cp311-cp311-manylinux2010_x86_64.whl .
196+
RUN apt-get update \
197+
&& apt-get install -y --no-install-recommends python3.10 python3-distutils ca-certificates curl \
198+
&& rm -rf /var/lib/apt/lists/*
199+
RUN python3.11 --version \
200+
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
201+
&& python3.11 get-pip.py \
202+
&& python3.11 -m pip install openPMD_api-*-cp311-cp311-manylinux2010_x86_64.whl
203+
RUN python3.11 -c "import openpmd_api as io; print(io.__version__); print(io.variants)"
204+
RUN python3.11 -m openpmd_api.ls --help
205+
RUN openpmd-ls --help
206206

207207
# copy binary artifacts (wheels)
208208
FROM quay.io/pypa/manylinux2010_x86_64

NEWS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Upgrade Guide
99
Building openPMD-api now requires a compiler that supports C++17 or newer.
1010
``MPark.Variant`` is not a dependency anymore (kudos and thanks for the great time!).
1111

12-
Python 3.10 is now supported.
12+
Python 3.10 & 3.11 are now supported, Python 3.6 is removed.
1313
openPMD-api now depends on `toml11 <https://github.com/ToruNiina/toml11>`__ 3.7.1+.
1414
pybind11 2.10.1 is now the minimally supported version for Python support.
1515
Catch2 2.13.9 is now the minimally supported version for tests.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ while those can be built either with or without:
119119

120120
Optional language bindings:
121121
* Python:
122-
* Python 3.6 - 3.10
122+
* Python 3.7 - 3.11
123123
* pybind11 2.10.1+
124124
* numpy 1.15+
125125
* mpi4py 2.1+ (optional, for MPI)

conda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies:
3636
- pre-commit
3737
- pyarrow # for dask
3838
# - pybind11 # shipped internally
39-
- python>=3.6
39+
- python>=3.7
4040

4141
# just a note for later hackery, we could install pip packages inside the env, too:
4242
# - pip:

docs/source/dev/dependencies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Optional: language bindings
3939

4040
* Python:
4141

42-
* Python 3.6 - 3.10
42+
* Python 3.7 - 3.11
4343
* pybind11 2.10.1+
4444
* numpy 1.15+
4545
* mpi4py 2.1+ (optional, for MPI)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def build_extension(self, ext):
190190
cmdclass=dict(build_ext=CMakeBuild),
191191
# scripts=['openpmd-ls'],
192192
zip_safe=False,
193-
python_requires='>=3.6, <3.11',
193+
python_requires='>=3.7',
194194
# tests_require=['pytest'],
195195
install_requires=install_requires,
196196
# see: src/bindings/python/cli
@@ -219,11 +219,11 @@ def build_extension(self, ext):
219219
'Topic :: Database :: Front-Ends',
220220
'Programming Language :: C++',
221221
'Programming Language :: Python :: 3',
222-
'Programming Language :: Python :: 3.6',
223222
'Programming Language :: Python :: 3.7',
224223
'Programming Language :: Python :: 3.8',
225224
'Programming Language :: Python :: 3.9',
226225
'Programming Language :: Python :: 3.10',
226+
'Programming Language :: Python :: 3.11',
227227
('License :: OSI Approved :: '
228228
'GNU Lesser General Public License v3 or later (LGPLv3+)'),
229229
],

0 commit comments

Comments
 (0)