Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Black
on: push

jobs:
black:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5 # Python ≥3.11 required for use_pyproject
with:
python-version: "3.12"
- uses: psf/black@stable
with:
use_pyproject: true
options: "--check"
4 changes: 2 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
jobs:
publish:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Publish to Registry
uses: docker/build-push-action@v1
with:
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ on: push

jobs:
test:

runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: ["3.11", "3.12"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In another bird, the matrix was just 3.11. What's the criterion for Python versions to test with in these repos?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.12 may be required in this particular repository to support running on the newest geospatial-python docker, which supports only python 3.12 right now.


steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
PIP_INDEX_URL: https://pypi.pacificclimate.org/simple
CPLUS_INCLUDE_PATH: /usr/include/gdal
C_INCLUDE_PATH: /usr/include/gdal
run: |
sudo apt-get update
sudo apt-get install libpq-dev python-dev libhdf5-dev libnetcdf-dev libgdal-dev
pip install -U pip pytest
pip install -r requirements.txt
pip install -e .[dev]
- name: Test with pytest (full)
if: github.ref == 'refs/heads/master'
run: |
py.test -m "not online" -v
- name: Test with pytest (fast)
if: github.ref != 'refs/heads/master'
run: |
py.test -m "not online and not slow" -v
- name: Code Quality
run: black . --check
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
PIP_INDEX_URL: https://pypi.pacificclimate.org/simple
CPLUS_INCLUDE_PATH: /usr/include/gdal
C_INCLUDE_PATH: /usr/include/gdal
run: |
sudo apt-get update
sudo apt-get install -y libpq-dev python3-dev libhdf5-dev libnetcdf-dev gdal-bin libgdal-dev curl
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install --extras "dev"
- name: Test with pytest (full)
if: github.ref == 'refs/heads/master'
run: |
py.test -m "not online" -v
- name: Test with pytest (fast)
if: github.ref != 'refs/heads/master'
run: |
py.test -m "not online and not slow" -v
35 changes: 22 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
FROM pcic/geospatial-python:gdal3
FROM pcic/geospatial-python:3.8.4

LABEL Maintainer="https://github.com/pacificclimate/sandpiper" Description="sandpiper WPS" Vendor="pacificclimate" Version="1.7.1"
LABEL Maintainer="https://github.com/pacificclimate/sandpiper" \
Description="sandpiper WPS" \
Vendor="pacificclimate" \
Version="1.7.1"
ENV PIP_INDEX_URL="https://pypi.pacificclimate.org/simple/"
ENV THREDDS_URL_ROOT="https://docker-dev03.pcic.uvic.ca/twitcher/ows/proxy/thredds/dodsC/datasets"
ENV THREDDS_URL_ROOT="https://marble-dev01.pcic.uvic.ca/twitcher/ows/proxy/thredds/dodsC/datasets"

# Update system
RUN apk upgrade --update && \
apk add \
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y \
libxml2-dev \
libxslt-dev \
linux-headers
wget


COPY . /tmp
WORKDIR /tmp

# Install WPS
RUN pip install --upgrade pip && \
pip install sphinx psutil && \
pip install . --ignore-installed && \
pip install gunicorn
ENV POETRY_HOME="/opt/poetry"
ENV PATH="$POETRY_HOME/bin:$PATH"

RUN apt-get update && \
apt-get install -y --no-install-recommends python3-pip curl && \
curl -sSL https://install.python-poetry.org | python3

COPY . .

RUN poetry config virtualenvs.in-project true && \
poetry install

# Start WPS service on port 5000 on 0.0.0.0
EXPOSE 5000
CMD gunicorn --bind=0.0.0.0:5000 --timeout 150 sandpiper.wsgi:application
CMD ["poetry", "run","gunicorn", "--bind=0.0.0.0:5000", "--timeout", "150", "sandpiper.wsgi:application"]

# docker build -t pcic/sandpiper .
# docker run -p 5000:5000 pcic/sandpiper
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

181 changes: 0 additions & 181 deletions Makefile

This file was deleted.

1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Loading
Loading