Skip to content

Commit

Permalink
Merge pull request #351 from bashtage/update-gh-actions
Browse files Browse the repository at this point in the history
MAINT: Update CI build wheel and GH actions
  • Loading branch information
bashtage authored Jan 3, 2024
2 parents 342869b + 02f89ac commit 28cf0f6
Show file tree
Hide file tree
Showing 61 changed files with 374 additions and 357 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cron-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [cp310]
os: [ubuntu-20.04, windows-2019]
python: [cp312]
os: [ubuntu-latest, windows-latest]
env:
BUILD_COMMIT: "main"
CIBW_BUILD: ${{ matrix.python }}-*
Expand All @@ -45,7 +45,7 @@ jobs:
python-version: '3.x'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.12.2
run: python -m pip install cibuildwheel~=2.16

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse .
1 change: 0 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ trigger:

variables:
PYTHONHASHSEED: 12345678
SETUPTOOLS_USE_DISTUTILS: "stdlib"
coverage: true
RANDOMGEN_CYTHON_COVERAGE: true

Expand Down
27 changes: 22 additions & 5 deletions ci/azure/azure_template_posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ jobs:
python.version: '3.8'
python39_latest:
python.version: '3.9'
NUMPY: 1.19.0
python310_latest:
python.version: '3.10'
NUMPY: 1.21.0
python311_latest:
python.version: '3.11'
NUMPY: 1.23.0
python312_latest:
python.version: '3.12'
python38_mid_conda:
python.version: '3.8'
use.conda: true
Expand All @@ -44,16 +49,21 @@ jobs:
RANDOMGEN_DEBUG: true
test.install: true
${{ if eq(parameters.name, 'macOS') }}:
python39_latest_macos:
python.version: '3.9'
python311_macos:
python.version: '3.11'
CYTHON: 3.0.7
ARCHFLAGS: "-arch x86_64"
python312_latest_macos:
python.version: '3.12'
CYTHON: 3.0.7
ARCHFLAGS: "-arch x86_64"

maxParallel: 10

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
displayName: 'Use Python $(python.version)'

- bash: |
Expand All @@ -74,11 +84,18 @@ jobs:
isort --check randomgen
displayName: 'Check style and formatting'
- script: python -m pip list
- script: |
python -m pip install pip --upgrade
python -c "import platform;print(platform.uname())"
python -c "import numpy;print(numpy.show_runtime())"
python -m pip list
displayName: 'List Configuration (PyPI)'
condition: ne(variables['use.conda'], 'true')
- script: conda list
- script: |
python -m pip install pip --upgrade
python -c "import platform;print(platform.uname())"
conda list
displayName: 'List Configuration (conda)'
condition: eq(variables['use.conda'], 'true')
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ requires = [
"packaging>=21.0",
"setuptools",
"wheel",
"Cython>=0.29.24,<4",
"Cython>=0.29.33,<4",
"oldest-supported-numpy",
"numpy; python_version>='3.12'",
"setuptools_scm[toml]>=7.0.0,<8.0.0",
"numpy; python_version>='3.13'",
"setuptools_scm[toml]>=8.0.0,<9.0.0",
]
build-backend = "setuptools.build_meta"

Expand Down
6 changes: 3 additions & 3 deletions randomgen/aes.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ cdef extern from "src/aesctr/aesctr.h":

ctypedef AESCTR_STATE_T aesctr_state_t

uint64_t aes_next64(aesctr_state_t *aesctr) nogil
uint32_t aes_next32(aesctr_state_t *aesctr) nogil
double aes_next_double(aesctr_state_t *aesctr) nogil
uint64_t aes_next64(aesctr_state_t *aesctr) noexcept nogil
uint32_t aes_next32(aesctr_state_t *aesctr) noexcept nogil
double aes_next_double(aesctr_state_t *aesctr) noexcept nogil

int RANDOMGEN_USE_AESNI
void aesctr_use_aesni(int val)
Expand Down
6 changes: 3 additions & 3 deletions randomgen/aes.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ from randomgen.entropy import random_entropy, seed_by_array

__all__ = ["AESCounter"]

cdef uint64_t aes_uint64(void* st) nogil:
cdef uint64_t aes_uint64(void* st) noexcept nogil:
return aes_next64(<aesctr_state_t *>st)

cdef uint32_t aes_uint32(void *st) nogil:
cdef uint32_t aes_uint32(void *st) noexcept nogil:
return aes_next32(<aesctr_state_t *> st)

cdef double aes_double(void* st) nogil:
cdef double aes_double(void* st) noexcept nogil:
return uint64_to_double(aes_next64(<aesctr_state_t *>st))

cdef class AESCounter(BitGenerator):
Expand Down
2 changes: 1 addition & 1 deletion randomgen/bounded_integers.pxd.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ctypedef np.npy_bool bool_t
from randomgen.common cimport bitgen_t


cdef inline uint64_t _gen_mask(uint64_t max_val) nogil:
cdef inline uint64_t _gen_mask(uint64_t max_val) noexcept nogil:
"""Mask generator for use in bounded random numbers"""
# Smallest bit mask >= max
cdef uint64_t mask = max_val
Expand Down
6 changes: 3 additions & 3 deletions randomgen/chacha.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ cdef extern from "src/chacha/chacha.h":

