Skip to content

Commit 840fc2d

Browse files
committed
2 parents 778523f + dea92b8 commit 840fc2d

File tree

83 files changed

+9823
-6122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+9823
-6122
lines changed

.github/workflows/build_deploy_jbdoc.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: API docs / jupyterbook
33
# We should trigger this from an upload event
44

55
on:
6-
push:
6+
push: # We publish the beta docs as well
77
branches:
88
- master
99
- dev
@@ -31,7 +31,6 @@ jobs:
3131
path: |
3232
~/conda_pkgs_dir
3333
~/.cache/pip
34-
/usr/share/miniconda3/envs/jupyter-book
3534
~/stripy/jupyterbook/_build
3635
3736
key: macos-jbdoc-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_jb_docs_environment.yml') }}
@@ -52,7 +51,7 @@ jobs:
5251
VERSION=`python setup.py --version`
5352
echo "VERSION=$(echo $VERSION)" >> $GITHUB_ENV
5453
cd jupyterbook
55-
jupyter-book build .
54+
./build-book.sh
5655
5756
# Note deploy key needs the ----BEGIN ... KEY---- lines too
5857

.github/workflows/build_deploy_pdoc.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ name: API docs / pdoc3
33
# We should trigger this from an upload event
44

55
on:
6-
push:
7-
branches: [master]
6+
push: # This is not really a great idea
7+
branches:
8+
- master
89

910
workflow_run:
1011
workflows: ["Conda Deployment"]

.github/workflows/conda_deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
22-
python-version: ["3.7", "3.8"]
22+
python-version: ["3.7", "3.8", "3.9"]
2323
steps:
2424
- uses: actions/checkout@v2
2525

.github/workflows/python_pip_build_test.yml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,54 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os: [ 'macos-latest', 'ubuntu-latest', 'windows-latest']
21-
python-version: ['2.7', '3.7', '3.8']
21+
python-version: ['2.7', '3.7', '3.8', '3.9']
2222
exclude:
2323
- os: 'windows-latest'
2424
python-version: 2.7
2525
- os: 'windows-latest'
2626
python-version: 3.8
27+
- os: 'windows-latest'
28+
python-version: 3.9
2729

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

3032
steps:
3133
- name: Checkout
3234
uses: actions/checkout@v2
3335

34-
- name: Set up Python
35-
uses: actions/setup-python@v1
36+
- name: Cache conda
37+
uses: actions/cache@v1
38+
env:
39+
# Increase this value to reset cache if etc/example-environment.yml has not changed
40+
CACHE_NUMBER: 1
3641
with:
37-
python-version: ${{ matrix.python-version }}
38-
39-
- name: Install gfortran (ubuntu)
40-
if: matrix.os == 'ubuntu-latest'
41-
run: |
42-
sudo apt-get install -y gfortran
42+
path: |
43+
~/conda_pkgs_dir
44+
~/.cache/pip
45+
~/stripy/jupyterbook/_build
46+
47+
key: macos-test-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_test_environment.yml') }}
4348

44-
- name: Install gfortran (macos)
45-
if: matrix.os == 'macos-latest'
46-
run: |
47-
brew cask install gfortran
48-
49-
- name: Install Python dependencies
50-
run: |
51-
python -m pip install --upgrade pip
52-
pip install numpy
53-
pip install scipy
54-
pip install Cython
55-
49+
- name: Miniconda + Cache
50+
uses: conda-incubator/setup-miniconda@v2
51+
with:
52+
miniconda-version: "latest"
53+
auto-update-conda: true
54+
environment-file: .github/workflows/resources/conda_test_environment.yml
55+
activate-environment: conda-test
56+
python-version: 3.7
57+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
58+
5659
- name: Install (self)
60+
shell: bash -l {0}
5761
run: |
58-
pip install -e .
59-
62+
pip install -e .
63+
6064
- name: Test with pytest
65+
shell: bash -l {0}
6166
run: |
6267
python -c 'import stripy;'
6368
pip install pytest
6469
pytest
65-
66-
67-
70+
71+

.github/workflows/python_pypi_upload_macos_wheel.yml

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ name: PYPI wheels macos
33
on:
44
release:
55
types: [created, edited]
6+
67
# push:
78
# branches:
89
# - dev
910

11+
workflow_dispatch:
12+
1013

1114
jobs:
1215
deploy_to_pypi:
@@ -16,38 +19,56 @@ jobs:
1619
fail-fast: false
1720
matrix:
1821
os: [ 'macos-latest']
19-
python-version: ['2.7', '3.7', '3.8']
22+
python-version: ['2.7', '3.7', '3.8', '3.9']
2023

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

