Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/underworldcode/stripy
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoresi committed Mar 21, 2022
2 parents 778523f + dea92b8 commit 840fc2d
Show file tree
Hide file tree
Showing 83 changed files with 9,823 additions and 6,122 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build_deploy_jbdoc.yml
Expand Up @@ -3,7 +3,7 @@ name: API docs / jupyterbook
# We should trigger this from an upload event

on:
push:
push: # We publish the beta docs as well
branches:
- master
- dev
Expand Down Expand Up @@ -31,7 +31,6 @@ jobs:
path: |
~/conda_pkgs_dir
~/.cache/pip
/usr/share/miniconda3/envs/jupyter-book
~/stripy/jupyterbook/_build
key: macos-jbdoc-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_jb_docs_environment.yml') }}
Expand All @@ -52,7 +51,7 @@ jobs:
VERSION=`python setup.py --version`
echo "VERSION=$(echo $VERSION)" >> $GITHUB_ENV
cd jupyterbook
jupyter-book build .
./build-book.sh
# Note deploy key needs the ----BEGIN ... KEY---- lines too

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build_deploy_pdoc.yml
Expand Up @@ -3,8 +3,9 @@ name: API docs / pdoc3
# We should trigger this from an upload event

on:
push:
branches: [master]
push: # This is not really a great idea
branches:
- master

workflow_run:
workflows: ["Conda Deployment"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conda_deploy.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.7", "3.8"]
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v2

Expand Down
56 changes: 30 additions & 26 deletions .github/workflows/python_pip_build_test.yml
Expand Up @@ -18,50 +18,54 @@ jobs:
fail-fast: false
matrix:
os: [ 'macos-latest', 'ubuntu-latest', 'windows-latest']
python-version: ['2.7', '3.7', '3.8']
python-version: ['2.7', '3.7', '3.8', '3.9']
exclude:
- os: 'windows-latest'
python-version: 2.7
- os: 'windows-latest'
python-version: 3.8
- os: 'windows-latest'
python-version: 3.9

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 1
with:
python-version: ${{ matrix.python-version }}

- name: Install gfortran (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y gfortran
path: |
~/conda_pkgs_dir
~/.cache/pip
~/stripy/jupyterbook/_build
key: macos-test-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_test_environment.yml') }}

- name: Install gfortran (macos)
if: matrix.os == 'macos-latest'
run: |
brew cask install gfortran
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install numpy
pip install scipy
pip install Cython
- name: Miniconda + Cache
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
environment-file: .github/workflows/resources/conda_test_environment.yml
activate-environment: conda-test
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Install (self)
shell: bash -l {0}
run: |
pip install -e .
pip install -e .
- name: Test with pytest
shell: bash -l {0}
run: |
python -c 'import stripy;'
pip install pytest
pytest

83 changes: 52 additions & 31 deletions .github/workflows/python_pypi_upload_macos_wheel.yml
Expand Up @@ -3,10 +3,13 @@ name: PYPI wheels macos
on:
release:
types: [created, edited]

# push:
# branches:
# - dev

workflow_dispatch:


jobs:
deploy_to_pypi:
Expand All @@ -16,38 +19,56 @@ jobs:
fail-fast: false
matrix:
os: [ 'macos-latest']
python-version: ['2.7', '3.7', '3.8']
python-version: ['2.7', '3.7', '3.8', '3.9']

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install gfortran (macos)
run: |
brew cask install gfortran
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install numpy
pip install scipy
pip install Cython
pip install delocate
- name: Build the wheel
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

run: |
python setup.py bdist_wheel
delocate-wheel -d -w fixed_wheels dist/*whl
twine upload fixed_wheels/*whl --skip-existing
- name: Checkout
uses: actions/checkout@v2

- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 1
with:
path: |
~/conda_pkgs_dir
~/.cache/pip
~/stripy/jupyterbook/_build
key: macos-test-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_test_environment.yml') }}

- name: Miniconda + Cache
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
environment-file: .github/workflows/resources/conda_test_environment.yml
activate-environment: conda-test
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Install (self)
shell: bash -l {0}
run: |
pip install -e .
- name: Test with pytest
shell: bash -l {0}
run: |
pip install setuptools wheel twine
pip install delocate

- name: Build the wheel
shell: bash -l {0}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

run: |
python setup.py bdist_wheel
delocate-wheel -d -w fixed_wheels dist/*whl
twine upload fixed_wheels/*whl --skip-existing
2 changes: 1 addition & 1 deletion .github/workflows/python_pypi_upload_mlinux_wheel.yml
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.2.2-manylinux2010_x86_64
with:
python-versions: 'cp27-cp27m cp36-cp36m cp37-cp37m cp38-cp38'
python-versions: 'cp27-cp27m cp36-cp36m cp37-cp37m cp38-cp38 cp39-39'
build-requirements: 'cython numpy scipy'
system-packages: 'libgfortran'
package-path: ''
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/resources/conda_build_environment.yml
@@ -1,14 +1,13 @@
# This is the environment needed to build stripy. As this will be cached, we can include any stripy dependencies
# so they are not downloaded again - this should save a bit of time
# This is the environment needed to build stripy. Note, the build is in a new
# environment so all we need here is the tools to run the build in the first place
# not all the stripy dependencies.

name: conda-build
channels:
- conda-forge
dependencies:
- compilers
- pytest
- numpy>=1.16.0
- scipy>=1.0.0
# numpy is needed for some of the setup tools
- numpy
- conda-build
- conda-verify
- anaconda-client
5 changes: 2 additions & 3 deletions .github/workflows/resources/conda_jb_docs_environment.yml
Expand Up @@ -5,7 +5,7 @@ channels:
- conda-forge
- geo-down-under
dependencies:
- geo-down-under::stripy==2.0.5b2
- geo-down-under::stripy==2.0.5b2 # this only works after the upload, of course
- geo-down-under::litho1pt0
- matplotlib
- pyproj
Expand All @@ -14,10 +14,9 @@ dependencies:
- netcdf4
- cartopy
- xarray
- xvfbwrapper
- k3d
- pip

- pip:
- jupyter-book
- lavavu

14 changes: 14 additions & 0 deletions .github/workflows/resources/conda_test_environment.yml
@@ -0,0 +1,14 @@
# This is the environment needed to build stripy for pip

name: conda-test
channels:
- conda-forge
dependencies:
# numpy is needed for some of the setup tools
- compilers
- numpy
- scipy
- cython
- pip


4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -47,3 +47,7 @@ litho1pt0-src/litho1pt0/Notebooks/litho1pt0/Data/ETOPO1_Ice_g_geotiff.tif.zip
/.spyproject/

fixed_wheels/stripy-1.2.2-cp37-cp37m-macosx_10_9_x86_64.whl

# macos

.DS_Store

0 comments on commit 840fc2d

Please sign in to comment.