Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
797e665
Initial addition of numpy ndarrays to BinaryVector. New tests
caseyclements Oct 15, 2025
47fc92c
Updates changelog
caseyclements Oct 15, 2025
7882f75
Typing
caseyclements Oct 15, 2025
b7556fb
Added numpy extra to typing_run
caseyclements Oct 15, 2025
5753e3b
Adds numpy.typing.NDArray
caseyclements Oct 15, 2025
d3407d7
Adds numpy.typing.NDArray
caseyclements Oct 15, 2025
9ae90e8
Removed match/case that will have to wait.
caseyclements Oct 15, 2025
aae159f
Put guard around check involving numpy
caseyclements Oct 16, 2025
9fadf97
Moved test_vector_from_numpy to end of vector tests
caseyclements Oct 16, 2025
40120e7
Fixed link in BinaryVector docstring
caseyclements Oct 16, 2025
be06ce7
Tiny adjustment of BinaryVector docstring
caseyclements Oct 16, 2025
f03b943
Convert Assertion to Value and Type Errors
caseyclements Oct 17, 2025
3cc5041
Numpy now lazily imported. For typing, removed numpy extra. justfile …
caseyclements Oct 17, 2025
e3b894b
Added validation in as_numpy_vector
caseyclements Oct 21, 2025
0b0a50b
Merge remote-tracking branch 'origin/master' into INTPYTHON-5355-Nump…
caseyclements Oct 27, 2025
10da245
Update bson/binary.py
caseyclements Oct 27, 2025
73910ce
PYTHON-5628 - Update the link for help in the documentation (#2602)
NoahStapp Oct 27, 2025
8dec0d3
Renamed just target test-bson to test-numpy
caseyclements Oct 27, 2025
9420ec1
as_numpy_vector refactored to as_vector(return_numpy=True)
caseyclements Oct 29, 2025
b8d9719
Checkpoint - working on numpy test variants
caseyclements Nov 25, 2025
cd053fc
Explicitly assert that data in BinaryVector.as_vector(return_numpy=Tr…
caseyclements Dec 3, 2025
f494af9
Improved TypeError message.
caseyclements Dec 3, 2025
a2eb6f4
Configure evergreen: adds a new function, and 5 variants each contai…
caseyclements Dec 3, 2025
b33ed17
Sync feature with master
caseyclements Dec 3, 2025
591d12e
Fixed typo in changelog merge
caseyclements Dec 3, 2025
b46468f
Added python versions to generated test configs of test-numpy
caseyclements Dec 4, 2025
1a408cf
Adjusting task naming for selectors
caseyclements Dec 4, 2025
56f52f6
Removed pypy from test matrix of test-numpy
caseyclements Dec 4, 2025
7576780
Add pr tag just to rhel8
caseyclements Dec 4, 2025
f77ac9b
Merge remote-tracking branch 'upstream/master' into INTPYTHON-5355-Nu…
caseyclements Dec 4, 2025
150725a
Remove stale todo as we did not add a pytest marker
caseyclements Dec 4, 2025
a7d1210
Update doc/changelog.rst
Jibola Dec 5, 2025
178403d
Remove unused args from just test-numpy
caseyclements Dec 5, 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
13 changes: 13 additions & 0 deletions .evergreen/generated_configs/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,19 @@ functions:
working_dir: src
type: test

# Test numpy
test numpy:
- command: subprocess.exec
params:
binary: bash
args:
- .evergreen/just.sh
- test-numpy
working_dir: src
include_expansions_in_env:
- TOOLCHAIN_VERSION
type: test

# Upload coverage
upload coverage:
- command: ec2.assume_role
Expand Down
22 changes: 22 additions & 0 deletions .evergreen/generated_configs/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4768,6 +4768,28 @@ tasks:
- noauth
- pypy

# Test numpy tests
- name: test-numpy-python3.10
commands:
- func: test numpy
vars:
TOOLCHAIN_VERSION: "3.10"
tags:
- binary
- vector
- python-3.10
- test-numpy
- name: test-numpy-python3.14
commands:
- func: test numpy
vars:
TOOLCHAIN_VERSION: "3.14"
tags:
- binary
- vector
- python-3.14
- test-numpy

# Test standard auth tests
- name: test-standard-auth-v4.2-python3.10-auth-ssl-sharded-cluster
commands:
Expand Down
39 changes: 39 additions & 0 deletions .evergreen/generated_configs/variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -621,3 +621,42 @@ buildvariants:
- rhel87-small
expansions:
STORAGE_ENGINE: inmemory

# Test numpy tests
- name: test-numpy-rhel8
tasks:
- name: .test-numpy
display_name: Test Numpy RHEL8
run_on:
- rhel87-small
tags: [binary, vector, pr]
- name: test-numpy-macos
tasks:
- name: .test-numpy
display_name: Test Numpy macOS
run_on:
- macos-14
tags: [binary, vector]
- name: test-numpy-macos-arm64
tasks:
- name: .test-numpy
display_name: Test Numpy macOS Arm64
run_on:
- macos-14-arm64
tags: [binary, vector]
- name: test-numpy-win64
tasks:
- name: .test-numpy
display_name: Test Numpy Win64
run_on:
- windows-64-vsMulti-small
tags: [binary, vector]
- name: test-numpy-win32
tasks:
- name: .test-numpy
display_name: Test Numpy Win32
run_on:
- windows-64-vsMulti-small
expansions:
IS_WIN32: "1"
tags: [binary, vector]
39 changes: 39 additions & 0 deletions .evergreen/scripts/generate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,37 @@ def create_disable_test_commands_variants():
return [create_variant(tasks, display_name, host=host, expansions=expansions)]


def create_test_numpy_tasks():
tasks = []
for python in MIN_MAX_PYTHON:
tags = ["binary", "vector", f"python-{python}", "test-numpy"]
task_name = get_task_name("test-numpy", python=python)
test_func = FunctionCall(func="test numpy", vars=dict(TOOLCHAIN_VERSION=python))
tasks.append(EvgTask(name=task_name, tags=tags, commands=[test_func]))
return tasks


def create_test_numpy_variants() -> list[BuildVariant]:
variants = []
base_display_name = "Test Numpy"

# Test a subset on each of the other platforms.
for host_name in ("rhel8", "macos", "macos-arm64", "win64", "win32"):
tasks = [".test-numpy"]
host = HOSTS[host_name]
tags = ["binary", "vector"]
if host_name == "rhel8":
tags.append("pr")
expansions = dict()
if host_name == "win32":
expansions["IS_WIN32"] = "1"
display_name = get_variant_name(base_display_name, host)
variant = create_variant(tasks, display_name, host=host, tags=tags, expansions=expansions)
variants.append(variant)

return variants


def create_oidc_auth_variants():
variants = []
for host_name in ["ubuntu22", "macos", "win64"]:
Expand Down Expand Up @@ -1140,6 +1171,14 @@ def create_run_tests_func():
return "run tests", [setup_cmd, test_cmd]


def create_test_numpy_func():
includes = ["TOOLCHAIN_VERSION"]
test_cmd = get_subprocess_exec(
include_expansions_in_env=includes, args=[".evergreen/just.sh", "test-numpy"]
)
return "test numpy", [test_cmd]


def create_cleanup_func():
cmd = get_subprocess_exec(args=[".evergreen/scripts/cleanup.sh"])
return "cleanup", [cmd]
Expand Down
Loading
Loading