Skip to content

Commit

Permalink
Remove Rust hydration (#316)
Browse files Browse the repository at this point in the history
* refactor: remove rust hydration

It lives in https://github.com/gadomski/hydraters now
  • Loading branch information
gadomski authored Nov 14, 2024
1 parent f1d71d5 commit 6c569c0
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 669 deletions.
150 changes: 23 additions & 127 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ jobs:
buildpyrustdocker: ${{ steps.check.outputs.buildpy }}

steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
pgstac:
- 'docker/pgstac/**'
pypgstac:
- 'docker/pypgstac/**'
- id: check
run: |
buildpg=false;
ref=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | tr / _);
[[ "${{ steps.filter.outputs.pgstac }}" == "true" ]] && buildpg=true || ref=main;
echo "pgtag=${{ env.REGISTRY }}/stac-utils/pgstac-postgres:$ref" >>$GITHUB_OUTPUT;
echo "buildpg=$buildpg" >>$GITHUB_OUTPUT;
buildy=false;
[[ "${{ steps.filter.outputs.pypgstac }}" == "true" ]] && buildpy=true || ref=main;
echo "pytag=${{ env.REGISTRY }}/stac-utils/pgstac-pyrust:$ref" >>$GITHUB_OUTPUT;
echo "buildpy=$buildpg" >>$GITHUB_OUTPUT;
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
pgstac:
- 'docker/pgstac/**'
pypgstac:
- 'docker/pypgstac/**'
- id: check
run: |
buildpg=false;
ref=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | tr / _);
[[ "${{ steps.filter.outputs.pgstac }}" == "true" ]] && buildpg=true || ref=main;
echo "pgtag=${{ env.REGISTRY }}/stac-utils/pgstac-postgres:$ref" >>$GITHUB_OUTPUT;
echo "buildpg=$buildpg" >>$GITHUB_OUTPUT;
buildy=false;
[[ "${{ steps.filter.outputs.pypgstac }}" == "true" ]] && buildpy=true || ref=main;
echo "pytag=${{ env.REGISTRY }}/stac-utils/pgstac-pyrust:$ref" >>$GITHUB_OUTPUT;
echo "buildpy=$buildpg" >>$GITHUB_OUTPUT;
# This builds a base postgres image that has everything installed to be able to run pgstac. This image does not have pgstac itself installed.
buildpg:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
needs: [changes, buildpg, buildpyrust]
runs-on: ubuntu-latest
container:
image: ${{ needs.changes.outputs.pyrustdocker }}
image: ${{ needs.changes.outputs.pyrustdocker }}
env:
PGPASSWORD: postgres
PGHOST: postgres
Expand All @@ -125,114 +125,10 @@ jobs:
- uses: actions/checkout@v3
- name: Install pypgstac
working-directory: /__w/pgstac/pgstac/src/pypgstac
run: |
run: |
pip install .[dev,test,psycopg];
- name: Run tests
working-directory: /__w/pgstac/pgstac/docker/pypgstac/bin
run: |
run: |
./test
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
target: ${{ matrix.target }}
args: --release --out /home/runner/work/pgstac/pgstac/dist
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: /home/runner/work/pgstac/pgstac/dist/*

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
target: ${{ matrix.target }}
args: --release --out /home/runner/work/pgstac/pgstac/dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: /home/runner/work/pgstac/pgstac/dist/*

macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
target: ${{ matrix.target }}
args: --release --out /tmp/dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: /tmp/dist/*

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
command: sdist
args: --out /home/runner/work/pgstac/pgstac/dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: /home/runner/work/pgstac/pgstac/dist/*

# release:
# name: Release
# runs-on: ubuntu-latest
# if: "startsWith(github.ref, 'refs/tags/')"
# needs: [linux, windows, macos, sdist]
# steps:
# - uses: actions/download-artifact@v3
# with:
# name: wheels
# - name: Publish to PyPI
# uses: PyO3/maturin-action@v1
# env:
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
# with:
# command: upload
# args: --skip-existing *
114 changes: 16 additions & 98 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,106 +151,24 @@ jobs:
cache-from: type=gha
cache-to: type=gha, mode=max

linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
target: ${{ matrix.target }}
args: --release --out /home/runner/work/pgstac/pgstac/dist
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: /home/runner/work/pgstac/pgstac/dist/*

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
target: ${{ matrix.target }}
args: --release --out /home/runner/work/pgstac/pgstac/dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: /home/runner/work/pgstac/pgstac/dist/*

macos:
runs-on: macos-latest
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
target: ${{ matrix.target }}
args: --release --out /tmp/dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: /tmp/dist/*

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
command: sdist
args: --out /home/runner/work/pgstac/pgstac/dist
- name: Upload sdist
uses: actions/upload-artifact@v3
with:
name: wheels
path: /home/runner/work/pgstac/pgstac/dist/*

releasetopypi:
name: Release
runs-on: ubuntu-latest
needs: [linux, windows, macos, sdist]
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/pypgstac
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build
run: pip install build
- name: Build
run: python -m build
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
MATURIN_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
with:
command: upload
args: --skip-existing *
uses: pypa/gh-action-pypi-publish@release/v1
Loading

0 comments on commit 6c569c0

Please sign in to comment.