Skip to content

Commit ab960ed

Browse files
committed
Merge branch 'main' into 1.0.0_alpha
2 parents c66f892 + 40501f0 commit ab960ed

84 files changed

Lines changed: 3094 additions & 2561 deletions

File tree

Some content is hidden

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

.ci/azure/deploy.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
jobs:
22
- job:
3-
displayName: "Deploy Docs and source"
3+
displayName: "Deploy Docs"
44
pool:
55
vmImage: ubuntu-latest
6+
67
steps:
78
# No need to checkout the repo here!
89
- checkout: none
910

10-
# Just download all of the items already built
11-
- task: DownloadPipelineArtifact@2
12-
inputs:
13-
buildType: 'current'
14-
artifactName: 'wheels'
15-
targetPath: 'dist'
16-
17-
- task: DownloadPipelineArtifact@2
18-
inputs:
19-
buildType: 'current'
20-
artifactName: 'source_dist'
21-
targetPath: 'dist'
11+
- bash: |
12+
echo $IS_TAG
13+
echo $IS_MAIN
14+
echo $BRANCH_NAME
15+
displayName: Report branch parameters
2216
2317
- task: DownloadPipelineArtifact@2
2418
inputs:
@@ -27,8 +21,8 @@ jobs:
2721
targetPath: 'html'
2822

