diff --git a/.appveyor.yml b/.appveyor.yml index f002a918b..1f8bcaf37 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -47,7 +47,7 @@ install: - "%PYTHON%\\python.exe -m pip install --upgrade wheel" - "%PYTHON%\\python.exe -m wheel version" # Cython - - "%PYTHON%\\python.exe -m pip install Cython" + - "%PYTHON%\\python.exe -m pip install -r conf\\requirements-build-cython.txt" - "%PYTHON%\\python.exe -m cython --version" # Microsoft MPI - "powershell .azure\\install-msmpi.ps1" diff --git a/.azure/pipelines.yml b/.azure/pipelines.yml index d2e2d2680..2163c5d56 100644 --- a/.azure/pipelines.yml +++ b/.azure/pipelines.yml @@ -50,8 +50,12 @@ jobs: Python310_OpenMPI: PYTHON_VERSION: '3.10' MPI: 'openmpi' - variables: - PYTHON_ARCH: x64 + Python311_MPICH: + PYTHON_VERSION: '3.11' + MPI: 'mpich' + Python311_OpenMPI: + PYTHON_VERSION: '3.11' + MPI: 'openmpi' steps: - bash: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null displayName: 'Configure hostname' @@ -59,7 +63,7 @@ jobs: - job: macOS pool: - vmImage: 'macOS-10.15' + vmImage: 'macOS-11' strategy: matrix: Python35_MPICH: @@ -98,8 +102,12 @@ jobs: Python310_OpenMPI: PYTHON_VERSION: '3.10' MPI: 'openmpi' - variables: - PYTHON_ARCH: x64 + Python311_MPICH: + PYTHON_VERSION: '3.11' + MPI: 'mpich' + Python311_OpenMPI: + PYTHON_VERSION: '3.11' + MPI: 'openmpi' steps: - bash: echo 127.0.0.1 `hostname` | sudo tee -a /etc/hosts > /dev/null displayName: 'Configure hostname' @@ -110,44 +118,25 @@ jobs: vmImage: 'windows-2019' strategy: matrix: - Python35_32bit: - PYTHON_VERSION: '3.5' - PYTHON_ARCH: 'x86' - Python36_32bit: - PYTHON_VERSION: '3.6' - PYTHON_ARCH: 'x86' - Python37_32bit: - PYTHON_VERSION: '3.7' - PYTHON_ARCH: 'x86' - Python38_32bit: - PYTHON_VERSION: '3.8' - PYTHON_ARCH: 'x86' - Python39_32bit: - PYTHON_VERSION: '3.9' - PYTHON_ARCH: 'x86' - Python35_64bit: + Python35_MSMPI: PYTHON_VERSION: '3.5' - PYTHON_ARCH: 'x64' - Python36_64bit: + Python36_MSMPI: PYTHON_VERSION: '3.6' - PYTHON_ARCH: 'x64' - Python37_64bit: + Python37_MSMPI: PYTHON_VERSION: '3.7' - PYTHON_ARCH: 'x64' - Python38_64bit: + Python38_MSMPI: PYTHON_VERSION: '3.8' - PYTHON_ARCH: 'x64' - Python39_64bit: + Python39_MSMPI: PYTHON_VERSION: '3.9' - PYTHON_ARCH: 'x64' - Python310_64bit: + Python310_MSMPI: PYTHON_VERSION: '3.10' - PYTHON_ARCH: 'x64' + Python311_MSMPI: + PYTHON_VERSION: '3.11' variables: MPI: 'msmpi' steps: - template: steps.yml - publish: dist - artifact: 'Windows-py$(PYTHON_VERSION)-$(PYTHON_ARCH)' + artifact: 'Windows-py$(PYTHON_VERSION)' displayName: 'Publish package artifacts' condition: eq( variables['Agent.OS'], 'Windows_NT' ) diff --git a/.azure/steps.yml b/.azure/steps.yml index 96b85e848..eb73c3d77 100644 --- a/.azure/steps.yml +++ b/.azure/steps.yml @@ -10,12 +10,12 @@ steps: - task: UsePythonVersion@0 inputs: versionSpec: $(PYTHON_VERSION) - architecture: $(PYTHON_ARCH) + architecture: x64 displayName: 'Use Python $(PYTHON_VERSION)' - script: python -m pip install --upgrade setuptools pip wheel displayName: 'Install packaging tools' -- script: python -m pip install --upgrade cython +- script: python -m pip install -r conf/requirements-build-cython.txt displayName: 'Install build dependencies' - script: python -m pip wheel -vvv --wheel-dir=dist . displayName: 'Build package' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d40861f4..b471c74af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,41 +21,40 @@ jobs: fail-fast: false matrix: py-version: - - "2.7" + #- "2.7" - "3.5" - "3.6" - "3.7" - "3.8" - "3.9" - "3.10" - - "pypy-2.7" + - "3.11" + - "3.12" + #- "pypy-2.7" - "pypy-3.6" - "pypy-3.7" + - "pypy-3.8" + - "pypy-3.9" py-arch: - - x86 - x64 mpi: - mpich - openmpi - msmpi os: - - ubuntu-18.04 - - macos-10.15 + - ubuntu-20.04 + - macos-11 - windows-2019 exclude: - - os: ubuntu-18.04 - py-arch: x86 - - os: ubuntu-18.04 + - os: ubuntu-20.04 mpi: msmpi - - os: macos-10.15 + - os: macos-11 py-version: pypy-2.7 - - os: macos-10.15 + - os: macos-11 py-version: pypy-3.6 - - os: macos-10.15 + - os: macos-11 py-version: pypy-3.7 - - os: macos-10.15 - py-arch: x86 - - os: macos-10.15 + - os: macos-11 mpi: msmpi - os: windows-2019 mpi: mpich @@ -63,12 +62,6 @@ jobs: mpi: openmpi - os: windows-2019 py-version: pypy-2.7 - - os: windows-2019 - py-version: pypy-3.6 - py-arch: x86 - - os: windows-2019 - py-version: pypy-3.7 - py-arch: x86 steps: @@ -105,7 +98,7 @@ jobs: - name: Install packaging tools run: python -m pip install --upgrade setuptools pip wheel - name: Install build dependencies - run: python -m pip install --upgrade cython + run: python -m pip install -r conf/requirements-build-cython.txt - name: Build package run: python -m pip wheel -vvv --wheel-dir=dist . - name: Upload package artifacts @@ -167,10 +160,10 @@ jobs: - name: pylint run: pylint mpi4py - - name: mypy (stubtest) - run: stubtest mpi4py - --mypy-config-file=conf/mypy.ini - --allowlist=conf/mypy.stubtest.allow.txt + #- name: mypy (stubtest) + # run: stubtest mpi4py + # --mypy-config-file=conf/mypy.ini + # --allowlist=conf/mypy.stubtest.allow.txt - name: mypy (typecheck) run: mypy -p mpi4py diff --git a/.travis.yml b/.travis.yml index 86b3065b3..00912edf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ addons: update: true before_install: - - python -m pip install Cython + - python -m pip install -r conf/requirements-build-cython.txt - python -m pip install numpy - source .azure/install-$MPI.sh - python --version diff --git a/conf/ci/fedoracloud.sh b/conf/ci/fedoracloud.sh index b6f14f3c9..2cad4768a 100755 --- a/conf/ci/fedoracloud.sh +++ b/conf/ci/fedoracloud.sh @@ -30,7 +30,7 @@ source venv-$PY-$MPI/bin/activate pip install pip --upgrade echo "Installing dependencies" -pip install Cython +pip install -r conf/requirements-build-cython.txt pip install pydocstyle pylint coverage --upgrade echo "Loading MPI module: $MPI" diff --git a/conf/requirements-build-cython.txt b/conf/requirements-build-cython.txt new file mode 100644 index 000000000..d01552dd5 --- /dev/null +++ b/conf/requirements-build-cython.txt @@ -0,0 +1 @@ +cython < 3.0.0 diff --git a/setup.py b/setup.py index 01cdc34fc..a63b4f959 100644 --- a/setup.py +++ b/setup.py @@ -82,6 +82,8 @@ def description(): Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 +Programming Language :: Python :: 3.11 +Programming Language :: Python :: 3.12 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Scientific/Engineering @@ -485,7 +487,7 @@ def run_setup(): has_git = os.path.isdir(os.path.join(topdir, '.git')) has_hg = os.path.isdir(os.path.join(topdir, '.hg')) if not has_src or has_git or has_hg: - setup_args['setup_requires'] += ['Cython>='+CYTHON] + setup_args['setup_requires'] += ['Cython>='+CYTHON+',<3.0.0'] # setup( packages = [ diff --git a/src/mpi4py/MPI.pyx b/src/mpi4py/MPI.pyx index 055976d2d..dd93e0dc5 100644 --- a/src/mpi4py/MPI.pyx +++ b/src/mpi4py/MPI.pyx @@ -8,6 +8,7 @@ #cython: autotestdict=False #cython: warn.multiple_declarators=False #cython: optimize.use_switch=False +#cython: legacy_implicit_noexcept=True from __future__ import absolute_import cimport cython include "MPI/MPI.pyx" diff --git a/test/runtests.py b/test/runtests.py index d2b024446..1bcf72bc5 100644 --- a/test/runtests.py +++ b/test/runtests.py @@ -76,11 +76,20 @@ def getoptionparser(): return parser def getbuilddir(): - from distutils.util import get_platform - plat_name, (x, y) = get_platform(), sys.version_info[:2] - s = os.path.join("build", "lib.%s-%d.%d" % (plat_name, x, y)) - if hasattr(sys, 'gettotalrefcount'): s += '-pydebug' - return s + try: + try: + from setuptools.dist import Distribution + except ImportError: + from distutils.dist import Distribution + try: + from setuptools.command.build import build + except ImportError: + from distutils.command.build import build + cmd_obj = build(Distribution()) + cmd_obj.finalize_options() + return cmd_obj.build_platlib + except Exception: + return None def setup_python(options): rootdir = os.path.dirname(os.path.dirname(__file__)) diff --git a/test/test_spawn.py b/test/test_spawn.py index 8e51d51dc..141ddbb2d 100644 --- a/test/test_spawn.py +++ b/test/test_spawn.py @@ -71,7 +71,8 @@ def using_GPU(): @unittest.skipMPI('openmpi(==4.0.0)') @unittest.skipMPI('openmpi(==4.0.1)', sys.platform=='darwin') @unittest.skipMPI('openmpi(==4.0.2)', sys.platform=='darwin') -@unittest.skipMPI('mpich', appnum() is None) +@unittest.skipMPI('mpich(<4.1.0)', appnum() is None) +@unittest.skipMPI('mpich(==4.1.2)', sys.platform=='darwin') @unittest.skipMPI('mpich', badport()) @unittest.skipMPI('msmpi(<8.1.0)') @unittest.skipMPI('msmpi', appnum() is None) diff --git a/tox.ini b/tox.ini index 987f31a02..189751c5c 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,8 @@ envlist = py38, py39, py310, + py311, + py312, pypy2, pypy3, @@ -21,7 +23,10 @@ envlist = mpiexec = {env:MPIEXEC:mpiexec} [testenv] -deps = numpy +deps = + numpy; python_version < '3.12' + setuptools; python_version >= '3.12' +allowlist_externals = {[mpi]mpiexec} whitelist_externals = {[mpi]mpiexec} commands = {[mpi]mpiexec} -n 1 {envpython} -m mpi4py --version