Skip to content

Commit d25aef6

Browse files
authored
Circleci project setup (#25)
* remove reference figures they will from now on only be uploaded as artifacts on CircleCI * remove unnecessary ci scripts * Add .circleci/config.yml * update conda environment for docs * split test_plotters.py into multiple files * run tests in parallel * revise handling of reference figures * revert x and y for streamplot if not positive increasing * add pipeline parameters to conditionally run jobs
1 parent 150310a commit d25aef6

Some content is hidden

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

71 files changed

+3199
-3160
lines changed

.appveyor.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
environment:
2+
3+
PYTHON_ARCH: "64"
4+
PYTHON: "C:\\Miniconda38-x64"
5+
6+
matrix:
7+
- PYTHON_VERSION: "3.8"
8+
9+
install:
10+
# windows config (for installation)
11+
- cmd: "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
12+
- cmd: setlocal
13+
- cmd: set ANACONDA_API_TOKEN=
14+
# conda config
15+
- conda config --set always_yes yes --set changeps1 no
16+
- conda update -q conda
17+
- conda install conda-build anaconda-client
18+
- pip install -i https://pypi.anaconda.org/psyplot/simple --no-deps psyplot-ci-orb
19+
- conda config --add channels conda-forge
20+
- conda config --add channels psyplot
21+
- conda info -a
22+
- conda list
23+
# windows config
24+
- cmd: endlocal
25+
- cmd: 'SET PYTHONWARNINGS=ignore:mode:DeprecationWarning:docutils.io:245'
26+
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (SET GIT_BRANCH=%APPVEYOR_REPO_BRANCH%)"
27+
- cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (conda config --add channels psyplot/label/%APPVEYOR_REPO_BRANCH:/=-%)"
28+
- cmd: "set PSYPLOT_REFERENCES=%APPVEYOR_BUILD_FOLDER%/tests/reference_figures"
29+
- cmd: "set PSYPLOT_TESTFIGURES=%APPVEYOR_BUILD_FOLDER%/tests/test_figures"
30+
31+
build: off
32+
33+
test_script:
34+
- cmd: setlocal
35+
- cmd: set ANACONDA_API_TOKEN=
36+
- cmd: conda build ci/conda-recipe --python %PYTHON_VERSION%
37+
- cmd: endlocal
38+
39+
after_test:
40+
- cmd: 7z a reference_figures.zip %APPVEYOR_BUILD_FOLDER%\tests\reference_figures\*.png
41+
- cmd: 7z a test_figures.zip %APPVEYOR_BUILD_FOLDER%\tests\test_figures\*.png
42+
43+
deploy_script:
44+
- cmd: "
45+
IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (
46+
deploy-conda-recipe -l %APPVEYOR_REPO_BRANCH% -py %PYTHON_VERSION% ci/conda-recipe
47+
) ELSE (
48+
deploy-conda-recipe -py %PYTHON_VERSION% ci/conda-recipe
49+
)"
50+
51+
artifacts:
52+
- path: reference_figures.zip
53+
name: Reference figures
54+
- path: test_figures.zip
55+
name: Test figures

.circleci/config.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
version: 2.1
2+
3+
orbs:
4+
psyplot: psyplot/psyplot-ci-orb@1.5.19
5+
mattermost-plugin-notify: nathanaelhoun/mattermost-plugin-notify@1.2.0
6+
7+
executors:
8+
default: psyplot/default
9+
macos: psyplot/macos
10+
11+
parameters:
12+
unit-test-executor:
13+
description: Executor for the unit tests. Can be default or macos
14+
type: string
15+
default: default
16+
deploy-release:
17+
description: Deploy the comment as a new release to github and pypi
18+
type: boolean
19+
default: false
20+
test-matplotlib-3_3:
21+
description: Run the test suite for matplotlib 3.3
22+
type: boolean
23+
default: true
24+
test-matplotlib-latest:
25+
description: Run the test suite for the latest version of matplotlib
26+
type: boolean
27+
default: true
28+
parallelism:
29+
description: How many parallel jobs to execute
30+
type: integer
31+
default: 2
32+
build_docs:
33+
description: Build the documentation
34+
type: boolean
35+
default: true
36+
37+
38+
workflows:
39+
build-and-test:
40+
unless: << pipeline.parameters.deploy-release >>
41+
jobs:
42+
- psyplot/install-and-build:
43+
name: install
44+
exec_environment: << pipeline.parameters.unit-test-executor >>
45+
setup_env: true
46+
build_args: "--no-test"
47+
build_docs: << pipeline.parameters.build_docs >>
48+
env_packages: pytest-cov dask psyplot-gui statsmodels netcdf4 seaborn
49+
- psyplot/test-parallel:
50+
name: test-matplotlib-latest
51+
parallelism: << pipeline.parameters.parallelism >>
52+
run-job: << pipeline.parameters.test-matplotlib-latest >>
53+
build_refs: true
54+
requires:
55+
- install
56+
- psyplot/test-parallel:
57+
name: test-matplotlib-3.3
58+
parallelism: << pipeline.parameters.parallelism >>
59+
run-job: << pipeline.parameters.test-matplotlib-3_3 >>
60+
build_refs: true
61+
packages: matplotlib=3.3
62+
requires:
63+
- install
64+
- mattermost-plugin-notify/approval-notification:
65+
name: notify-deploy
66+
context: mattermost
67+
message: >-
68+
Hello @all! A workflow on https://app.circleci.com/pipelines/github/psyplot/psy-simple is awaiting your approval.
69+
Please check the uploaded docs and builds prior to approval.
70+
requires:
71+
- test-matplotlib-latest
72+
- test-matplotlib-3.3
73+
- hold-for-deploy:
74+
type: approval
75+
requires:
76+
- notify-deploy
77+
- psyplot/deploy-pkg:
78+
exec_environment: << pipeline.parameters.unit-test-executor >>
79+
context: anaconda
80+
requires:
81+
- hold-for-deploy
82+
- psyplot/deploy-docs:
83+
fingerprint: "b8:d6:d7:30:0a:74:2c:39:7b:45:0b:cd:bc:46:69:94"
84+
run-job: << pipeline.parameters.build_docs >>
85+
requires:
86+
- hold-for-deploy
87+
filters:
88+
branches:
89+
only: main
90+
- psyplot/trigger-release-workflow:
91+
context: trigger-release
92+
filters:
93+
branches:
94+
only: main
95+
requires:
96+
- psyplot/deploy-pkg
97+
- psyplot/deploy-docs
98+
publish-release:
99+
when: << pipeline.parameters.deploy-release >>
100+
jobs:
101+
- psyplot/create-tag:
102+
ssh-fingerprints: "b8:d6:d7:30:0a:74:2c:39:7b:45:0b:cd:bc:46:69:94"
103+
context: psyplot-admin
104+
user-name: psyplot-admin
105+
publish-release: true
106+
publish-version-tag: true
107+
- mattermost-plugin-notify/approval-notification:
108+
name: notify-release
109+
context: mattermost
110+
message: >-
111+
Hello @all! A new release has been created at https://github.com/psyplot/psy-simple/releases.
112+
Please review it carefully, publish it and approve the upload to pypi.
113+
requires:
114+
- psyplot/create-tag
115+
- hold-for-pypi:
116+
type: approval
117+
requires:
118+
- notify-release
119+
- psyplot/deploy-pypi:
120+
context: pypi
121+
requires:
122+
- hold-for-pypi
123+
filters:
124+
branches:
125+
only: main

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ docs/<string>
6666
*psyplot_testresults
6767
tests/envs/cov_psyplot_py*
6868
tests/envs/psyplot_py*.html
69+
tests/reference_figures
70+
tests/test_figures
6971

7072
# PyBuilder
7173
target/

.gitmodules

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +0,0 @@
1-
[submodule "tests/reference_figures/linux/py3.6/mpl2.0"]
2-
path = tests/reference_figures/linux/py3.6/mpl2.0
3-
url = https://github.com/psyplot/psy-simple-references.git
4-
branch = linux_py3.6_mpl2.0
5-
[submodule "tests/reference_figures/win32/py3.6/mpl2.0"]
6-
path = tests/reference_figures/win32/py3.6/mpl2.0
7-
url = https://github.com/psyplot/psy-simple-references.git
8-
branch = win32_py3.6_mpl2.0
9-
[submodule "tests/reference_figures/darwin/py3.6/mpl2.0"]
10-
path = tests/reference_figures/darwin/py3.6/mpl2.0
11-
url = https://github.com/psyplot/psy-simple-references.git
12-
branch = darwin_py3.6_mpl2.0
13-
[submodule "tests/reference_figures/linux/py3.6/mpl2.1"]
14-
path = tests/reference_figures/linux/py3.6/mpl2.1
15-
url = https://github.com/psyplot/psy-simple-references.git
16-
branch = linux_py3.6_mpl2.1
17-
[submodule "tests/reference_figures/win32/py3.6/mpl2.1"]
18-
path = tests/reference_figures/win32/py3.6/mpl2.1
19-
url = https://github.com/psyplot/psy-simple-references.git
20-
branch = win32_py3.6_mpl2.1
21-
[submodule "tests/reference_figures/darwin/py3.6/mpl2.1"]
22-
path = tests/reference_figures/darwin/py3.6/mpl2.1
23-
url = https://github.com/psyplot/psy-simple-references.git
24-
branch = darwin_py3.6_mpl2.1
25-
[submodule "tests/reference_figures/linux/py3.6/mpl2.2"]
26-
path = tests/reference_figures/linux/py3.6/mpl2.2
27-
url = https://github.com/psyplot/psy-simple-references.git
28-
branch = linux_py3.6_mpl2.2
29-
[submodule "tests/reference_figures/darwin/py3.6/mpl2.2"]
30-
path = tests/reference_figures/darwin/py3.6/mpl2.2
31-
url = https://github.com/psyplot/psy-simple-references.git
32-
branch = darwin_py3.6_mpl2.2
33-
[submodule "tests/reference_figures/win32/py3.6/mpl2.2"]
34-
path = tests/reference_figures/win32/py3.6/mpl2.2
35-
url = https://github.com/psyplot/psy-simple-references.git
36-
branch = win32_py3.6_mpl2.2
37-
[submodule "tests/reference_figures/linux/py3.7/mpl3.0"]
38-
path = tests/reference_figures/linux/py3.7/mpl3.0
39-
url = https://github.com/psyplot/psy-simple-references.git
40-
branch = linux_py3.7_mpl3.0
41-
[submodule "tests/reference_figures/darwin/py3.7/mpl3.0"]
42-
path = tests/reference_figures/darwin/py3.7/mpl3.0
43-
url = https://github.com/psyplot/psy-simple-references.git
44-
branch = darwin_py3.7_mpl3.0
45-
[submodule "tests/reference_figures/win32/py3.7/mpl3.0"]
46-
path = tests/reference_figures/win32/py3.7/mpl3.0
47-
url = https://github.com/psyplot/psy-simple-references.git
48-
branch = win32_py3.7_mpl3.0
49-
[submodule "tests/reference_figures/darwin/py3.7/mpl3.1"]
50-
path = tests/reference_figures/darwin/py3.7/mpl3.1
51-
url = https://github.com/psyplot/psy-simple-references.git
52-
branch = darwin_py3.7_mpl3.1
53-
[submodule "tests/reference_figures/linux/py3.7/mpl3.1"]
54-
path = tests/reference_figures/linux/py3.7/mpl3.1
55-
url = https://github.com/psyplot/psy-simple-references.git
56-
branch = linux_py3.7_mpl3.1
57-
[submodule "tests/reference_figures/win32/py3.7/mpl3.1"]
58-
path = tests/reference_figures/win32/py3.7/mpl3.1
59-
url = https://github.com/psyplot/psy-simple-references.git
60-
branch = win32_py3.7_mpl3.1
61-
[submodule "tests/reference_figures/linux/py3.8/mpl3.1"]
62-
path = tests/reference_figures/linux/py3.8/mpl3.1
63-
url = https://github.com/psyplot/psy-simple-references.git
64-
branch = linux_py3.8_mpl3.1
65-
[submodule "tests/reference_figures/darwin/py3.8/mpl3.1"]
66-
path = tests/reference_figures/darwin/py3.8/mpl3.1
67-
url = https://github.com/psyplot/psy-simple-references.git
68-
branch = darwin_py3.8_mpl3.1
69-
[submodule "tests/reference_figures/win32/py3.8/mpl3.1"]
70-
path = tests/reference_figures/win32/py3.8/mpl3.1
71-
url = https://github.com/psyplot/psy-simple-references.git
72-
branch = win32_py3.8_mpl3.1
73-
[submodule "tests/reference_figures/linux/py3.7/mpl3.2"]
74-
path = tests/reference_figures/linux/py3.7/mpl3.2
75-
url = https://github.com/psyplot/psy-simple-references.git
76-
branch = linux_py3.7_mpl3.2
77-
[submodule "tests/reference_figures/linux/py3.7/mpl3.3"]
78-
path = tests/reference_figures/linux/py3.7/mpl3.3
79-
url = https://github.com/psyplot/psy-simple-references.git
80-
branch = linux_py3.7_mpl3.3
81-
[submodule "tests/reference_figures/linux/py3.8/mpl3.2"]
82-
path = tests/reference_figures/linux/py3.8/mpl3.2
83-
url = https://github.com/psyplot/psy-simple-references.git
84-
branch = linux_py3.8_mpl3.2
85-
[submodule "tests/reference_figures/linux/py3.8/mpl3.3"]
86-
path = tests/reference_figures/linux/py3.8/mpl3.3
87-
url = https://github.com/psyplot/psy-simple-references.git
88-
branch = linux_py3.8_mpl3.3
89-
[submodule "tests/reference_figures/darwin/py3.7/mpl3.3"]
90-
path = tests/reference_figures/darwin/py3.7/mpl3.3
91-
url = https://github.com/psyplot/psy-simple-references.git
92-
branch = darwin_py3.7_mpl3.3
93-
[submodule "tests/reference_figures/darwin/py3.8/mpl3.3"]
94-
path = tests/reference_figures/darwin/py3.8/mpl3.3
95-
url = https://github.com/psyplot/psy-simple-references.git
96-
branch = darwin_py3.8_mpl3.3
97-
[submodule "tests/reference_figures/win32/py3.7/mpl3.2"]
98-
path = tests/reference_figures/win32/py3.7/mpl3.2
99-
url = https://github.com/psyplot/psy-simple-references.git
100-
branch = win32_py3.7_mpl3.2
101-
[submodule "tests/reference_figures/win32/py3.8/mpl3.2"]
102-
path = tests/reference_figures/win32/py3.8/mpl3.2
103-
url = https://github.com/psyplot/psy-simple-references.git
104-
branch = win32_py3.8_mpl3.2

0 commit comments

Comments
 (0)