2923
- bash: |
30-
ls -l dist
3124
ls -l html
25+
displayName: Report downloaded cache contents.
3226
3327
- bash: |
3428
git config --global user.name ${GH_NAME}
@@ -39,25 +33,34 @@ jobs:
3933
GH_NAME: $(gh.name)
4034
GH_EMAIL: $(gh.email)
4135
36+
# upload documentation to discretize-docs gh-pages on tags
4237
- bash: |
43-
twine upload --skip-existing dist/*
44-
displayName: Deploy source and wheels
38+
git clone -q --branch gh-pages --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
39+
displayName: Checkout doc repository
4540
env:
46-
TWINE_USERNAME: $(twine.username)
47-
TWINE_PASSWORD: $(twine.password)
41+
GH_TOKEN: $(gh.token)
4842
49-
# upload documentation to discretize-docs gh-pages on tags
5043
- bash: |
51-
git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
5244
cd discretize-docs
53-
git gc --prune=now
54-
git remote prune origin
55-
rm -rf en/main/*
56-
cp -r html/* en/main/
45+
rm -rf "en/$BRANCH_NAME"
46+
mv ../html "en/$BRANCH_NAME"
5747
touch .nojekyll
58-
git add .
48+
displayName: Set Doc Folder
49+
50+
- bash: |
51+
# Update latest symlink
52+
cd discretize-docs
53+
rm -f en/latest
54+
ln -s "en/$BRANCH_NAME" en/latest
55+
displayName: Point Latest to tag
56+
condition: eq(variables.IS_TAG, true)
57+
58+
- bash: |
59+
# Commit and push
60+
cd discretize-docs
61+
git add --all
5962
git commit -am "Azure CI commit ref $(Build.SourceVersion)"
6063
git push
6164
displayName: Push documentation to discretize-docs
6265
env:
63-
GH_TOKEN: $(gh.token)
66+
GH_TOKEN: $(gh.token)

.ci/azure/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jobs:
2-
- job:
2+
- job: BuildDocs
33
displayName: "Build Documentation"
44
pool:
55
vmImage: ubuntu-latest
@@ -33,4 +33,4 @@ jobs:
3333
inputs:
3434
targetPath: 'docs/_build/html'
3535
artifact: 'html_docs'
36-
parallel: true
36+
parallel: true

.ci/azure/setup_env.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ do_doc=$(echo "${DOC_BUILD:-false}" | tr '[:upper:]' '[:lower:]')
77

88
if ${is_azure}
99
then
10-
conda update --yes -n base conda
1110
if ${do_doc}
1211
then
1312
.ci/setup_headless_display.sh

.ci/azure/setup_miniconda_macos.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -ex #echo on and exit if any line fails
3+
4+
echo "arch is $ARCH"
5+
if [[ $ARCH == "X64" ]]; then
6+
MINICONDA_ARCH_LABEL="x86_64"
7+
else
8+
MINICONDA_ARCH_LABEL="arm64"
9+
fi
10+
echo $MINICONDA_ARCH_LABEL
11+
mkdir -p ~/miniconda3
12+
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-$MINICONDA_ARCH_LABEL.sh -o ~/miniconda3/miniconda.sh
13+
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
14+
rm ~/miniconda3/miniconda.sh
15+
echo "##vso[task.setvariable variable=CONDA;]${HOME}/miniconda3"

.ci/azure/test.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,16 @@ jobs:
3535
vmImage: $(image)
3636
variables:
3737
varOS: $(Agent.OS)
38+
ARCH: $(Agent.OSArchitecture)
3839
steps:
40+
- bash: .ci/azure/setup_miniconda_macos.sh
41+
displayName: Install miniconda on mac
42+
condition: eq(variables.varOS, 'Darwin')
43+
3944
- bash: echo "##vso[task.prependpath]$CONDA/bin"
4045
displayName: Add conda to PATH
4146
condition: ne(variables.varOS, 'Windows_NT')
4247

43-
- bash: sudo chown -R $USER $CONDA
44-
displayName: Take ownership of conda directory
45-
condition: eq(variables.varOS, 'Darwin')
46-
4748
- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
4849
displayName: Add conda to PATH
4950
condition: eq(variables.varOS, 'Windows_NT')

.ci/azure/wheels.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.ci/environment_test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,23 @@ channels:
44
dependencies:
55
- numpy>=1.22.4
66
- scipy>=1.8
7+
78
# optionals
89
- vtk>=6
910
- pyvista
1011
- omf
1112
- matplotlib
13+
1214
# documentation
1315
- sphinx
14-
- pydata-sphinx-theme==0.13.3
16+
- pydata-sphinx-theme==0.15.4
1517
- sphinx-gallery>=0.1.13
1618
- numpydoc>=1.5
1719
- jupyter
1820
- graphviz
19-
- pymatsolver>=0.1.2
2021
- pillow
2122
- pooch
23+
2224
# testing
2325
- sympy
2426
- pytest
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build Distribution artifacts
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
# macos-13 is an intel runner, macos-14 is apple silicon
12+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Build wheels
20+
uses: pypa/cibuildwheel@v2.21.3
21+
# env:
22+
# CIBW_SOME_OPTION: value
23+
# ...
24+
# with:
25+
# package-dir: .
26+
# output-dir: wheelhouse
27+
# config-file: "{package}/pyproject.toml"
28+
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
32+
path: ./wheelhouse/*.whl
33+
34+
build_sdist:
35+
name: Build source distribution
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
42+
- name: Build sdist
43+
run: pipx run build --sdist
44+
45+
- uses: actions/upload-artifact@v4
46+
with:
47+
name: cibw-sdist
48+
path: dist/*.tar.gz
49+
50+
upload_pypi:
51+
needs: [build_wheels, build_sdist]
52+
runs-on: ubuntu-latest
53+
environment: pypi
54+
permissions:
55+
id-token: write
56+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
57+
steps:
58+
- uses: actions/download-artifact@v4
59+
with:
60+
# unpacks all CIBW artifacts into dist/
61+
pattern: cibw-*
62+
path: dist
63+
merge-multiple: true
64+
65+
- uses: pypa/gh-action-pypi-publish@release/v1
66+
# with:
67+
# To test: repository-url: https://test.pypi.org/legacy/

azure-pipelines.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ pr:
1515
exclude:
1616
- '*no-ci*'
1717

18+
variables:
19+
BRANCH_NAME: $(Build.SourceBranchName)
20+
IS_TAG: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/')]
21+
IS_MAIN: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
22+
1823
stages:
1924
- stage: StyleChecks
2025
displayName: "Style Checks"
@@ -31,28 +36,12 @@ stages:
3136
jobs:
3237
- template: .ci/azure/docs.yml
3338

34-
- stage: BuildWheels
35-
dependsOn:
36-
- Testing
37-
- DocBuild
38-
displayName: "Build Wheels"
39-
jobs:
40-
- template: .ci/azure/wheels.yml
41-
42-
- stage: BuildSource
39+
- stage: Deploy
40+
displayName: "Deploy Docs"
4341
dependsOn:
4442
- Testing
4543
- DocBuild
46-
displayName: "Build Source distribution"
47-
jobs:
48-
- template: .ci/azure/sdist.yml
49-
50-
- stage: Deploy
51-
displayName: "Deploy Source, Wheels, and Docs"
52-
dependsOn:
53-
- BuildWheels
54-
- BuildSource
55-
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
44+
condition: and(succeeded(), or(eq(variables.IS_TAG, true), eq(variables.IS_MAIN, true)))
5645
jobs:
5746
- template: .ci/azure/deploy.yml
5847

0 commit comments

Comments
 (0)