Skip to content

Commit

Permalink
Add uv to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Sep 29, 2024
1 parent 5cdeb6d commit 9ad6b0b
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 91 deletions.
49 changes: 32 additions & 17 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,47 @@ on:
jobs:
test-docs-build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.11"
- name: Install GDAL
run: |
python -m pip install --upgrade pip
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL pyproj
- name: Test GDAL installation
run: |
python -c "from osgeo import gdal"
gdalinfo --version
version: "0.4.12"
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}

- name: Install optional dependencies
run: |
pip install --no-cache-dir Cython
pip install -r requirements.txt -r requirements_dev.txt
pip install .
- name: PKG-TEST
uv pip install --find-links https://girder.github.io/large_image_wheels GDAL pyproj
uv pip install pytest
uv pip install -r requirements_dev.txt
- name: Test import
run: |
python -m unittest discover tests/
- name: Build docs
uv run python -c "import geospatial; print('geospatial import successful')"
uv run python -c "from osgeo import gdal; print('gdal import successful')"
uv run gdalinfo --version
- name: Running pytest
run: |
uv run pytest . --verbose
- name: Install mkdocs
run: |
mkdocs build
uv pip install -r requirements_docs.txt
uv run mkdocs build
env:
EARTHDATA_USERNAME: ${{ secrets.EARTHDATA_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
Expand Down
43 changes: 33 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,47 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: "3.11"
version: "0.4.12"
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}

- name: Install optional dependencies
run: |
python -m pip install --upgrade pip
pip install --user --no-cache-dir Cython
pip install --user -r requirements.txt -r requirements_dev.txt
pip install .
- name: PKG-TEST
uv pip install --find-links https://girder.github.io/large_image_wheels GDAL pyproj
uv pip install pytest
uv pip install -r requirements_dev.txt
- name: Test import
run: |
python -m unittest discover tests/
- name: Build docs
run: mkdocs gh-deploy --force
uv run python -c "import geospatial; print('geospatial import successful')"
uv run python -c "from osgeo import gdal; print('gdal import successful')"
uv run gdalinfo --version
- name: Running pytest
run: |
uv run pytest . --verbose
- name: Install mkdocs
run: |
uv pip install -r requirements_docs.txt
uv run mkdocs gh-deploy --force
env:
EARTHDATA_USERNAME: ${{ secrets.EARTHDATA_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
21 changes: 14 additions & 7 deletions .github/workflows/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
version: "0.4.16"
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: |
uv venv
uv pip install -e .
- name: Install package
run: pip install .
- name: Test import
run: python -c "import hypercoast; print('hypercoast import successful')"
run: uv run python -c "import hypercoast; print('hypercoast import successful')"
40 changes: 19 additions & 21 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,30 @@ on:
name: macOS build
jobs:
test-macOS:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} (${{ matrix.python-version}})

runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.py }})
strategy:
fail-fast: false
matrix:
os: ["macOS-latest"]
python-version: ["3.12"]

config:
- { os: macOS-latest, py: "3.12" }
env:
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version}}
- name: Install GDAL
run: |
brew install gdal
- name: Test GDAL installation
run: |
gdalinfo --version
version: "0.4.12"
enable-cache: true

- name: Set up Python ${{ matrix.config.py }}
run: uv python install ${{ matrix.config.py }}

- name: Install dependencies
run: uv sync --python ${{ matrix.config.py }}

- name: Test import
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir Cython
pip install -r requirements.txt
pip install .
uv run python -c "import hypercoast; print('hypercoast import successful')"
49 changes: 27 additions & 22 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,38 @@ on:
name: Linux build
jobs:
py-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.py }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, py: "3.9" }
- { os: ubuntu-latest, py: "3.10" }
- { os: ubuntu-latest, py: "3.11" }
- { os: ubuntu-latest, py: "3.12" }
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.config.py }}
- name: Install GDAL
version: "0.4.12"
# enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}

- name: Install optional dependencies
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir Cython
pip install --find-links=https://girder.github.io/large_image_wheels --no-cache GDAL
- name: Test GDAL installation
uv pip install --find-links https://girder.github.io/large_image_wheels gdal pyproj
uv pip install pytest
- name: Test import
run: |
python -c "from osgeo import gdal"
gdalinfo --version
- name: Install dependencies
uv run python -c "import geospatial; print('geospatial import successful')"
uv run python -c "from osgeo import gdal; print('gdal import successful')"
uv run gdalinfo --version
- name: Test import
run: |
pip install --user -r requirements.txt
pip install .
uv run python -c "import hypercoast; print('hypercoast import successful')"
30 changes: 16 additions & 14 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,25 @@ name: Windows build
jobs:
test-windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
- name: Install miniconda
uses: conda-incubator/setup-miniconda@v3

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
auto-activate-base: true
python-version: "3.11"
version: "0.4.12"
enable-cache: true

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install GDAL
run: conda install -c conda-forge gdal --yes
- name: Test GDAL installation
run: |
python -c "from osgeo import gdal"
gdalinfo --version
- name: Install dependencies
run: uv sync --python ${{ matrix.python-version }}

- name: Test import
run: |
python -m pip install --upgrade pip
pip install --no-cache-dir Cython
pip install -r requirements.txt
pip install .
uv run python -c "import hypercoast; print('hypercoast import successful')"

0 comments on commit 9ad6b0b

Please sign in to comment.