Skip to content

Commit 9a45423

Browse files
authored
Merge pull request #74 from BerkeleyAutomation/remove/arm
Enable MacOS ARM Runner And Wheels
2 parents c1e2cdb + 4fefe83 commit 9a45423

File tree

8 files changed

+123
-97
lines changed

8 files changed

+123
-97
lines changed

.github/workflows/push.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,23 @@ jobs:
1212
- name: Set up Python environment
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: 3.9
16-
- name: flake8
17-
uses: py-actions/flake8@v2
18-
- name: black
19-
uses: psf/black@stable
20-
with:
21-
options: '--check --diff -l 90'
15+
python-version: "3.10"
16+
- name: ruff
17+
run: |
18+
pip install ruff
19+
ruff .
2220
2321
build_wheels:
2422
name: Build wheel on ${{matrix.platform}}
2523
runs-on: ${{matrix.platform}}
2624
strategy:
2725
fail-fast: false
2826
matrix:
29-
platform: [ubuntu-latest, macos-latest, windows-latest]
27+
platform: [ubuntu-latest, macos-latest, windows-latest, macos-14]
3028
steps:
3129
- uses: actions/checkout@v3
3230
- name: Build wheels
33-
uses: pypa/cibuildwheel@v2.15.0
34-
env:
35-
CIBW_ARCHS_MACOS: 'x86_64 arm64'
31+
uses: pypa/cibuildwheel@v2.16.5
3632
- uses: actions/upload-artifact@v3
3733
with:
3834
path: ./wheelhouse/*.whl

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ jobs:
4444
needs: create_release
4545
strategy:
4646
matrix:
47-
platform: [ubuntu-latest, macos-latest, windows-latest]
47+
platform: [ubuntu-latest, macos-latest, windows-latest, macos-14]
4848
steps:
4949
- uses: actions/checkout@v3
5050
- name: Build wheels
51-
uses: pypa/cibuildwheel@v2.15.0
51+
uses: pypa/cibuildwheel@v2.16.5
5252
env:
5353
CIBW_ARCHS_MACOS: 'x86_64 arm64'
5454
- uses: actions/upload-artifact@v3

examples/example.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
import numpy as np
2-
31
import fcl
2+
import numpy as np
43

54

65
def print_collision_result(o1_name, o2_name, result):
7-
print("Collision between {} and {}:".format(o1_name, o2_name))
6+
print(f"Collision between {o1_name} and {o2_name}:")
87
print("-" * 30)
9-
print("Collision?: {}".format(result.is_collision))
10-
print("Number of contacts: {}".format(len(result.contacts)))
8+
print(f"Collision?: {result.is_collision}")
9+
print(f"Number of contacts: {len(result.contacts)}")
1110
print("")
1211

1312

1413
def print_continuous_collision_result(o1_name, o2_name, result):
15-
print("Continuous collision between {} and {}:".format(o1_name, o2_name))
14+
print(f"Continuous collision between {o1_name} and {o2_name}:")
1615
print("-" * 30)
17-
print("Collision?: {}".format(result.is_collide))
18-
print("Time of collision: {}".format(result.time_of_contact))
16+
print(f"Collision?: {result.is_collide}")
17+
print(f"Time of collision: {result.time_of_contact}")
1918
print("")
2019

2120

2221
def print_distance_result(o1_name, o2_name, result):
23-
print("Distance between {} and {}:".format(o1_name, o2_name))
22+
print(f"Distance between {o1_name} and {o2_name}:")
2423
print("-" * 30)
25-
print("Distance: {}".format(result.min_distance))
24+
print(f"Distance: {result.min_distance}")
2625
print("Closest Points:")
2726
print(result.nearest_points[0])
2827
print(result.nearest_points[1])
@@ -166,25 +165,25 @@ def print_distance_result(o1_name, o2_name, result):
166165
# =====================================================================
167166
cdata = fcl.CollisionData()
168167
manager1.collide(cdata, fcl.defaultCollisionCallback)
169-
print("Collision within manager 1?: {}".format(cdata.result.is_collision))
168+
print(f"Collision within manager 1?: {cdata.result.is_collision}")
170169
print("")
171170

172171
cdata = fcl.CollisionData()
173172
manager2.collide(cdata, fcl.defaultCollisionCallback)
174-
print("Collision within manager 2?: {}".format(cdata.result.is_collision))
173+
print(f"Collision within manager 2?: {cdata.result.is_collision}")
175174
print("")
176175

177176
# =====================================================================
178177
# Managed internal (n^2) distance checking
179178
# =====================================================================
180179
ddata = fcl.DistanceData()
181180
manager1.distance(ddata, fcl.defaultDistanceCallback)
182-
print("Closest distance within manager 1?: {}".format(ddata.result.min_distance))
181+
print(f"Closest distance within manager 1?: {ddata.result.min_distance}")
183182
print("")
184183

185184
ddata = fcl.DistanceData()
186185
manager2.distance(ddata, fcl.defaultDistanceCallback)
187-
print("Closest distance within manager 2?: {}".format(ddata.result.min_distance))
186+
print(f"Closest distance within manager 2?: {ddata.result.min_distance}")
188187
print("")
189188

190189
# =====================================================================
@@ -194,19 +193,19 @@ def print_distance_result(o1_name, o2_name, result):
194193
rdata = fcl.CollisionData(request=req)
195194

196195
manager1.collide(fcl.CollisionObject(mesh), rdata, fcl.defaultCollisionCallback)
197-
print("Collision between manager 1 and Mesh?: {}".format(rdata.result.is_collision))
196+
print(f"Collision between manager 1 and Mesh?: {rdata.result.is_collision}")
198197
print("Contacts:")
199198
for c in rdata.result.contacts:
200-
print("\tO1: {}, O2: {}".format(c.o1, c.o2))
199+
print(f"\tO1: {c.o1}, O2: {c.o2}")
201200
print("")
202201

203202
# =====================================================================
204203
# Managed many to many collision checking
205204
# =====================================================================
206205
rdata = fcl.CollisionData(request=req)
207206
manager3.collide(manager2, rdata, fcl.defaultCollisionCallback)
208-
print("Collision between manager 2 and manager 3?: {}".format(rdata.result.is_collision))
207+
print(f"Collision between manager 2 and manager 3?: {rdata.result.is_collision}")
209208
print("Contacts:")
210209
for c in rdata.result.contacts:
211-
print("\tO1: {}, O2: {}".format(c.o1, c.o2))
210+
print(f"\tO1: {c.o1}, O2: {c.o2}")
212211
print("")

pyproject.toml

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,99 @@ requires = [
33
"setuptools",
44
"wheel",
55
"Cython<3.0",
6-
"oldest-supported-numpy; python_version<'3.12'",
6+
"numpy; python_version<'3.12'",
77
"numpy>=1.26.0b1; python_version>='3.12'"]
88
build-backend = "setuptools.build_meta"
99

10+
[project]
11+
name = "python-fcl"
12+
description = "Python bindings for the Flexible Collision Library"
13+
requires-python = ">=3.7"
14+
authors = [
15+
{name = "Jelle Feringa", email = "jelleferinga@gmail.com"},
16+
{name = "Matthew Matl", email = "mmatl@eecs.berkeley.edu"},
17+
{name = "Shirokuma", email = "rootstock_acg@yahoo.co.jp"},
18+
{name = "Michael Dawson-Haggerty"},
19+
{name = "See contributor list"},
20+
]
21+
maintainers = [{name = "Matthew Matl", email = "mmatl@eecs.berkeley.edu"}]
22+
license = {text = "BSD"}
23+
classifiers = [
24+
"Development Status :: 3 - Alpha",
25+
"License :: OSI Approved :: BSD License",
26+
"Operating System :: POSIX :: Linux",
27+
"Operating System :: MacOS",
28+
"Operating System :: Microsoft :: Windows",
29+
"Programming Language :: Python :: 3",
30+
"Programming Language :: Python :: 3.7",
31+
"Programming Language :: Python :: 3.8",
32+
"Programming Language :: Python :: 3.9",
33+
"Programming Language :: Python :: 3.10",
34+
"Programming Language :: Python :: 3.11",
35+
"Programming Language :: Python :: 3.12",
36+
"Programming Language :: Python :: Implementation :: CPython",
37+
]
38+
keywords = ["fcl collision distance"]
39+
dependencies = [
40+
"numpy; python_version<'3.12'",
41+
"numpy>=1.26.0b1; python_version>='3.12'",
42+
"Cython",
43+
]
44+
dynamic = ["version"]
45+
46+
[project.readme]
47+
file = "README.md"
48+
content-type = "text/markdown"
49+
50+
[project.urls]
51+
Homepage = "https://github.com/berkeleyautomation/python-fcl"
52+
53+
54+
55+
56+
[tool.setuptools]
57+
include-package-data = true
58+
package-dir = {"" = "src"}
59+
license-files = ["LICENSE"]
60+
61+
[tool.setuptools.package-data]
62+
"*" = ["*.pyx", "*.pxd", "*.dll"]
63+
64+
[tool.setuptools.packages.find]
65+
where = ["src"]
66+
namespaces = false
67+
68+
[tool.setuptools.dynamic]
69+
version = {attr = "fcl.__version__"}
70+
71+
[tool.ruff]
72+
target-version = "py37"
73+
line-length = 90
74+
75+
[tool.ruff.lint]
76+
# See https://github.com/charliermarsh/ruff#rules for error code definitions.
77+
select = [
78+
"B", # bugbear
79+
"C", # comprehensions
80+
"E", # style errors
81+
"F", # flakes
82+
"I", # import sorting
83+
"RUF100", # meta
84+
"U", # upgrade
85+
"W", # style warnings
86+
"YTT", # sys.version
87+
]
88+
89+
ignore = [
90+
"C901", # Comprehension is too complex (11 > 10)
91+
"N802", # Function name should be lowercase
92+
"N806", # Variable in function should be lowercase
93+
"E501", # Line too long ({width} > {limit} characters)
94+
"B904", # raise ... from err
95+
"B905", # zip() without an explicit strict= parameter
96+
]
97+
98+
1099
[tool.cibuildwheel]
11100
skip = ["pp*", "*musllinux*"]
12101
test-requires = "pytest"
@@ -18,7 +107,9 @@ archs = ["x86_64"]
18107

19108
[tool.cibuildwheel.macos]
20109
before-all = "bash build_dependencies/install_macos.sh"
110+
environment = { CPATH = "$(brew --prefix)/include:$(brew --prefix)/include/eigen3", LD_LIBRARY_PATH = "$(brew --prefix)/lib" }
21111

22112
[tool.cibuildwheel.windows]
23113
before-all = "powershell build_dependencies\\install_windows.ps1"
24-
archs = ["AMD64"]
114+
archs = ["AMD64"]
115+

setup.cfg

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/fcl/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.7.0.5"
1+
__version__ = "0.7.0.6"

tests/test_fcl.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import unittest
22

3-
import numpy as np
4-
53
import fcl
4+
import numpy as np
65

76

87
class TestFCL(unittest.TestCase):
@@ -206,7 +205,7 @@ def test_pairwise_continuous_collisions(self):
206205
self.geometry["cone"], fcl.Transform(np.array([0.0, 0.0, -2.0]))
207206
)
208207

209-
ret = fcl.continuousCollide(
208+
_ret = fcl.continuousCollide(
210209
box, fcl.Transform(), cone, fcl.Transform(), request, result
211210
)
212211

tests/test_precision.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import unittest
22

3-
import numpy as np
4-
53
import fcl
4+
import numpy as np
65

76

87
# These test cases were added because there was a very sneaky crash that would occur

0 commit comments

Comments
 (0)