Skip to content

Commit 6423936

Browse files
authored
Python: 3.6 - 3.9 (#828)
* Python: 3.6 - 3.9 Add support for Python 3.9, drop support for 3.5 (end-of-life since 9/2020). * Dockerfile: Python 3.6-3.9
1 parent 1acfdf6 commit 6423936

8 files changed

Lines changed: 26 additions & 25 deletions

File tree

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Other
2424
"""""
2525

2626
- switch to C++14 #825
27+
- Python: support 3.6 - 3.9 #828
2728
- Docs:
2829

2930
- Release cibuildwheel example #775

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ if(openPMD_USE_PYTHON STREQUAL AUTO)
269269
"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}' "
270270
"is NOT supported. Set for example "
271271
"-DPYTHON_EXECUTABLE=$(which python3) "
272-
"to use 3.5+.")
272+
"to use 3.6+.")
273273
endif()
274274
elseif(openPMD_USE_PYTHON)
275275
if(openPMD_USE_INTERNAL_PYBIND11)
@@ -286,7 +286,7 @@ elseif(openPMD_USE_PYTHON)
286286
"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}' "
287287
"is NOT supported. Set for example "
288288
"-DPYTHON_EXECUTABLE=$(which python3) "
289-
"to use 3.5+.")
289+
"to use 3.6+.")
290290
endif()
291291
else()
292292
set(openPMD_HAVE_PYTHON FALSE)

Dockerfile

Lines changed: 16 additions & 17 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.5-3.8 via "35m 36m 37m 38"
9-
ARG PY_VERSIONS="35m 36m 37m 38"
8+
# Python 3.6-3.9 via "36m 37m 38 39"
9+
ARG PY_VERSIONS="36m 37m 38 39"
1010

1111
# static libs need relocatable symbols for linking to shared python lib
1212
ENV CFLAGS="-fPIC ${CFLAGS}"
@@ -40,7 +40,8 @@ RUN curl -sLo hdf5-1.10.5.tar.gz https://support.hdfgroup.org/ftp/HDF5/re
4040
&& make install
4141

4242
# avoid picking up a static libpthread in adios (also: those libs lack -fPIC)
43-
RUN rm /usr/lib64/libpthread.a /usr/lib64/libm.a /usr/lib64/librt.a
43+
RUN rm -f /usr/lib64/libpthread.a /usr/lib64/libm.a /usr/lib64/librt.a
44+
RUN rm -f /usr/lib/libpthread.a /usr/lib/libm.a /usr/lib/librt.a
4445

4546
RUN curl -sLo c-blosc-1.15.0.tar.gz https://github.com/Blosc/c-blosc/archive/v1.15.0.tar.gz \
4647
&& file c-blosc*.tar.gz \
@@ -68,10 +69,6 @@ RUN curl -sLo adios2-2.6.0.tar.gz https://github.com/ornladios/ADIOS2/arc
6869
&& file adios2*.tar.gz \
6970
&& tar -xzf adios2*.tar.gz \
7071
&& rm adios2*.tar.gz \
71-
&& cd ADIOS2-* \
72-
&& curl -sLo adios2-static.patch https://patch-diff.githubusercontent.com/raw/ornladios/ADIOS2/pull/1828.patch \
73-
&& patch -p1 < adios2-static.patch \
74-
&& cd .. \
7572
&& mkdir build-ADIOS2 \
7673
&& cd build-ADIOS2 \
7774
&& PY_TARGET=${PY_VERSIONS%% *} \
@@ -136,9 +133,10 @@ RUN python3 --version \
136133
&& python3 -m pip install openPMD_api-*-cp37-cp37m-manylinux2010_x86_64.whl
137134
RUN find / -name "openpmd*"
138135
RUN ls -hal /usr/local/lib/python3.7/dist-packages/
136+
RUN ls -hal /usr/local/lib/python3.7/dist-packages/openpmd_api/
139137
# RUN ls -hal /usr/local/lib/python3.7/dist-packages/.libsopenpmd_api
140138
# RUN objdump -x /usr/local/lib/python3.7/dist-packages/openpmd_api.cpython-37m-x86_64-linux-gnu.so | grep RPATH
141-
RUN ldd /usr/local/lib/python3.7/dist-packages/openpmd_api.cpython-37m-x86_64-linux-gnu.so
139+
RUN ldd /usr/local/lib/python3.7/dist-packages/openpmd_api/openpmd_api_cxx.cpython-37m-x86_64-linux-gnu.so
142140
RUN python3 -c "import openpmd_api as io; print(io.__version__); print(io.variants)"
143141
RUN python3 -m openpmd_api.ls --help
144142
RUN openpmd-ls --help
@@ -175,18 +173,19 @@ RUN python3 -c "import openpmd_api as io; print(io.__version__); print(io
175173
RUN python3 -m openpmd_api.ls --help
176174
RUN openpmd-ls --help
177175

178-
# test in fresh env: Debian:Stretch + Python 3.5
179-
FROM debian:stretch
176+
# test in fresh env: Debian:Bullseye + Python 3.9
177+
FROM debian:bullseye
180178
ENV DEBIAN_FRONTEND noninteractive
181-
COPY --from=build-env /wheelhouse/openPMD_api-*-cp35-cp35m-manylinux2010_x86_64.whl .
179+
COPY --from=build-env /wheelhouse/openPMD_api-*-cp39-cp39-manylinux2010_x86_64.whl .
182180
RUN apt-get update \
183-
&& apt-get install -y --no-install-recommends python3 python3-pip \
181+
&& apt-get install -y --no-install-recommends python3.9 python3-distutils ca-certificates curl \
184182
&& rm -rf /var/lib/apt/lists/*
185-
RUN python3 --version \
186-
&& python3 -m pip install -U pip \
187-
&& python3 -m pip install openPMD_api-*-cp35-cp35m-manylinux2010_x86_64.whl
188-
RUN python3 -c "import openpmd_api as io; print(io.__version__); print(io.variants)"
189-
RUN python3 -m openpmd_api.ls --help
183+
RUN python3.9 --version \
184+
&& curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
185+
&& python3.9 get-pip.py \
186+
&& python3.9 -m pip install openPMD_api-*-cp39-cp39-manylinux2010_x86_64.whl
187+
RUN python3.9 -c "import openpmd_api as io; print(io.__version__); print(io.variants)"
188+
RUN python3.9 -m openpmd_api.ls --help
190189
RUN openpmd-ls --help
191190

192191

NEWS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Upgrade Guide
77
-----------
88

99
Building openPMD-api now requires a compiler that supports C++14 or newer.
10+
Supported Python version are now 3.6 to 3.9.
1011

1112

1213
0.12.0-alpha

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ while those can be built either with or without:
119119

120120
Optional language bindings:
121121
* Python:
122-
* Python 3.5 - 3.8
123-
* pybind 2.4.3+
122+
* Python 3.6 - 3.9
123+
* pybind11 2.4.3+
124124
* numpy 1.15+
125125
* mpi4py 2.1+
126126

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.5 - 3.8
42+
* Python 3.6 - 3.9
4343
* pybind11 2.4.3+
4444
* numpy 1.15+
4545
* mpi4py 2.1+

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def build_extension(self, ext):
164164
cmdclass=dict(build_ext=CMakeBuild),
165165
# scripts=['openpmd-ls'],
166166
zip_safe=False,
167-
python_requires='>=3.5, <3.9',
167+
python_requires='>=3.6, <3.10',
168168
# tests_require=['pytest'],
169169
install_requires=install_requires,
170170
# see: src/bindings/python/cli
@@ -192,10 +192,10 @@ def build_extension(self, ext):
192192
'Topic :: Database :: Front-Ends',
193193
'Programming Language :: C++',
194194
'Programming Language :: Python :: 3',
195-
'Programming Language :: Python :: 3.5',
196195
'Programming Language :: Python :: 3.6',
197196
'Programming Language :: Python :: 3.7',
198197
'Programming Language :: Python :: 3.8',
198+
'Programming Language :: Python :: 3.9',
199199
('License :: OSI Approved :: '
200200
'GNU Lesser General Public License v3 or later (LGPLv3+)'),
201201
],

share/openPMD/thirdParty/pybind11/tools/pybind11Tools.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if(NOT PYBIND11_PYTHON_VERSION)
1212
set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling modules")
1313
endif()
1414

15-
set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4)
15+
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6)
1616
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
1717

1818
include(CheckCXXCompilerFlag)

0 commit comments

Comments
 (0)