Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Extending the python support to 3.13 and 3.14#134

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ngoldbaum merged 17 commits intonumpy:mainfromSwayamInSync:main
Aug 27, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
fa9f977
testing builds for python 3.13 adn 3.14 for free threading support
SwayamInSyncAug 26, 2025
3cf2cc9
updating cibuildwheel
SwayamInSyncAug 26, 2025
7784703
updating python
SwayamInSyncAug 26, 2025
05f2cf1
Merge pull request #3 from SwayamInSync/python-coverage
SwayamInSyncAug 26, 2025
4c76de7
Merge branch 'main' into main
SwayamInSyncAug 26, 2025
2260c98
testing 3.13t and 3.14t on macos
SwayamInSyncAug 26, 2025
e5462e0
adding cibw
SwayamInSyncAug 26, 2025
f12ff3c
enablign cibw free-thread
SwayamInSyncAug 26, 2025
05d2d6c
enablign cibw free-thread
SwayamInSyncAug 26, 2025
0edbba3
enablign cibw free-thread
SwayamInSyncAug 26, 2025
f11b08b
adding pytest-test-parallel
SwayamInSyncAug 26, 2025
d46a8f7
edit extension
SwayamInSyncAug 26, 2025
9e28e06
checking linux
SwayamInSyncAug 26, 2025
8359f0c
Merge branch 'main' into python-coverage
SwayamInSyncAug 26, 2025
ccf066d
checking windows
SwayamInSyncAug 26, 2025
15abf93
and they all worked
SwayamInSyncAug 27, 2025
8695461
Merge pull request #4 from SwayamInSync/python-coverage
SwayamInSyncAug 27, 2025
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
48 changes: 33 additions & 15 deletions.github/workflows/build_wheels.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,19 +27,20 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ">=3.10.0"
python-version: ">=3.11.0"

- name: Verify QuadBLAS submodule
run: |
ls -la quaddtype/numpy_quaddtype/QBLAS/
ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/

- name: Install cibuildwheel
run: pip install cibuildwheel==2.20.0
run: pip install cibuildwheel==3.1.4

- name: Build wheels
env:
CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64"
CIBW_BUILD: "cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp313t-manylinux_x86_64 cp314-manylinux_x86_64 cp314t-manylinux_x86_64"
CIBW_ENABLE: cpython-prerelease cpython-freethreading
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_BUILD_VERBOSITY: "3"
CIBW_BEFORE_ALL: |
Expand All@@ -64,7 +65,11 @@ jobs:
auditwheel repair -w {dest_dir} --plat manylinux_2_28_x86_64 {wheel}
CIBW_TEST_COMMAND: |
pip install {package}[test]
pytest -s {project}/tests
if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
pytest --parallel-threads=10 --iterations=10 {project}/tests
else
pytest -s {project}/tests
fi
CIBW_TEST_EXTRAS: "test"
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand All@@ -90,7 +95,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: ">=3.11.0"

- name: Install dependencies
run: |
Expand All@@ -117,12 +122,16 @@ jobs:
ls -la quaddtype/numpy_quaddtype/QBLAS/
ls -la quaddtype/numpy_quaddtype/QBLAS/include/quadblas/

- name: Install cibuildwheel
run: pip install cibuildwheel==2.20.0
- name: Installing Python dependencies
run: |
pip install -U pip
pip install cibuildwheel==3.1.4
pip install pytest-run-parallel

- name: Build wheels
env:
CIBW_BUILD: "cp310-* cp311-* cp312-*"
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
CIBW_ENABLE: cpython-prerelease cpython-freethreading
CIBW_ARCHS_MACOS: ${{ matrix.os == 'macos-13' && 'x86_64' || 'arm64' }}
CIBW_BUILD_VERBOSITY: "3"
CIBW_ENVIRONMENT: >
Expand All@@ -136,7 +145,11 @@ jobs:
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_TEST_COMMAND: |
pip install {package}[test]
pytest -s {project}/tests
if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
pytest --parallel-threads=10 --iterations=10 {project}/tests
else
pytest -s {project}/tests
fi
CIBW_TEST_EXTRAS: "test"
run: |
python -m cibuildwheel --output-dir wheelhouse
Expand DownExpand Up@@ -165,10 +178,10 @@ jobs:
with:
arch: ${{ matrix.architecture }}

