Skip to content

Instantly share code, notes, and snippets.

View ngoldbaum's full-sized avatar

Nathan Goldbaum ngoldbaum

View GitHub Profile
nathan at rous in ~/Documents/cffi on mutable-constructed-flag
± docker pull ghcr.io/nascheme/cpython-tsan:3.14t-dev
3.14t-dev: Pulling from nascheme/cpython-tsan
1b3c8f62d074: Already exists
ee318dffd4e2: Pull complete
fce90371e84d: Pull complete
9d1e6b236045: Pull complete
Digest: sha256:7ca5d22b1e3572645269d498480f99c0fa586511b868f451ced5b374c1cbda38
Status: Downloaded newer image for ghcr.io/nascheme/cpython-tsan:3.14t-dev
ghcr.io/nascheme/cpython-tsan:3.14t-dev
import time
import threading
import multiprocessing
import numpy as np
import sys
import os
import argparse
import matplotlib.pyplot as plt
diff --git a/setup.py b/setup.py
index 4029e9e..c855180 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,9 @@ import os
import sys
from setuptools import Extension, setup
+from Cython.Build import cythonize
+from Cython.Compiler.Version import version as cython_version
#define _CFFI_NO_LIMITED_API
#define _CFFI_
/* We try to define Py_LIMITED_API before including Python.h.
Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and
Py_REF_DEBUG are not defined. This is a best-effort approximation:
we can learn about Py_DEBUG from pyconfig.h, but it is unclear if
the same works for the other two macros. Py_DEBUG implies them,
but not the other way around.
goldbaum at Nathans-MBP in ~/Documents/pyo3 on fix-freelist
± nox -s tests
python(51961,0x1f8d0c840) malloc: nano zone abandoned due to inability to reserve vm space.
nox > Error while collecting sessions.
nox > Sessions not found: tests
goldbaum at Nathans-MBP in ~/Documents/pyo3 on fix-freelist
± nox -s test
python(52493,0x1f8d0c840) malloc: nano zone abandoned due to inability to reserve vm space.
nox > Running session test
Checking cryptography-rust v0.1.0 (/Users/goldbaum/Documents/cryptography/src/rust)
warning: use of deprecated trait `pyo3::ToPyObject`: `ToPyObject` is going to be replaced by `IntoPyObject`. See the migration guide (https://pyo3.rs/v0.23/migration) for more information.
--> src/rust/src/asn1.rs:9:11
|
9 | use pyo3::ToPyObject;
| ^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated type alias `pyo3::types::PyLong`: use `PyInt` instead
diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs
index a473f888..e57204f2 100644
--- a/pyo3-build-config/src/impl_.rs
+++ b/pyo3-build-config/src/impl_.rs
@@ -386,13 +386,7 @@ print("gil_disabled", get_config_var("Py_GIL_DISABLED"))
};
let lib_dir = get_key!(sysconfigdata, "LIBDIR").ok().map(str::to_string);
let gil_disabled = match sysconfigdata.get_value("Py_GIL_DISABLED") {
- Some(value) => {
- if value == "1" {
Fatal Python error: PyInterpreterState_Get: the function must be called with the GIL held, after Python initialization and before Python finalization, but the GIL is released (the current Python thread state is NULL)
Python runtime state: unknown
diff --git a/pyo3-macros-backend/src/pyclass.rs b/pyo3-macros-backend/src/pyclass.rs
index 96bfbb9e..ae3082e3 100644
--- a/pyo3-macros-backend/src/pyclass.rs
+++ b/pyo3-macros-backend/src/pyclass.rs
@@ -2317,7 +2317,7 @@ impl<'a> PyClassImplsBuilder<'a> {
cls.span() =>
const _: () = {
use #pyo3_path::impl_::pyclass::*;
- assert_pyclass_sync::<#cls, { IsSync::<#cls>::VALUE }>();
+ assert_pyclass_sync::<#cls>();
pub fn with_critical_section<F, R>(object: &Bound<'_, PyAny>, f: F) -> R
where
F: FnOnce() -> R,
{
#[cfg(Py_GIL_DISABLED)]
{
struct Guard(crate::ffi::PyCriticalSection);
impl Drop for Guard {
fn drop(&mut self) {