diff --git a/.github/workflows/main_push.yml b/.github/workflows/main_push.yml index 74a4d57..d0b67bc 100644 --- a/.github/workflows/main_push.yml +++ b/.github/workflows/main_push.yml @@ -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 @@ -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' @@ -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 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 64e70e7..30d3d21 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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 @@ -40,7 +40,7 @@ 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' @@ -48,7 +48,7 @@ jobs: 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' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e758c7..43792d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -54,13 +56,13 @@ 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' - 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 @@ -70,9 +72,23 @@ 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 + # - 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/cibuildwheel@v2.19.1 + env: + MACOSX_DEPLOYMENT_TARGET: 13.0 + + - name: Build wheels + if: matrix.platform == 'macos-arm' + uses: pypa/cibuildwheel@v2.19.1 env: - MACOSX_DEPLOYMENT_TARGET: 10.14 + MACOSX_DEPLOYMENT_TARGET: 14.0 - name: Verify clean directory run: git diff --exit-code @@ -89,7 +105,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 - uses: actions/download-artifact@v3 with: diff --git a/README.rst b/README.rst index edaf6e8..d0d7306 100644 --- a/README.rst +++ b/README.rst @@ -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 ------------ @@ -128,8 +128,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 openssl@1.1 + 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: diff --git a/pyproject.toml b/pyproject.toml index 41c43e4..2d0210c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,17 +23,17 @@ 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" [tool.cibuildwheel.linux] before-all = """ -dnf update -y -dnf module enable -y mariadb-devel -dnf install -y openssl-devel asio-devel +yum module enable mariadb-devel:10.3 +yum install -y openssl-devel asio """ +# archs = ["auto", "aarch64"] [[tool.cibuildwheel.overrides]] select = "*musllinux*" @@ -41,9 +41,9 @@ before-all = """ apk add asio-dev apk add openssl-dev """ - [tool.cibuildwheel.macos] before-all = """ -brew install asio +brew install openssl@1.1 +brew install --ignore-dependencies asio """ diff --git a/setup.cfg b/setup.cfg index f5401e6..626bdda 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py index 8d838ef..4b120b4 100644 --- a/setup.py +++ b/setup.py @@ -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 @@ -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 = [] @@ -47,8 +48,11 @@ 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}/opt/openssl@1.1/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/openssl@1.1/lib") # try conan dependency resolution conanfile = tuple(Path(__file__).parent.resolve().rglob("conanbuildinfo.json"))