- name: Set up Python 3.10
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: ">=3.11.0"
architecture: ${{ matrix.architecture }}

- name: Install CMake
Expand All@@ -193,12 +206,13 @@ jobs:
shell: bash -l {0}
run: |
pip install -U pip
pip install cibuildwheel==2.20.0 ninja meson meson-python numpy delvewheel pytest
pip install cibuildwheel==3.1.4 ninja meson meson-python numpy delvewheel pytest

- name: Build wheels
env:
CIBW_BUILD: "cp310-* cp311-* cp312-*"
CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-* cp313-*"
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-* cp313t-* cp314t-*"
CIBW_ENABLE: cpython-prerelease cpython-freethreading
CIBW_SKIP: "pp* cp36-* cp37-* cp38-* cp39-*"
CIBW_ARCHS_WINDOWS: ${{ matrix.architecture == 'x86' && 'x86' || 'AMD64' }}
CIBW_BUILD_VERBOSITY: "3"
DISTUTILS_USE_SDK: "1"
Expand All@@ -215,7 +229,11 @@ jobs:
CIBW_REPAIR_WHEEL_COMMAND: 'delvewheel repair -w {dest_dir} {wheel} --add-path C:\sleef\bin'
CIBW_TEST_COMMAND: |
pip install {package}[test]
pytest -s {project}/tests
if python -c "import sys; exit(0 if hasattr(sys, '_is_gil_enabled') and not sys._is_gil_enabled() else 1)"; then
pytest --parallel-threads=10 --iterations=10 {project}/tests
else
pytest -s {project}/tests
fi
CIBW_TEST_EXTRAS: test
CIBW_TEST_FAIL_FAST: 1
shell: pwsh
Expand Down
20 changes: 15 additions & 5 deletionsquaddtype/numpy_quaddtype/src/quaddtype_main.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -80,14 +80,17 @@ get_sleef_constant(PyObject *self, PyObject *args)
else if (strcmp(constant_name, "precision") == 0) {
Py_DECREF(result);
// precision = int(-log10(epsilon))
int64_t precision = Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
int64_t precision =
Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
return PyLong_FromLong(precision);
}
else if (strcmp(constant_name, "resolution") == 0) {
// precision = int(-log10(epsilon))
int64_t precision = Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
int64_t precision =
Sleef_cast_to_int64q1(Sleef_negq1(Sleef_log10q1_u10(SLEEF_QUAD_EPSILON)));
// resolution = 10 ** (-precision)
result->value.sleef_value = Sleef_powq1_u10(Sleef_cast_from_int64q1(10), Sleef_cast_from_int64q1(-precision));
result->value.sleef_value =
Sleef_powq1_u10(Sleef_cast_from_int64q1(10), Sleef_cast_from_int64q1(-precision));
}
else {
PyErr_SetString(PyExc_ValueError, "Unknown constant name");
Expand All@@ -109,9 +112,12 @@ static PyMethodDef module_methods[] = {
{NULL, NULL, 0, NULL}};

static struct PyModuleDef moduledef = {
PyModuleDef_HEAD_INIT, .m_name = "_quaddtype_main",
PyModuleDef_HEAD_INIT,
.m_name = "_quaddtype_main",
.m_doc = "Quad (128-bit) floating point Data Type for NumPy with multiple backends",
.m_size = -1, .m_methods = module_methods};
.m_size = -1,
.m_methods = module_methods,
};

PyMODINIT_FUNC
PyInit__quaddtype_main(void)
Expand All@@ -123,6 +129,10 @@ PyInit__quaddtype_main(void)
return NULL;
}

#ifdef Py_GIL_DISABLED
PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);
#endif

if (init_quadprecision_scalar() < 0)
goto error;

Expand Down
1 change: 1 addition & 0 deletionsquaddtype/pyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,4 +21,5 @@ dependencies = [
[project.optional-dependencies]
test = [
"pytest",
"pytest-run-parallel"
]
Loading

[8]ページ先頭

©2009-2025 Movatter.jp