Skip to content

Commit 0310f86

Browse files
Tweak dependencies for Blender 5.1 (#69)
* tweak for Blender 5.1 * bump blender version for tests * allow dailybpy for resolution * fix but should still faile * report failures properly * Update test-in-blender.yml
1 parent 8bc819b commit 0310f86

File tree

7 files changed

+254
-267
lines changed

7 files changed

+254
-267
lines changed
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
name: Run Tests in Blender
22

3-
on:
4-
push:
5-
branches: ["main"]
6-
pull_request:
7-
branches: ["*"]
8-
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["*"]
8+
99
jobs:
10-
build:
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
max-parallel: 4
14-
fail-fast: false
15-
matrix:
16-
version: ["4.5", "5.0", "daily"]
17-
os: [macos-14, ubuntu-latest, windows-latest]
18-
steps:
19-
- uses: actions/checkout@v4
20-
- uses: BradyAJohnston/setup-blender@v5
21-
with:
22-
version: ${{ matrix.version }}
23-
- name: Install and Test
24-
run: |
25-
blender -b -P tests/python.py -- -m pip install -e ".[test]"
26-
blender -b -P tests/run.py -- -vv
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
max-parallel: 4
14+
fail-fast: false
15+
matrix:
16+
version: ["5.1", "5.2", "daily"]
17+
os: [macos-14, ubuntu-latest, windows-latest]
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: BradyAJohnston/setup-blender@v5
21+
with:
22+
version: ${{ matrix.version }}
23+
- name: Install and Test
24+
run: |
25+
blender -b -P tests/python.py -- -m pip install -e ".[dev]"
26+
blender -b -P tests/run.py -- -vv

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
max-parallel: 4
1414
fail-fast: false
1515
matrix:
16-
version: ["4.5", "5.0"]
16+
version: ["5.1", "5.2"]
1717
os: [macos-latest, windows-latest, ubuntu-latest]
1818
steps:
1919
- uses: actions/checkout@v4
@@ -34,11 +34,11 @@ jobs:
3434
3535
- name: Upload coverage reports to Codecov
3636
uses: codecov/codecov-action@v5
37-
if: matrix.os == 'macos-latest' && matrix.version == '5.0'
37+
if: matrix.os == 'macos-latest' && matrix.version == '5.1'
3838
with:
3939
token: ${{ secrets.CODECOV_TOKEN }}
4040
name: coverage.xml
4141

4242
- name: Upload coverage reports to Codecov
43-
if: matrix.os == 'macos-latest' && matrix.version == '5.0'
43+
if: matrix.os == 'macos-latest' && matrix.version == '5.1'
4444
uses: codecov/codecov-action@v3

pyproject.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
name = "databpy"
3-
version = "0.6.2"
3+
version = "0.7.0"
44
description = "A data-oriented wrapper library for the Blender Python API"
55
readme = "README.md"
66
dependencies = [
7-
"numpy>=1.24.0,<2.0",
7+
"numpy",
88
]
9-
requires-python = "~=3.11.0"
9+
requires-python = "~=3.13.0"
1010
keywords = ["blender", "python", "numpy"]
1111
maintainers = [
1212
{name="Brady Johnston", email="brady.johnston@me.com"},
@@ -18,7 +18,7 @@ Repository = "https://github.com/bradyajohnston/databpy"
1818
Documentation = "https://bradyajohnston.github.io/databpy"
1919

2020
[project.optional-dependencies]
21-
bpy = ["bpy>=4.5"]
21+
bpy = ["bpy>=5.1"]
2222
dev = [
2323
"fake-bpy-module",
2424
"polars",
@@ -38,6 +38,10 @@ members = [
3838
[tool.uv.sources]
3939
databpy = { workspace = true }
4040

41+
[[tool.uv.index]]
42+
name="dailybpy"
43+
url = "https://bradyajohnston.github.io/dailybpy/"
44+
4145
[dependency-groups]
4246
dev = [
4347
"databpy",

tests/python.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1+
import os
12
import subprocess
23
import sys
3-
import os
4-
5-
argv = sys.argv
6-
argv = argv[argv.index("--") + 1 :]
74

85

96
def main():
7+
argv = sys.argv
8+
argv = argv[argv.index("--") + 1 :]
109
python = os.path.realpath(sys.executable)
11-
subprocess.run([python] + argv)
10+
run = subprocess.run([python] + argv)
11+
if run.returncode != 0:
12+
print(f"Error: {run.returncode}")
13+
sys.exit(run.returncode)
1214

1315

1416
if __name__ == "__main__":
15-
main()
17+
try:
18+
main()
19+
except Exception as e:
20+
print(f"Error: {e}")
21+
sys.exit(1)

tests/run.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import pytest
21
import sys
32

43
argv = sys.argv
@@ -11,6 +10,12 @@
1110

1211

1312
def main():
13+
try:
14+
import pytest
15+
except ModuleNotFoundError as e:
16+
print(f"Error: {e}")
17+
sys.exit(1)
18+
1419
# run the test suite, and we have to manually return the result value if non-zero
1520
# value is returned for a failing test
1621
if len(argv) == 0:

tests/test_attribute.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import pytest
2-
import numpy as np
1+
import itertools
2+
33
import bpy
4+
import numpy as np
5+
import pytest
6+
47
import databpy as db
5-
import itertools
68

79

810
def test_attribute_properties():
@@ -239,7 +241,7 @@ def test_named_attribute_name():
239241
name = "a" * i
240242
print(f"{i} letters, name: '{name}'")
241243
data = np.random.rand(len(obj.data.vertices), 3)
242-
if i >= 68 or i == 0:
244+
if i == 0:
243245
with pytest.raises(db.NamedAttributeError):
244246
db.store_named_attribute(obj, data, name)
245247
else:

0 commit comments

Comments
 (0)