ctypedef CHACHA_STATE_T chacha_state_t

uint32_t chacha_next32(chacha_state_t *state) nogil
uint64_t chacha_next64(chacha_state_t *state) nogil
double chacha_next_double(chacha_state_t *state) nogil
uint32_t chacha_next32(chacha_state_t *state) noexcept nogil
uint64_t chacha_next64(chacha_state_t *state) noexcept nogil
double chacha_next_double(chacha_state_t *state) noexcept nogil

void chacha_seed(
chacha_state_t *state,
Expand Down
6 changes: 3 additions & 3 deletions randomgen/chacha.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ from randomgen.entropy import random_entropy, seed_by_array

__all__ = ["ChaCha"]

cdef uint64_t chacha_uint64(void* st) nogil:
cdef uint64_t chacha_uint64(void* st) noexcept nogil:
return chacha_next64(<chacha_state_t *>st)

cdef uint32_t chacha_uint32(void *st) nogil:
cdef uint32_t chacha_uint32(void *st) noexcept nogil:
return chacha_next32(<chacha_state_t *> st)

cdef double chacha_double(void* st) nogil:
cdef double chacha_double(void* st) noexcept nogil:
return chacha_next_double(<chacha_state_t *>st)

cdef class ChaCha(BitGenerator):
Expand Down
38 changes: 19 additions & 19 deletions randomgen/common.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,31 @@ cdef extern from "src/aligned_malloc/aligned_malloc.h":

ctypedef double (*random_double_fill)(
bitgen_t *state, np.npy_intp count, double* out
) nogil
ctypedef double (*random_double_0)(void *state) nogil
ctypedef double (*random_double_1)(void *state, double a) nogil
ctypedef double (*random_double_2)(void *state, double a, double b) nogil
ctypedef double (*random_double_3)(void *state, double a, double b, double c) nogil
) noexcept nogil
ctypedef double (*random_double_0)(void *state) noexcept nogil
ctypedef double (*random_double_1)(void *state, double a) noexcept nogil
ctypedef double (*random_double_2)(void *state, double a, double b) noexcept nogil
ctypedef double (*random_double_3)(void *state, double a, double b, double c) noexcept nogil

ctypedef float (*random_float_0)(bitgen_t *state) nogil
ctypedef float (*random_float_1)(bitgen_t *state, float a) nogil
ctypedef float (*random_float_0)(bitgen_t *state) noexcept nogil
ctypedef float (*random_float_1)(bitgen_t *state, float a) noexcept nogil

ctypedef int64_t (*random_uint_0)(void *state) nogil
ctypedef int64_t (*random_uint_d)(void *state, double a) nogil
ctypedef int64_t (*random_uint_dd)(void *state, double a, double b) nogil
ctypedef int64_t (*random_uint_di)(void *state, double a, uint64_t b) nogil
ctypedef int64_t (*random_uint_i)(void *state, int64_t a) nogil
ctypedef int64_t (*random_uint_iii)(void *state, int64_t a, int64_t b, int64_t c) nogil
ctypedef int64_t (*random_uint_0)(void *state) noexcept nogil
ctypedef int64_t (*random_uint_d)(void *state, double a) noexcept nogil
ctypedef int64_t (*random_uint_dd)(void *state, double a, double b) noexcept nogil
ctypedef int64_t (*random_uint_di)(void *state, double a, uint64_t b) noexcept nogil
ctypedef int64_t (*random_uint_i)(void *state, int64_t a) noexcept nogil
ctypedef int64_t (*random_uint_iii)(void *state, int64_t a, int64_t b, int64_t c) noexcept nogil

ctypedef uint32_t (*random_uint_0_32)(bitgen_t *state) nogil
ctypedef uint32_t (*random_uint_1_i_32)(bitgen_t *state, uint32_t a) nogil
ctypedef uint32_t (*random_uint_0_32)(bitgen_t *state) noexcept nogil
ctypedef uint32_t (*random_uint_1_i_32)(bitgen_t *state, uint32_t a) noexcept nogil

ctypedef int32_t (*random_int_2_i_32)(bitgen_t *state, int32_t a, int32_t b) nogil
ctypedef int64_t (*random_int_2_i)(bitgen_t *state, int64_t a, int64_t b) nogil
ctypedef int32_t (*random_int_2_i_32)(bitgen_t *state, int32_t a, int32_t b) noexcept nogil
ctypedef int64_t (*random_int_2_i)(bitgen_t *state, int64_t a, int64_t b) noexcept nogil

cdef double kahan_sum(double *darr, np.npy_intp n)

cdef inline double uint64_to_double(uint64_t rnd) nogil:
cdef inline double uint64_to_double(uint64_t rnd) noexcept nogil:
return (rnd >> 11) * (1.0 / 9007199254740992.0)

cdef object double_fill(
Expand Down Expand Up @@ -174,7 +174,7 @@ cdef inline void compute_complex(double *rv_r,
double loc_i,
double var_r,
double var_i,
double rho) nogil:
double rho) noexcept nogil:
cdef double scale_c, scale_i, scale_r

scale_c = sqrt(1 - rho * rho)
Expand Down
Loading

0 comments on commit 28cf0f6

Please sign in to comment.