2326
steps:
24-
- uses: actions/checkout@v2
25-
26-
- name: Set up Python
27-
uses: actions/setup-python@v1
28-
with:
29-
python-version: ${{ matrix.python-version }}
30-
31-
- name: Install gfortran (macos)
32-
run: |
33-
brew cask install gfortran
34-
35-
- name: Install dependencies
36-
run: |
37-
python -m pip install --upgrade pip
38-
pip install setuptools wheel twine
39-
pip install numpy
40-
pip install scipy
41-
pip install Cython
42-
pip install delocate
43-
44-
- name: Build the wheel
45-
env:
46-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
47-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
48-
49-
run: |
50-
51-
python setup.py bdist_wheel
52-
delocate-wheel -d -w fixed_wheels dist/*whl
53-
twine upload fixed_wheels/*whl --skip-existing
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Cache conda
31+
uses: actions/cache@v1
32+
env:
33+
# Increase this value to reset cache if etc/example-environment.yml has not changed
34+
CACHE_NUMBER: 1
35+
with:
36+
path: |
37+
~/conda_pkgs_dir
38+
~/.cache/pip
39+
~/stripy/jupyterbook/_build
40+
41+
key: macos-test-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/workflows/resources/conda_test_environment.yml') }}
42+
43+
- name: Miniconda + Cache
44+
uses: conda-incubator/setup-miniconda@v2
45+
with:
46+
miniconda-version: "latest"
47+
auto-update-conda: true
48+
environment-file: .github/workflows/resources/conda_test_environment.yml
49+
activate-environment: conda-test
50+
python-version: 3.7
51+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
52+
53+
- name: Install (self)
54+
shell: bash -l {0}
55+
run: |
56+
pip install -e .
57+
58+
- name: Test with pytest
59+
shell: bash -l {0}
60+
run: |
61+
pip install setuptools wheel twine
62+
pip install delocate
63+
64+
65+
- name: Build the wheel
66+
shell: bash -l {0}
67+
env:
68+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
69+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
70+
71+
run: |
72+
python setup.py bdist_wheel
73+
delocate-wheel -d -w fixed_wheels dist/*whl
74+
twine upload fixed_wheels/*whl --skip-existing

.github/workflows/python_pypi_upload_mlinux_wheel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Build manylinux Python wheels
2626
uses: RalfG/[email protected]_x86_64
2727
with:
28-
python-versions: 'cp27-cp27m cp36-cp36m cp37-cp37m cp38-cp38'
28+
python-versions: 'cp27-cp27m cp36-cp36m cp37-cp37m cp38-cp38 cp39-39'
2929
build-requirements: 'cython numpy scipy'
3030
system-packages: 'libgfortran'
3131
package-path: ''
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# This is the environment needed to build stripy. As this will be cached, we can include any stripy dependencies
2-
# so they are not downloaded again - this should save a bit of time
1+
# This is the environment needed to build stripy. Note, the build is in a new
2+
# environment so all we need here is the tools to run the build in the first place
3+
# not all the stripy dependencies.
34

45
name: conda-build
56
channels:
67
- conda-forge
78
dependencies:
8-
- compilers
9-
- pytest
10-
- numpy>=1.16.0
11-
- scipy>=1.0.0
9+
# numpy is needed for some of the setup tools
10+
- numpy
1211
- conda-build
1312
- conda-verify
1413
- anaconda-client

.github/workflows/resources/conda_jb_docs_environment.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ channels:
55
- conda-forge
66
- geo-down-under
77
dependencies:
8-
- geo-down-under::stripy==2.0.5b2
8+
- geo-down-under::stripy==2.0.5b2 # this only works after the upload, of course
99
- geo-down-under::litho1pt0
1010
- matplotlib
1111
- pyproj
@@ -14,10 +14,9 @@ dependencies:
1414
- netcdf4
1515
- cartopy
1616
- xarray
17-
- xvfbwrapper
17+
- k3d
1818
- pip
1919

2020
- pip:
2121
- jupyter-book
22-
- lavavu
2322

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the environment needed to build stripy for pip
2+
3+
name: conda-test
4+
channels:
5+
- conda-forge
6+
dependencies:
7+
# numpy is needed for some of the setup tools
8+
- compilers
9+
- numpy
10+
- scipy
11+
- cython
12+
- pip
13+
14+

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ litho1pt0-src/litho1pt0/Notebooks/litho1pt0/Data/ETOPO1_Ice_g_geotiff.tif.zip
4747
/.spyproject/
4848

4949
fixed_wheels/stripy-1.2.2-cp37-cp37m-macosx_10_9_x86_64.whl
50+
51+
# macos
52+
53+
.DS_Store

0 commit comments

Comments
 (0)