Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle Asio + Apple silicon support #110

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 8 additions & 6 deletions .github/workflows/main_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ jobs:
include:
- image: ubuntu-latest
platform: linux
- image: macos-latest
platform: macos
- image: macos-13
platform: macos-intel
- image: macos-14
platform: macos-arm
- image: windows-latest
platform: windows

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -36,7 +38,7 @@ jobs:
key: conan-${{ matrix.image }}-${{ hashFiles('conanfile.txt') }}

- name: Configure Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
if: matrix.platform == 'windows' && steps.cache-conan.outputs.cache-hit != 'true'
with:
python-version: '3.x'
Expand All @@ -52,10 +54,10 @@ jobs:
conan config set "storage.path=$env:GITHUB_WORKSPACE/conan_data"
conan install --build=openssl --install-folder conan_build .

- uses: pypa/cibuildwheel@v2.15.0
- uses: pypa/cibuildwheel@v2.19.1
env:
MACOSX_DEPLOYMENT_TARGET: 10.14
CIBW_BUILD: '*cp37*'
CIBW_BUILD: '*cp311*'

- name: Verify clean directory
run: git diff --exit-code
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.11"

- name: "Install system dependencies"
run: sudo apt update -y && sudo apt install -y libssl-dev libasio-dev
Expand All @@ -40,15 +40,15 @@ jobs:
run: make test

- name: "Upload python coverage"
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.codecov_token }}
files: 'coverage/coverage.xml'
flags: python
fail_ci_if_error: true

- name: "Upload binding coverage"
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.codecov_token }}
files: 'coverage/*.gcov'
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist
Expand All @@ -33,13 +33,15 @@ jobs:
include:
- image: ubuntu-latest
platform: linux
- image: macos-latest
platform: macos
- image: macos-13
platform: macos-intel
- image: macos-14
platform: macos-arm
- image: windows-latest
platform: windows

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -54,7 +56,7 @@ jobs:
key: conan-${{ matrix.image }}-${{ hashFiles('conanfile.txt') }}

- name: Configure Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
if: matrix.platform == 'windows' && steps.cache-conan.outputs.cache-hit != 'true'
with:
python-version: '3.x'
Expand All @@ -70,7 +72,7 @@ jobs:
conan config set "storage.path=$env:GITHUB_WORKSPACE/conan_data"
conan install --build=openssl --install-folder conan_build .

- uses: pypa/cibuildwheel@v2.16.5
- uses: pypa/cibuildwheel@v2.19.1
env:
MACOSX_DEPLOYMENT_TARGET: 10.14

Expand All @@ -89,7 +91,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v5

- uses: actions/download-artifact@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Usage with a routing engine

>>> sol = problem_instance.solve(exploration_level=5, nb_threads=4)
>>> print(sol.summary.duration)
2704
2714

Installation
------------
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ apk add asio-dev
apk add openssl-dev
"""


[tool.cibuildwheel.macos]

before-all = """
brew install openssl
brew install asio
"""
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import platform
from subprocess import run
from pathlib import Path
from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension, build_ext
Expand All @@ -10,7 +11,7 @@
"src",
os.path.join("vroom", "src"),
os.path.join("vroom", "include"),
os.path.join("vroom", "include", "cxxopts", "include")
os.path.join("vroom", "include", "cxxopts", "include"),
]
libraries = []
library_dirs = []
Expand Down Expand Up @@ -47,8 +48,10 @@

if platform.system() == "Darwin":
# Homebrew puts include folders in weird places.
include_dirs.append("/usr/local/opt/openssl@1.1/include")
extra_link_args.insert(0, "-L/usr/local/opt/openssl@1.1/lib")
prefix = run(["brew", "--prefix"], capture_output=True).stdout.decode("utf-8")[:-1]
include_dirs.append(f"{prefix}/include")
extra_link_args.insert(0, f"-L{prefix}/lib")
assert 0, (prefix, include_dirs, extra_link_args)

# try conan dependency resolution
conanfile = tuple(Path(__file__).parent.resolve().rglob("conanbuildinfo.json"))
Expand Down
2 changes: 1 addition & 1 deletion src/vroom/break_.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,5 @@ def __repr__(self) -> str:
if self.description:
args.append(f"description={self.description!r}")
if self.max_load:
args.append(f"max_load={list(numpy.asarray(self.max_load))}")
args.append(f"max_load={[int(load) for load in numpy.asarray(self.max_load)]}")
return f"vroom.{self.__class__.__name__}({', '.join(args)})"
Loading