Skip to content

Commit 877dd12

Browse files
Update pybind11 and enable meta build (#6)
* Bump requirements * Enable meta build * Update stubs
1 parent 6808d19 commit 877dd12

File tree

5 files changed

+52
-49
lines changed

5 files changed

+52
-49
lines changed

requirements.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
AMULET_COMPILER_TARGET_REQUIREMENT = "==2.0"
55
AMULET_COMPILER_VERSION_REQUIREMENT = "==3.0.0"
66

7-
PYBIND11_REQUIREMENT = "==2.13.6"
7+
PYBIND11_REQUIREMENT = "==3.0.0"
88
AMULET_PYBIND11_EXTENSIONS_REQUIREMENT = "~=1.1.0.0a0"
99
AMULET_IO_REQUIREMENT = "~=1.0"
10-
AMULET_UTILS_REQUIREMENT = "~=1.1.0.0a6"
11-
AMULET_ZLIB_REQUIREMENT = "~=1.0.0.0a7"
12-
AMULET_NBT_REQUIREMENT = "~=5.0.0.0a6"
13-
AMULET_CORE_REQUIREMENT = "~=2.0.3.0a1"
10+
AMULET_UTILS_REQUIREMENT = "~=1.1.1.0a0"
11+
AMULET_ZLIB_REQUIREMENT = "~=1.0.1.0a0"
12+
AMULET_NBT_REQUIREMENT = "~=5.0.1.0a0"
13+
AMULET_CORE_REQUIREMENT = "~=2.0.4.0a0"
1414
NUMPY_REQUIREMENT = "~=2.0"
1515
PIL_REQUIREMENT = "~=11.0"
1616

src/amulet/resource_pack/__init__.pyi

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
import logging as logging
4-
53
from amulet.resource_pack._load import load_resource_pack, load_resource_pack_manager
64
from amulet.resource_pack.abc.resource_pack import BaseResourcePack
75
from amulet.resource_pack.abc.resource_pack_manager import BaseResourcePackManager
@@ -32,16 +30,11 @@ __all__ = [
3230
"java",
3331
"load_resource_pack",
3432
"load_resource_pack_manager",
35-
"logging",
3633
"mesh",
3734
"unknown_resource_pack",
3835
]
3936

4037
def _init() -> None: ...
4138

4239
__version__: str
43-
compiler_config: dict = {
44-
"pybind11_version": "2.13.6",
45-
"compiler_id": "MSVC",
46-
"compiler_version": "19.43.34808.0",
47-
}
40+
compiler_config: dict

src/amulet/resource_pack/mesh/block/__init__.pyi

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ class BlockMesh:
3434
def __init__(
3535
self,
3636
transparency: BlockMeshTransparency,
37-
textures: list[str],
37+
textures: collections.abc.Sequence[str],
3838
parts: tuple[
39-
BlockMeshPart | None,
40-
BlockMeshPart | None,
41-
BlockMeshPart | None,
42-
BlockMeshPart | None,
43-
BlockMeshPart | None,
44-
BlockMeshPart | None,
45-
BlockMeshPart | None,
39+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
40+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
41+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
42+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
43+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
44+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
45+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
4646
],
4747
) -> None: ...
48-
def rotate(self, rotx: int, roty: int) -> BlockMesh:
48+
def rotate(self, rotx: typing.SupportsInt, roty: typing.SupportsInt) -> BlockMesh:
4949
"""
5050
Rotate the mesh in the x and y axis. Accepted values are -3 to 3 which correspond to 90 degree rotations.
5151
"""
@@ -54,13 +54,13 @@ class BlockMesh:
5454
def parts(
5555
self,
5656
) -> tuple[
57-
BlockMeshPart | None,
58-
BlockMeshPart | None,
59-
BlockMeshPart | None,
60-
BlockMeshPart | None,
61-
BlockMeshPart | None,
62-
BlockMeshPart | None,
63-
BlockMeshPart | None,
57+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
58+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
59+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
60+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
61+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
62+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
63+
amulet.resource_pack.mesh.block.BlockMeshPart | None,
6464
]:
6565
"""
6666
The mesh parts that make up this mesh. The index corresponds to the value of BlockMeshCullDirection.
@@ -129,7 +129,7 @@ class BlockMeshCullDirection:
129129
def __gt__(self, other: typing.Any) -> bool: ...
130130
def __hash__(self) -> int: ...
131131
def __index__(self) -> int: ...
132-
def __init__(self, value: int) -> None: ...
132+
def __init__(self, value: typing.SupportsInt) -> None: ...
133133
def __int__(self) -> int: ...
134134
def __invert__(self) -> typing.Any: ...
135135
def __le__(self, other: typing.Any) -> bool: ...
@@ -152,7 +152,11 @@ class BlockMeshPart:
152152
A part of a block mesh for one of the culling directions.
153153
"""
154154

155-
def __init__(self, verts: list[Vertex], triangles: list[Triangle]) -> None: ...
155+
def __init__(
156+
self,
157+
verts: collections.abc.Sequence[Vertex],
158+
triangles: collections.abc.Sequence[Triangle],
159+
) -> None: ...
156160
@property
157161
def triangles(self) -> list[Triangle]:
158162
"""
@@ -195,7 +199,7 @@ class BlockMeshTransparency:
195199
def __gt__(self, other: typing.Any) -> bool: ...
196200
def __hash__(self) -> int: ...
197201
def __index__(self) -> int: ...
198-
def __init__(self, value: int) -> None: ...
202+
def __init__(self, value: typing.SupportsInt) -> None: ...
199203
def __int__(self) -> int: ...
200204
def __le__(self, other: typing.Any) -> bool: ...
201205
def __lt__(self, other: typing.Any) -> bool: ...
@@ -212,7 +216,7 @@ class FloatVec2:
212216
A 2D floating point vector
213217
"""
214218

215-
def __init__(self, x: float, y: float) -> None: ...
219+
def __init__(self, x: typing.SupportsFloat, y: typing.SupportsFloat) -> None: ...
216220
@property
217221
def x(self) -> float: ...
218222
@property
@@ -223,7 +227,9 @@ class FloatVec3:
223227
A 3D floating point vector
224228
"""
225229

226-
def __init__(self, x: float, y: float, z: float) -> None: ...
230+
def __init__(
231+
self, x: typing.SupportsFloat, y: typing.SupportsFloat, z: typing.SupportsFloat
232+
) -> None: ...
227233
@property
228234
def x(self) -> float: ...
229235
@property
@@ -238,10 +244,10 @@ class Triangle:
238244

239245
def __init__(
240246
self,
241-
vert_index_a: int,
242-
vert_index_b: int,
243-
vert_index_c: int,
244-
texture_index: int,
247+
vert_index_a: typing.SupportsInt,
248+
vert_index_b: typing.SupportsInt,
249+
vert_index_c: typing.SupportsInt,
250+
texture_index: typing.SupportsInt,
245251
) -> None: ...
246252
@property
247253
def texture_index(self) -> int: ...

tests/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ else()
1818
endif()
1919

2020
# Find dependencies
21-
find_package(pybind11 CONFIG REQUIRED)
22-
find_package(amulet_pybind11_extensions CONFIG REQUIRED)
23-
find_package(amulet_test_utils CONFIG REQUIRED)
24-
find_package(amulet_resource_pack CONFIG REQUIRED)
21+
if (NOT TARGET pybind11::module)
22+
find_package(pybind11 CONFIG REQUIRED)
23+
endif()
24+
if (NOT TARGET amulet_pybind11_extensions)
25+
find_package(amulet_pybind11_extensions CONFIG REQUIRED)
26+
endif()
27+
if (NOT TARGET amulet_test_utils)
28+
find_package(amulet_test_utils CONFIG REQUIRED)
29+
endif()
30+
if (NOT TARGET amulet_resource_pack)
31+
find_package(amulet_resource_pack CONFIG REQUIRED)
32+
endif()
2533

2634
# Find sources
2735
file(GLOB_RECURSE SOURCES LIST_DIRECTORIES false "${CMAKE_CURRENT_LIST_DIR}/*.py.cpp")
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from __future__ import annotations
22

3-
import faulthandler as faulthandler
3+
import faulthandler as _faulthandler
44

55
from . import _test_amulet_resource_pack
66

7-
__all__ = ["compiler_config", "faulthandler"]
7+
__all__ = ["compiler_config"]
88

99
def _init() -> None: ...
1010

11-
compiler_config: dict = {
12-
"pybind11_version": "2.13.6",
13-
"compiler_id": "MSVC",
14-
"compiler_version": "19.43.34808.0",
15-
}
11+
compiler_config: dict

0 commit comments

Comments
 (0)