diff --git a/.github/workflows/ci-mf6.yml b/.github/workflows/ci-mf6.yml index 13f7af802d..8df3c45ac2 100644 --- a/.github/workflows/ci-mf6.yml +++ b/.github/workflows/ci-mf6.yml @@ -8,7 +8,6 @@ on: - master - develop - 'release*' - - 'ci-pytest' pull_request: branches: [master, develop] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b3374691d..0963d2412e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: - master - develop - 'release*' - - 'ci-pytest' pull_request: branches: [master, develop] @@ -56,7 +55,6 @@ jobs: run: shell: bash - if: github.event_name != 'schedule' steps: # check out repo - name: Checkout flopy repo @@ -101,7 +99,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] python-version: [3.9, 3.8, 3.7] run-type: [std] test-pth: [""] @@ -114,9 +112,17 @@ jobs: python-version: 3.9 run-type: script test-path: run_scripts.py + - os: windows-latest + python-version: 3.9 + run-type: std + test-path: "" + - os: windows-latest + python-version: 3.8 + run-type: std + test-path: "" defaults: run: - shell: bash -l {0} + shell: bash steps: # check out repo @@ -126,35 +132,51 @@ jobs: - name: Get branch name uses: nelonoel/branch-name@v1.0.1 - - name: Cache Miniconda - uses: actions/cache@v2.1.0 - env: - # Increase this value to reset cache if environment.yml has changed - CACHE_NUMBER: 2 - with: - path: ~/conda_pkgs_dir - key: ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.run-type }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('etc/environment.yml') }} - - # Standard python fails on windows without GDAL installation - # Using custom bash shell ("shell: bash -l {0}") with Miniconda - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2.1.1 + - name: Setup Python + uses: actions/setup-python@v2.2.2 with: python-version: ${{ matrix.python-version }} - mamba-version: "*" - channels: conda-forge - auto-update-conda: true - activate-environment: flopy - use-only-tar-bz2: true - - name: Add jupyter and jupytext to notebooks run - if: matrix.run-type == 'nb' + - name: Upgrade pip and install wheel + run: | + python -m pip install --upgrade pip + pip install wheel + + - name: Install Python packages on Windows + if: runner.os == 'Windows' run: | - mamba install --name flopy jupyter jupytext + pip install -r etc/requirements.windows.pip.txt - - name: Add packages to flopy environment using mamba or conda + - name: Install Python packages on Linux and MacOS + if: runner.os != 'Windows' run: | - mamba env update --name flopy --file etc/environment.yml + pip install -r etc/requirements.full.pip.txt + + - name: Download Python packages with GDAL dependencies on Windows + if: runner.os == 'Windows' + shell: python + run: | + import os + from gohlkegrabber import GohlkeGrabber + gg = GohlkeGrabber() + wheel_path = os.path.join(".", "wheels") + os.makedirs(wheel_path, exist_ok=True) + gg.retrieve(wheel_path, "gdal") + gg.retrieve(wheel_path, "rasterio") + gg.retrieve(wheel_path, "fiona") + + - name: Install Python packages with GDAL dependencies on Windows + if: runner.os == 'Windows' + run: | + ls -ltr ./wheels/ + pip install ./wheels/GDAL* + pip install ./wheels/rasterio* + pip install ./wheels/Fiona* + + - name: Add jupyter and jupytext to notebooks run + if: matrix.run-type == 'nb' + run: | + pip install jupyter jupytext - name: Install pymake, xmipy, and flopy run: | @@ -167,10 +189,16 @@ jobs: run: | pytest -v ci_prepare.py - - name: Add executables directory to path + - name: Add executables directory to path on Linux and MacOS + if: runner.os != 'Windows' run: | echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Add executables directory to path on Windows + if: runner.os == 'Windows' + run: | + echo "C:\Users\runneradmin\.local\bin" >> $GITHUB_PATH + - name: Run pytest on autotest scripts if: matrix.run-type == 'std' working-directory: ./autotest diff --git a/.github/workflows/rtd.yml b/.github/workflows/rtd.yml index b02da360e8..34b5c6ea5b 100644 --- a/.github/workflows/rtd.yml +++ b/.github/workflows/rtd.yml @@ -32,24 +32,22 @@ jobs: echo $GITHUB_REF echo $GITHUB_EVENT_NAME - # Standard python fails on windows without GDAL installation - # Using custom bash shell ("shell: bash -l {0}") with Miniconda - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2.1.1 + - name: Setup Python + uses: actions/setup-python@v2.2.2 with: python-version: 3.9 - mamba-version: "*" - channels: conda-forge - auto-update-conda: true - activate-environment: flopy - - name: Add jupyter and jupytext to scripts run + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + + - name: Install Python packages run: | - mamba install --name flopy jupyter jupytext + pip install -r etc/requirements.full.pip.txt - - name: Add packages to flopy environment + - name: Add jupyter and jupytext to scripts run run: | - mamba env update --name flopy --file etc/environment.yml + pip install jupyter jupytext - name: Install pymake, xmipy, and flopy run: | diff --git a/etc/requirements.full.pip.txt b/etc/requirements.full.pip.txt new file mode 100644 index 0000000000..941c07ab98 --- /dev/null +++ b/etc/requirements.full.pip.txt @@ -0,0 +1,34 @@ +matplotlib>=1.4.0 +numpy>=1.15.0 + +# testing +pylint +flake8 +black +coverage +pytest +pytest-xdist +pytest-cov + +# optional +appdirs +python-dateutil>=2.4.0 +affine +scipy +pandas +netcdf4 +pyshp>=2.0.0 +rasterio +fiona +descartes +pyproj +shapely +geos +geojson +vtk + +# external dependencies +requests + +# MODFLOW API dependencies +bmipy diff --git a/etc/requirements.windows.pip.txt b/etc/requirements.windows.pip.txt new file mode 100644 index 0000000000..5c4863f995 --- /dev/null +++ b/etc/requirements.windows.pip.txt @@ -0,0 +1,35 @@ +matplotlib>=1.4.0 +numpy>=1.15.0 + +# testing +pylint +flake8 +black +coverage +pytest +pytest-xdist +pytest-cov + +# optional +appdirs +python-dateutil>=2.4.0 +affine +scipy +pandas +netcdf4 +pyshp>=2.0.0 +descartes +pyproj +shapely +geos +geojson +vtk + +# external dependencies +requests + +# MODFLOW API dependencies +bmipy + +# golke installer +gohlkegrabber