Skip to content

Commit

Permalink
Merge pull request #104 from ngoldbaum/free-threading-support
Browse files Browse the repository at this point in the history
Declare free-threading support
  • Loading branch information
Julian authored Nov 20, 2024
2 parents 2597aa4 + 76f1cfc commit da3241f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def tests(session):
stdout=summary,
)
else:
session.run("pytest", *session.posargs, TESTS)
session.run("pytest", "--parallel-threads=10", *session.posargs, TESTS)


@session()
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ impl QueuePy {
}
}

#[pymodule]
#[pymodule(gil_used = false)]
#[pyo3(name = "rpds")]
fn rpds_py(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<HashTrieMapPy>()?;
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
file:.#egg=rpds-py
pytest
pytest-run-parallel
6 changes: 5 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# This file was autogenerated by uv via the following command:
# uv pip compile --output-file /Users/julian/Development/rpds.py/tests/requirements.txt tests/requirements.in
# uv pip compile --output-file tests/requirements.txt tests/requirements.in
iniconfig==2.0.0
# via pytest
packaging==24.1
# via pytest
pluggy==1.5.0
# via pytest
pytest==8.3.3
# via
# -r tests/requirements.in
# pytest-run-parallel
pytest-run-parallel==0.2.0
# via -r tests/requirements.in
file:.#egg=rpds-py
# via -r tests/requirements.in
11 changes: 11 additions & 0 deletions tests/test_hash_trie_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@
from collections import abc
from operator import methodcaller
import pickle
import sysconfig

import pytest

from rpds import HashTrieMap

# see https://github.com/python/cpython/issues/127065,
# remove this when the CPython bug is fixed in a released version
if bool(sysconfig.get_config_var("Py_GIL_DISABLED")):

def methodcaller(name, /, *args, **kwargs):
def caller(obj):
return getattr(obj, name)(*args, **kwargs)

return caller


def test_instance_of_hashable():
assert isinstance(HashTrieMap(), abc.Hashable)
Expand Down

0 comments on commit da3241f

Please sign in to comment.