Skip to content

Commit

Permalink
Merge branch 'main' into upstream-v1.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SebMilardo authored Jul 1, 2024
2 parents 6578859 + da2c48d commit 818a6dd
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 34 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/main_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ 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

Expand Down Expand Up @@ -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: '*cp39*'

- name: Verify clean directory
run: git diff --exit-code
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

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

- name: "Install system dependencies"
run: sudo apt update -y && sudo apt install -y libssl-dev libasio-dev
Expand Down
41 changes: 22 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ 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

Expand All @@ -60,7 +62,7 @@ jobs:
python-version: '3.x'

- name: Install Conan
if: matrix.image == 'windows-latest' && steps.cache-conan.outputs.cache-hit != 'true'
if: matrix.platform == 'windows' && steps.cache-conan.outputs.cache-hit != 'true'
run: |
pip install pip --upgrade
pip install conan<2.0.0
Expand All @@ -70,23 +72,24 @@ jobs:
conan config set "storage.path=$env:GITHUB_WORKSPACE/conan_data"
conan install --build=openssl --install-folder conan_build .
- name: Install llvm@18 and link asio on macOS
if: matrix.platform == 'macos'
run: |
brew install llvm@18
echo "$(brew --prefix)/opt/llvm/bin" >> $GITHUB_PATH
echo "LDFLAGS=-L$(brew --prefix)/opt/llvm/lib -L$(brew --prefix)/opt/llvm/lib/c++ -L/opt/homebrew/lib -Wl,-rpath,$(brew --prefix)/opt/llvm/lib/c++" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I$(brew --prefix)/opt/llvm/include -I/opt/homebrew/include -fexperimental-library" >> "$GITHUB_ENV"
echo "CC=clang" >> "$GITHUB_ENV"
echo "CXX=clang++" >> "$GITHUB_ENV"
echo "OBJC=clang" >> "$GITHUB_ENV"
echo "CC_LD=lld" >> "$GITHUB_ENV"
echo "CXX_LD=lld" >> "$GITHUB_ENV"
echo "OBJC_LD=lld" >> "$GITHUB_ENV"
- uses: pypa/[email protected]
- name: Set up QEMU
if: matrix.platform == 'linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
if: matrix.platform != 'macos-arm'
uses: pypa/[email protected]
env:
MACOSX_DEPLOYMENT_TARGET: 13.0
CIBW_ARCHS_LINUX: x86_64 aarch64

- name: Build wheels
if: matrix.platform == 'macos-arm'
uses: pypa/[email protected]
env:
MACOSX_DEPLOYMENT_TARGET: 14
MACOSX_DEPLOYMENT_TARGET: 14.0

- name: Verify clean directory
run: git diff --exit-code
Expand Down
26 changes: 24 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ Installation of the pre-compiled releases should be as simple as:
pip install pyvroom
The current minimal requirements are as follows:

* Python at least version 3.9.
* Intel MacOS (or Rosetta2) at least version 13.0.
* Apple Silicon MacOS at least version 14.0.
* Windows on AMD64.
* Linux on x86_64 and Aarch64 given glibc at least version 2.28.

Outside this it might be possible to build your own binaries.

Building from source
====================

Expand All @@ -128,8 +138,20 @@ Building the source distributions requires:
pip install -r pyvroom/build-requirements.txt
* Install ``asio`` headers, and ``openssl`` and ``crypto`` libraries and headers.
On Linux and macOS this involve using package managers like ``apt``, ``yum``
or ``brew``. The exact package name may vary a bit between systems.
For mac, this would be::

brew install [email protected]
brew install asio

For RHEL::

yum module enable mariadb-devel:10.3
yum install -y openssl-devel asio

For Musllinux::

apk add asio-dev
apk add openssl-dev

* The installation can then be done with:

Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,29 @@ exclude = '''

[tool.cibuildwheel]
test-command = 'python -c "import vroom"'
build = "cp*"
build = "cp3{9,10,11,12}-*"
skip = "*musllinux*"
archs = "native"
manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64"
manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64"

[tool.cibuildwheel.linux]
before-all = """
dnf update -y
dnf module enable -y mariadb-devel
dnf install -y openssl-devel asio-devel
"""
archs = ["x86_64", "aarch64"]

[[tool.cibuildwheel.overrides]]
select = "*musllinux*"
before-all = """
apk add asio-dev
apk add openssl-dev
"""

[tool.cibuildwheel.macos]

before-all = """
brew install asio
brew install [email protected]
brew install --ignore-dependencies asio
"""
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package_dir =
install_requires =
numpy
pandas
python_requires = >=3.7
python_requires = >=3.9
zip_safe = False
include_package_data = True

Expand Down
10 changes: 7 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,11 @@

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

# 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 @@ -120,5 +120,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)})"

0 comments on commit 818a6dd

Please sign in to comment.