Skip to content

Commit c66f892

Browse files
committed
Merge branch 'main' into 1.0.0_alpha
2 parents 01fd7e1 + 2cb2ff4 commit c66f892

81 files changed

Lines changed: 949 additions & 1091 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.

.azure-pipelines/azure-pipelines-linux.yml

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

.azure-pipelines/azure-pipelines-osx.yml

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

.azure-pipelines/azure-pipelines-win.yml

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

.ci/azure/deploy.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
jobs:
2+
- job:
3+
displayName: "Deploy Docs and source"
4+
pool:
5+
vmImage: ubuntu-latest
6+
steps:
7+
# No need to checkout the repo here!
8+
- checkout: none
9+
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'
22+
23+
- task: DownloadPipelineArtifact@2
24+
inputs:
25+
buildType: 'current'
26+
artifactName: 'html_docs'
27+
targetPath: 'html'
28+
29+
- bash: |
30+
ls -l dist
31+
ls -l html
32+
33+
- bash: |
34+
git config --global user.name ${GH_NAME}
35+
git config --global user.email ${GH_EMAIL}
36+
git config --list | grep user.
37+
displayName: 'Configure git'
38+
env:
39+
GH_NAME: $(gh.name)
40+
GH_EMAIL: $(gh.email)
41+
42+
- bash: |
43+
twine upload --skip-existing dist/*
44+
displayName: Deploy source and wheels
45+
env:
46+
TWINE_USERNAME: $(twine.username)
47+
TWINE_PASSWORD: $(twine.password)
48+
49+
# upload documentation to discretize-docs gh-pages on tags
50+
- bash: |
51+
git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
52+
cd discretize-docs
53+
git gc --prune=now
54+
git remote prune origin
55+
rm -rf en/main/*
56+
cp -r html/* en/main/
57+
touch .nojekyll
58+
git add .
59+
git commit -am "Azure CI commit ref $(Build.SourceVersion)"
60+
git push
61+
displayName: Push documentation to discretize-docs
62+
env:
63+
GH_TOKEN: $(gh.token)

.ci/azure/docs.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
jobs:
2+
- job:
3+
displayName: "Build Documentation"
4+
pool:
5+
vmImage: ubuntu-latest
6+
variables:
7+
python.version: "3.11"
8+
doc.build: True
9+
PYVISTA_OFF_SCREEN: True
10+
DISPLAY: ":99"
11+
steps:
12+
- bash:
13+
git fetch --tags
14+
displayName: Fetch tags
15+
16+
- bash: echo "##vso[task.prependpath]$CONDA/bin"
17+
displayName: Add conda to PATH
18+
19+
- bash: .ci/azure/setup_env.sh
20+
displayName: Setup discretize environment
21+
22+
- bash: |
23+
source activate discretize-test
24+
make -C docs html
25+
displayName: 'Building HTML'
26+
27+
- bash: |
28+
source activate discretize-test
29+
make -C docs linkcheck
30+
displayName: 'Checking Links'
31+
32+
- task: PublishPipelineArtifact@1
33+
inputs:
34+
targetPath: 'docs/_build/html'
35+
artifact: 'html_docs'
36+
parallel: true

.ci/azure/run_tests.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
set -ex #echo on and exit if any line fails
3+
4+
# TF_BUILD is set to True on azure pipelines.
5+
is_azure=$(echo "${TF_BUILD:-false}" | tr '[:upper:]' '[:lower:]')
6+
do_doc=$(echo "${DOC_BUILD:-false}" | tr '[:upper:]' '[:lower:]')
7+
do_cov=$(echo "${COVERAGE:-false}" | tr '[:upper:]' '[:lower:]')
8+
9+
test_args=""
10+
11+
source activate discretize-test
12+
13+
if ${do_doc}
14+
then
15+
if ${is_azure}
16+
then
17+
.ci/setup_headless_display.sh
18+
fi
19+
fi
20+
if ${do_cov}
21+
then
22+
echo "Testing with coverage"
23+
test_args="--cov --cov-config=pyproject.toml $test_args"
24+
fi
25+
26+
pytest -vv $test_args
27+
28+
if ${do_cov}
29+
then
30+
coverage xml
31+
fi
32+

.ci/azure/sdist.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
jobs:
2+
- job:
3+
displayName: "Build source dist."
4+
pool:
5+
vmImage: ubuntu-latest
6+
steps:
7+
- task: UsePythonVersion@0
8+
inputs:
9+
versionSpec: "3.11"
10+
11+
- bash:
12+
git fetch --tags
13+
displayName: Fetch tags
14+
15+
- bash: |
16+
set -o errexit
17+
python -m pip install --upgrade pip
18+
pip install build
19+
displayName: Install source build tools.
20+
21+
- bash: |
22+
python -m build --skip-dependency-check --sdist .
23+
ls -la dist
24+
displayName: Build Source
25+
26+
- task: PublishPipelineArtifact@1
27+
inputs:
28+
targetPath: 'dist'
29+
artifact: 'source_dist'

.ci/azure/setup_env.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -ex #echo on and exit if any line fails
3+
4+
# TF_BUILD is set to True on azure pipelines.
5+
is_azure=$(echo "${TF_BUILD:-false}" | tr '[:upper:]' '[:lower:]')
6+
do_doc=$(echo "${DOC_BUILD:-false}" | tr '[:upper:]' '[:lower:]')
7+
8+
if ${is_azure}
9+
then
10+
conda update --yes -n base conda
11+
if ${do_doc}
12+
then
13+
.ci/setup_headless_display.sh
14+
fi
15+
fi
16+
17+
cp .ci/environment_test.yml environment_test_with_pyversion.yml
18+
echo " - python="$PYTHON_VERSION >> environment_test_with_pyversion.yml
19+
20+
conda env create --file environment_test_with_pyversion.yml
21+
rm environment_test_with_pyversion.yml
22+
23+
if ${is_azure}
24+
then
25+
source activate discretize-test
26+
pip install pytest-azurepipelines
27+
else
28+
conda activate discretize-test
29+
fi
30+
31+
# The --vsenv config setting will prefer msvc compilers on windows.
32+
# but will do nothing on mac and linux.
33+
pip install --no-build-isolation --editable . --config-settings=setup-args="--vsenv"
34+
35+
echo "Conda Environment:"
36+
conda list
37+
38+
echo "Installed discretize version:"
39+
python -c "import discretize; print(discretize.__version__)"

.ci/azure/style.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
jobs:
2+
- job:
3+
displayName: Run style checks with Black
4+
pool:
5+
vmImage: ubuntu-latest
6+
steps:
7+
- task: UsePythonVersion@0
8+
inputs:
9+
versionSpec: "3.11"
10+
- bash: .ci/install_style.sh
11+
displayName: "Install dependencies to run the checks"
12+
- script: black --check .
13+
displayName: "Run black"
14+
15+
- job:
16+
displayName: Run (permissive) style checks with flake8
17+
pool:
18+
vmImage: ubuntu-latest
19+
steps:
20+
- task: UsePythonVersion@0
21+
inputs:
22+
versionSpec: "3.11"
23+
- bash: .ci/install_style.sh
24+
displayName: "Install dependencies to run the checks"
25+
- script: flake8
26+
displayName: "Run flake8"

0 commit comments

Comments
 (0)