diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26f7af4f..e8a59528 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,46 +28,62 @@ jobs: - name: install additional required packages run: | sudo apt-get install -y --no-install-recommends \ - libudunits2-dev \ - libproj-dev \ - libgeos-dev \ - libffi-dev \ - cmake \ - libgtest-dev \ - build-essential \ - curl \ - libcurl4-openssl-dev + libudunits2-dev \ + gdal-bin libgdal-dev \ + libproj-dev \ + libgeos-dev \ + libffi-dev \ + cmake \ + libgtest-dev \ + build-essential \ + curl \ + libcurl4-openssl-dev \ + python3-numpy \ + python3-shapely \ + python3-cartopy - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install dependencies (inline, no external reqs) run: | - python -m pip install --upgrade pip==24.0 + # 1. Pin pip & setuptools so distutils & flags work + python -m pip install --upgrade pip==24.0 setuptools==65.5.1 wheel setuptools_scm - # patch to solve dependency issues with celery / fiona / click / pytz - # download celery package + # 2. Point pip at your IMOS PyPI repo (so aodntools>=1.3.1 is found) + export PIP_INDEX_URL="http://imos-artifacts.s3-website-ap-southeast-2.amazonaws.com/repo/pypi/${STAGE}/" + export PIP_EXTRA_INDEX_URL="https://pypi.org/simple/" + export PIP_TRUSTED_HOST="imos-artifacts.s3-website-ap-southeast-2.amazonaws.com" + + # 3. Pre-install build-time deps so Cartopy/Matplotlib metadata steps pass + python -m pip install \ + "numpy<1.24.0" \ + "pandas<2.0" \ + "matplotlib>=3.1,<3.6" --only-binary matplotlib + + # 4. Patch & install Celery 5.1.2 (locks in click==7.1.2 & sane pytz) wget https://files.pythonhosted.org/packages/source/c/celery/celery-5.1.2.tar.gz tar -xzf celery-5.1.2.tar.gz - cd celery-5.1.2 - # patch the requirements to use pytz>=2020.1 instead of pytz>dev which causes issues + pushd celery-5.1.2 sed -i "s/pytz>dev/pytz>=2020.1/g" requirements/default.txt - sed -i "s/pytz>dev/pytz>=2020.1/g" celery.egg-info/requires.txt sed -i "s/pytz>dev/pytz>=2020.1/g" requirements/dev.txt - # install the package python setup.py install - cd .. - # remove downlaoded copy of celery + popd rm -rf celery-5.1.2 celery-5.1.2.tar.gz - pip install pytest-runner - pip install pyshp - pip install scipy - pip install -r stage_requirements.txt - pip install pytest-cov + # 5. build Shapely against system GEOS, but use Cartopy’s binary wheel + python -m pip install --no-binary shapely \ + shapely==1.8.5.post1 + # Cartopy has no Linux wheel on PyPI—build from source against system GEOS/PROJ: + python -m pip install --no-build-isolation --no-binary cartopy \ + cartopy==0.20.3 + # 6. Install your own package (and its private deps) + test extras & tools + python -m pip install -e .[testing] + python -m pip install pytest-runner pyshp scipy pytest-cov env: STAGE: ${{ matrix.stage }} + - name: Test with pytest run: | pytest --cov=./ --cov-report=xml