diff --git a/.github/workflows/build_wheel_windows.yml b/.github/workflows/build_wheel_windows.yml deleted file mode 100644 index 4004f7d8..00000000 --- a/.github/workflows/build_wheel_windows.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Build wheels for Windows - -on: - push: - branches: - - main # just build the sdist & wheel, skip release - tags: - - "*" - pull_request: # also build on PRs touching files that affect wheels - paths: - - ".github/workflows/build_wheel.yml" - - "MANIFEST.in" - - "pyproject.toml" - - "setup.py" - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-2019] - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Cache vcpkg - uses: actions/cache@v1 - id: vcpkgcache - with: - path: C:/vcpkg/installed - key: ${{ runner.os }}-vcpkg - - - name: Install GDAL - run: | - vcpkg install gdal[core]:x64-windows - - - name: Build wheels - uses: pypa/cibuildwheel@v2.3.1 - - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl - - test_wheels: - name: windows python ${{ matrix.python-version }} tests - runs-on: windows-latest - needs: build_wheels - strategy: - fail-fast: false - matrix: - python-version: ["3.8", "3.9", "3.10"] - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: false - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - cache-dependency-path: "ci/requirements-wheel-test.txt" - - - name: Download wheels from artifacts - uses: actions/download-artifact@v2 - with: - path: wheelhouse - - - name: Set version string - shell: bash - run: echo "py_version_str=cp$(echo ${{ matrix.python-version }} | tr -d -c 0-9)" >> $GITHUB_ENV - - - name: Install dependencies and pyogrio wheel - shell: bash - run: | - python -m pip install -r ci/requirements-wheel-test.txt - python -m pip install --no-deps geopandas - ls -R wheelhouse - python -m pip install wheelhouse/artifact/pyogrio-*${{ env.py_version_str }}*.whl - python -m pip list - - - name: Run tests - shell: bash - run: | - cd .. - python -m pytest --pyargs pyogrio.tests -v diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 00000000..43e32504 --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,163 @@ +name: Build wheels + +on: + push: + branches: + - main # just build the sdist & wheel, skip release + tags: + - "*" + pull_request: # also build on PRs touching files that affect wheels + paths: + - ".github/workflows/build_wheels.yml" + - "ci/*" + - "MANIFEST.in" + - "pyproject.toml" + - "setup.py" + workflow_dispatch: + +jobs: + build_wheels_linux: + name: Build wheels on Linux + runs-on: "ubuntu-20.04" + strategy: + fail-fast: false + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + with: + install: true + + - name: Build Docker image with vcpkg and gdal + # using build-push-action (without push) to make use of cache arguments + uses: docker/build-push-action@v2 + with: + context: . + file: ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile + tags: manylinux-vcpkg-gdal:latest + push: false + load: true + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Build wheels + uses: pypa/cibuildwheel@v2.3.1 + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_wheels_mac_win: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: "macos-10.15" + triplet: "x64-osx-dynamic" + - os: "windows-2019" + triplet: "x64-windows" + + env: + MACOSX_DEPLOYMENT_TARGET: "10.15" + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Cache vcpkg + uses: actions/cache@v2 + id: vcpkgcache + with: + path: | + /Users/runner/.cache/vcpkg/archives + C:\vcpkg\installed + key: ${{ matrix.os }}-x86_64-vcpkg-gdal3.4.2-1 + + # MacOS build requires aclocal, which is part of automake, but appears + # to be missing in default image + - name: Reinstall automake + if: runner.os == 'macOS' + run: | + brew reinstall automake + echo $(which aclocal) + + - name: Install GDAL + env: + VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} + run: | + vcpkg install gdal[core] --overlay-triplets=./ci/custom-triplets + + - name: Upload vcpkg build logs + if: ${{ failure() }} + uses: actions/upload-artifact@v2 + with: + path: $VCPKG_INSTALLATION_ROOT/buildtrees/gdal/*.log + + - name: Build wheels + uses: pypa/cibuildwheel@v2.3.1 + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + test_wheels: + name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }}) + needs: [build_wheels_linux, build_wheels_mac_win] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-20.04", "windows-latest", "macos-latest", "macos-10.15"] + python-version: ["3.8", "3.9"] + include: + # TODO macOS is failing on py 3.10 because of shapely failure + - os: "ubuntu-20.04" + python-version: "3.10" + - os: "windows-latest" + python-version: "3.10" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + cache-dependency-path: "ci/requirements-wheel-test.txt" + + - name: Download wheels from artifacts + uses: actions/download-artifact@v2 + with: + path: wheelhouse + + - name: Install dependencies and pyogrio wheel + shell: bash + run: | + python -m pip install -r ci/requirements-wheel-test.txt + python -m pip install --no-deps geopandas + python -m pip install --find-links wheelhouse/artifact pyogrio + python -m pip list + + # TODO temporary set env variable for curl certificate for Linux + - name: Set CURL_CA_BUNDLE environment variable + if: runner.os == 'Linux' + run: | + echo "CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt" >> $GITHUB_ENV + + - name: Run tests + shell: bash + run: | + cd .. + python -m pytest --pyargs pyogrio.tests -v diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml deleted file mode 100644 index 4d2f41c6..00000000 --- a/.github/workflows/build_wheels_linux.yml +++ /dev/null @@ -1,104 +0,0 @@ -name: Build Linux wheels - -on: - push: - branches: - - main # just build the sdist & wheel, skip release - tags: - - "*" - pull_request: # also build on PRs touching this file - paths: - - ".github/workflows/build_wheels_linux.yml" - - "ci/*" - - "MANIFEST.in" - - "pyproject.toml" - - "setup.py" - workflow_dispatch: - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} ${{ matrix.platform }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-20.04"] - platform: ["x86_64"] - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - install: true - - - name: Build Docker image with vcpkg and gdal - # using build-push-action (without push) to make use of cache arguments - uses: docker/build-push-action@v2 - with: - context: . - file: ci/manylinux2014_x86_64-vcpkg-gdal.Dockerfile - tags: manylinux-vcpkg-gdal:latest - push: false - load: true - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Build wheels - uses: pypa/cibuildwheel@v2.3.1 - - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl - - test-wheel: - name: Test wheels on ${{ matrix.os }} ${{ matrix.platform }} - needs: build_wheels - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-20.04"] - platform: ["x86_64"] - python-version: ["3.8", "3.9", "3.10"] - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: false - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Download wheels from artifacts - uses: actions/download-artifact@v2 - with: - path: wheelhouse - - - name: Set version string - shell: bash - run: echo "py_version_str=cp$(echo ${{ matrix.python-version }} | tr -d -c 0-9)" >> $GITHUB_ENV - - - name: Install dependencies and pyogrio wheel - shell: bash - run: | - python -m pip install -r ci/requirements-wheel-test.txt - python -m pip install --no-deps geopandas - python -m pip install wheelhouse/artifact/pyogrio-*${{ env.py_version_str }}*.whl - python -m pip list - - - name: Run tests - shell: bash - # TODO temporary set env variable for curl certificate - env: - CURL_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt - run: | - cd .. - python -m pytest --pyargs pyogrio.tests -v diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml deleted file mode 100644 index dc580ab6..00000000 --- a/.github/workflows/build_wheels_macos.yml +++ /dev/null @@ -1,112 +0,0 @@ -name: Build MacOS wheels - -on: - push: - branches: - - main # just build the sdist & wheel, skip release - tags: - - "*" - pull_request: # also build on PRs touching this file - paths: - - ".github/workflows/build_wheels_macos.yml" - - "ci/*" - - "MANIFEST.in" - - "pyproject.toml" - - "setup.py" - workflow_dispatch: - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} ${{ matrix.platform }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["macos-10.15"] - platform: ["x86_64"] - - env: - MACOSX_DEPLOYMENT_TARGET: "10.15" - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Cache vcpkg - uses: actions/cache@v1 - id: vcpkgcache - with: - path: "/Users/runner/.cache/vcpkg/archives" - key: ${{ matrix.os }}-${{ matrix.platform }}-vcpkg-gdal3.4.1-dynamic - - # MacOS build requires aclocal, which is part of automake, but appears - # to be missing in default image - - name: Reinstall automake - if: ${{ startsWith(matrix.os, 'macos') }} - run: | - brew reinstall automake - echo $(which aclocal) - - - name: Install GDAL - run: | - vcpkg install gdal[core]:x64-osx-dynamic --overlay-triplets=./ci/custom-triplets - - - name: Upload build logs - uses: actions/upload-artifact@v2 - if: ${{ failure() }} - with: - path: /usr/local/share/vcpkg/buildtrees/gdal/*.log - - - name: Build wheels - uses: pypa/cibuildwheel@v2.3.1 - - - uses: actions/upload-artifact@v2 - with: - path: ./wheelhouse/*.whl - - test-wheel: - name: Test wheels on ${{ matrix.os }} ${{ matrix.platform }} - needs: build_wheels - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["macos-latest", "macos-10.15"] - platform: ["x86_64"] - python-version: ["3.8", "3.9"] - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: false - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Download wheels from artifacts - uses: actions/download-artifact@v2 - with: - path: wheelhouse - - - name: Set version string - shell: bash - run: echo "py_version_str=cp$(echo ${{ matrix.python-version }} | tr -d -c 0-9)" >> $GITHUB_ENV - - - name: Install dependencies and pyogrio wheel - shell: bash - run: | - python -m pip install -r ci/requirements-wheel-test.txt - python -m pip install --no-deps geopandas - ls -R wheelhouse - python -m pip install wheelhouse/artifact/pyogrio-*${{ env.py_version_str }}*.whl - python -m pip list - - - name: Run tests - shell: bash - run: | - cd .. - python -m pytest --pyargs pyogrio.tests -v diff --git a/pyproject.toml b/pyproject.toml index 154d4e05..139f17d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ GDAL_INCLUDE_PATH = "$VCPKG_INSTALL/include" GDAL_LIBRARY_PATH = "$VCPKG_INSTALL/lib" PYOGRIO_PACKAGE_DATA = 1 GDAL_DATA = "$VCPKG_INSTALL/share/gdal/gdal" -PROJ_LIB = "$VCPKG_INSTALL/share/proj4" +PROJ_LIB = "$VCPKG_INSTALL/share/proj/data" [tool.cibuildwheel.windows] before-build = "pip install delvewheel" @@ -45,4 +45,4 @@ GDAL_INCLUDE_PATH = "$VCPKG_INSTALL/include" GDAL_LIBRARY_PATH = "$VCPKG_INSTALL/lib" PYOGRIO_PACKAGE_DATA = 1 GDAL_DATA = "$VCPKG_INSTALL/share/gdal" -PROJ_LIB = "$VCPKG_INSTALL/share/proj4" +PROJ_LIB = "$VCPKG_INSTALL/share/proj/data"