Skip to content

Commit

Permalink
Python: 3.6 - 3.9
Browse files Browse the repository at this point in the history
Add support for Python 3.9, drop support for 3.5
(end-of-life since 9/2020).
  • Loading branch information
ax3l committed Nov 24, 2020
1 parent ba3c177 commit ebe1a9e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Other
"""""

- switch to C++14 #825
- Python: support 3.6 - 3.9 #...
- Docs:

- Release cibuildwheel example #775
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ if(openPMD_USE_PYTHON STREQUAL AUTO)
"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}' "
"is NOT supported. Set for example "
"-DPYTHON_EXECUTABLE=$(which python3) "
"to use 3.5+.")
"to use 3.6+.")
endif()
elseif(openPMD_USE_PYTHON)
if(openPMD_USE_INTERNAL_PYBIND11)
Expand All @@ -286,7 +286,7 @@ elseif(openPMD_USE_PYTHON)
"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}' "
"is NOT supported. Set for example "
"-DPYTHON_EXECUTABLE=$(which python3) "
"to use 3.5+.")
"to use 3.6+.")
endif()
else()
set(openPMD_HAVE_PYTHON FALSE)
Expand Down
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ FROM quay.io/pypa/manylinux2010_x86_64 as build-env
# FROM quay.io/pypa/manylinux1_x86_64 as build-env
ENV DEBIAN_FRONTEND noninteractive

# Python 3.5-3.8 via "35m 36m 37m 38"
ARG PY_VERSIONS="35m 36m 37m 38"
# Python 3.6-3.9 via "36m 37m 38 39"
ARG PY_VERSIONS="36m 37m 38 39"

# static libs need relocatable symbols for linking to shared python lib
ENV CFLAGS="-fPIC ${CFLAGS}"
Expand Down Expand Up @@ -175,18 +175,19 @@ RUN python3 -c "import openpmd_api as io; print(io.__version__); print(io
RUN python3 -m openpmd_api.ls --help
RUN openpmd-ls --help

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


Expand Down
1 change: 1 addition & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Upgrade Guide
-----------

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


0.12.0-alpha
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ while those can be built either with or without:

Optional language bindings:
* Python:
* Python 3.5 - 3.8
* pybind 2.4.3+
* Python 3.6 - 3.9
* pybind11 2.4.3+
* numpy 1.15+
* mpi4py 2.1+

Expand Down
2 changes: 1 addition & 1 deletion docs/source/dev/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Optional: language bindings

* Python:

* Python 3.5 - 3.8
* Python 3.6 - 3.9
* pybind11 2.4.3+
* numpy 1.15+
* mpi4py 2.1+
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def build_extension(self, ext):
cmdclass=dict(build_ext=CMakeBuild),
# scripts=['openpmd-ls'],
zip_safe=False,
python_requires='>=3.5, <3.9',
python_requires='>=3.6, <3.10',
# tests_require=['pytest'],
install_requires=install_requires,
# see: src/bindings/python/cli
Expand Down Expand Up @@ -192,10 +192,10 @@ def build_extension(self, ext):
'Topic :: Database :: Front-Ends',
'Programming Language :: C++',
'Programming Language :: Python :: 3',
'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',
('License :: OSI Approved :: '
'GNU Lesser General Public License v3 or later (LGPLv3+)'),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if(NOT PYBIND11_PYTHON_VERSION)
set(PYBIND11_PYTHON_VERSION "" CACHE STRING "Python version to use for compiling modules")
endif()

set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4)
set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6)
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)

include(CheckCXXCompilerFlag)
Expand Down

0 comments on commit ebe1a9e

Please sign in to comment.