Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cython #15

Merged
merged 6 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10', '3.11']
python-version: ['3.11', '3.12']

env:
USE_TRILINOS: 1
Expand All @@ -28,9 +28,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install numpy 'cython<3.0'
python -m pip install -r requirements.txt
python setup.py develop
pip install --upgrade pip setuptools wheel
pip install https://github.com/pypr/cyarray/zipball/master
pip install -r requirements.txt
pip install -e .[tests] -v --no-build-isolation
- name: Run tests
run: pytest -v pyzoltan
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[build-system]
requires = [
"setuptools >= 61.0",
"cython>3.0",
"cyarray",
"mpi4py>=1.2, <4.0"
]
build-backend = "setuptools.build_meta"

[project]
name = "pyzoltan"
dynamic = ["version"]
readme = "README.rst"
license = {file = "LICENSE.txt"}
dependencies = ["numpy", "mpi4py>=1.2"]
description = "Wrapper for the Zoltan data management library"
authors = [
{name = "PySPH Developers", email = "[email protected]"}
]
keywords = ["Cython", "Zoltan", "Dynamic load balancing"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries"
]

[project.optional-dependencies]
docs = ["sphinx"]
tests = ["pytest>=3.0"]
dev = ["sphinx", "pytest>=3.0", "cython>3.0", "cyarray"]

[project.urls]
Documentation = "https://pyzoltan.readthedocs.io"
Repository = "https://github.com/pypr/pyzoltan.git"
Issues = "https://github.com/pypr/pyzoltan/issues"
3 changes: 3 additions & 0 deletions pyzoltan/core/zoltan.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

cimport mpi4py.MPI as mpi
if MPI4PY_V2:
from mpi4py cimport libmpi as mpic
Expand Down
9 changes: 6 additions & 3 deletions pyzoltan/core/zoltan.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

"""Definitions for the Zoltan wrapper

This module defines the main wrapper for the Zoltan library. Users can
Expand Down Expand Up @@ -45,7 +48,7 @@ from cyarray.carray import DoubleArray, IntArray, UIntArray
from warnings import warn

# Local imports
import zoltan_utils
from . import zoltan_utils

def get_zoltan_id_type_max():
if ZOLTAN_UNSIGNED_INT:
Expand Down Expand Up @@ -102,7 +105,7 @@ cdef int get_number_of_objects(void* data, int* ierr):

cdef void get_obj_list(void* data, int sizeGID, int sizeLID,
ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
int wgt_dim, float* obj_wts, int* ierr):
int wgt_dim, float* obj_wts, int* ierr) noexcept:
"""Return the local and global ids of the objects.

Methods: RCB, RIB, HSFC
Expand Down Expand Up @@ -133,7 +136,7 @@ cdef int get_num_geom(void* data, int* ierr):

cdef void get_geometry_list(void* data, int sizeGID, int sizeLID, int num_obj,
ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
int num_dim, double* geom_vec, int* ierr):
int num_dim, double* geom_vec, int* ierr) noexcept:
"""Return the coordinate locations for Zoltan.

Methods: RCB, RIB, HSFC
Expand Down
3 changes: 3 additions & 0 deletions pyzoltan/core/zoltan_comm.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

import numpy as np
cimport numpy as np

Expand Down
3 changes: 3 additions & 0 deletions pyzoltan/core/zoltan_comm.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

"""Wrapper for the Zoltan Unstructured Communication Package

The Unstructured Communication utilities simplifies some common
Expand Down
3 changes: 3 additions & 0 deletions pyzoltan/core/zoltan_dd.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

"""Wrapper for the Zoltan Distributed Directory and routines"""
cimport mpi4py.MPI as mpi
if MPI4PY_V2:
Expand Down
3 changes: 3 additions & 0 deletions pyzoltan/core/zoltan_dd.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

"""Example for the Zoltan Distributed data directory"""
from pyzoltan.core.zoltan cimport _check_error

Expand Down
7 changes: 5 additions & 2 deletions pyzoltan/czoltan/czoltan.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

"""Cython Wrapper for Zoltan. """

if MPI4PY_V2:
Expand Down Expand Up @@ -152,7 +155,7 @@ cdef extern from "zoltan.h":
ctypedef int ZOLTAN_NUM_OBJ_FN(
void *data,
int *ierr
)
) except? -1

extern int Zoltan_Set_Num_Obj_Fn(
Zoltan_Struct *zz, ZOLTAN_NUM_OBJ_FN *fn_ptr, void *data_ptr)
Expand Down Expand Up @@ -217,7 +220,7 @@ cdef extern from "zoltan.h":
ctypedef int ZOLTAN_NUM_GEOM_FN(
void *data,
int *ierr
)
) except? -1

extern int Zoltan_Set_Num_Geom_Fn(
Zoltan_Struct *zz,
Expand Down
3 changes: 3 additions & 0 deletions pyzoltan/czoltan/czoltan_comm.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

"""Cython wrapper for the Zoltan unstructured communication package"""

if MPI4PY_V2:
Expand Down
2 changes: 2 additions & 0 deletions pyzoltan/czoltan/czoltan_config.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# cython: language_level=3

cdef extern from "Zoltan_config.h":

# package string
Expand Down
3 changes: 3 additions & 0 deletions pyzoltan/czoltan/czoltan_dd.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cython: language_level=3, embedsignature=True
# distutils: language=c++

"""Cython wrapper for the Zoltan Distributed Directory"""

if MPI4PY_V2:
Expand Down
2 changes: 2 additions & 0 deletions pyzoltan/czoltan/czoltan_types.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# cython: language_level=3

cdef extern from "zoltan_types.h":

# basic type used by all of Zoltan
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cyarray
Cython<3.0
Cython
setuptools>=6.0
numpy
pytest
mpi4py>=1.2
mpi4py>=1.2, <4.0
7 changes: 0 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ def get_parallel_extensions():
extra_link_args=mpi_link_args,
extra_compile_args=mpi_compile_args + extra_compile_args,
cython_compile_time_env=cython_compile_time_env,
language="c++",
define_macros=MACROS,
),

Expand All @@ -287,7 +286,6 @@ def get_parallel_extensions():
extra_link_args=mpi_link_args,
extra_compile_args=mpi_compile_args + extra_compile_args,
cython_compile_time_env=cython_compile_time_env,
language="c++",
define_macros=MACROS,
),

Expand All @@ -304,7 +302,6 @@ def get_parallel_extensions():
extra_link_args=mpi_link_args,
extra_compile_args=mpi_compile_args + extra_compile_args,
cython_compile_time_env=cython_compile_time_env,
language="c++",
define_macros=MACROS,
),
]
Expand Down Expand Up @@ -340,9 +337,6 @@ def setup_package():
exec(compile(open(module).read(), module, 'exec'), info)

# The requirements.
install_requires = [
'cyarray', 'numpy', 'Cython<3.0', 'setuptools>=6.0', 'mpi4py>=1.2'
]
tests_require = ["pytest>=3.0"]
docs_require = ["sphinx"]

Expand Down Expand Up @@ -391,7 +385,6 @@ def setup_package():
ext_modules=ext_modules,
include_package_data=True,
cmdclass=cmdclass,
install_requires=install_requires,
extras_require={
"docs": docs_require,
"tests": tests_require,
Expand Down
Loading