88# ---- Default values to be merged into tasks ----
99
1010env :
11- LC_ALL : C.UTF-8
12- LANG : C.UTF-8
11+ LC_ALL : C
12+ LC_CTYPE : UTF-8
13+ LANG : C
1314 PIP_CACHE_DIR : ${CIRRUS_WORKING_DIR}/.cache/pip
1415 PRE_COMMIT_HOME : ${CIRRUS_WORKING_DIR}/.cache/pre-commit
16+ CIRRUS_ARTIFACT_URL : https://api.cirrus-ci.com/v1/artifact/build/${CIRRUS_BUILD_ID}
1517 # Coveralls configuration
1618 CI_NAME : cirrus-ci
1719 CI_BRANCH : ${CIRRUS_BRANCH}
4951 alias : test
5052 depends_on : [build]
5153 << : *task-template
52- dist_cache : {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download
54+ download_artifact_script : &download-artifact
55+ - curl -L -O ${CIRRUS_ARTIFACT_URL}/build/upload/dist.tar.gz
56+ - tar xzf dist.tar.gz
57+ - rm dist.tar.gz
5358 test_script :
5459 - tox --installpkg dist/*.whl -- -rfEx --durations 10 --color yes
5560 submit_coverage_script :
5661 - pipx run coverage xml -o coverage.xml
57- - pipx run coveralls --submit coverage.xml
62+ - pipx run 'coveralls<4' --submit coverage.xml
63+ # ^-- https://github.com/TheKevJames/coveralls-python/issues/434
5864
5965# Deep clone script for POSIX environments (required for setuptools-scm)
6066.clone_script : &clone |
@@ -70,113 +76,108 @@ env:
7076# ---- CI Pipeline ----
7177
7278build_task :
73- name : build (Linux - 3.10 )
79+ name : build and check (Linux - 3.11 )
7480 alias : build
75- container : {image: "python:3.10 -bullseye"}
81+ container : {image: "python:3.11 -bullseye"}
7682 clone_script : *clone
77- dist_cache : # build once and upload to be used by other tasks
78- folder : dist
79- fingerprint_script : echo $CIRRUS_BUILD_ID
80- reupload_on_changes : true
81- << : *task-template
82- install_script : pip install tox
83- build_script : tox -e clean,build
84-
85- check_task :
86- name : check (Linux - 3.11)
87- alias : check
88- depends_on : [build]
89- container : {image: "python:3.11-bullseye"} # most recent => better types
90- dist_cache : {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download
9183 << : *task-template
92- install_script : pip install tox
84+ install_script : pip install tox pre-commit
85+ build_script :
86+ - tox -e clean,build
87+ - tar czf dist.tar.gz dist
9388 check_script : tox --installpkg dist/*.whl -e lint,typecheck
89+ upload_artifacts :
90+ path : dist.tar.gz
9491
9592linux_task :
9693 matrix :
97- - name : test (Linux - 3.7)
98- container : {image: "python:3.7-bullseye"}
9994 - name : test (Linux - 3.8)
100- container : {image: "python:3.8-bullseye"}
101- - name : test (Linux - 3.9)
102- container : {image: "python:3.9-bullseye"}
95+ container : {image: "python:3.8-bookworm"}
10396 - name : test (Linux - 3.10)
104- container : {image: "python:3.10-bullseye"}
105- - name : test (Linux - 3.11)
106- container : {image: "python:3.11-bullseye"}
97+ container : {image: "python:3.10-bookworm"}
98+ skip : $BRANCH !=~ "^(main|master)$"
10799 - name : test (Linux - 3.12)
108- container : {image: "python:3.12-rc-bullseye"}
109- allow_failures : true # Experimental
100+ container : {image: "python:3.12-bookworm"}
101+ # - name: test (Linux - 3.13)
102+ # container: {image: "python:3.13-rc-bookworm"}
103+ # allow_failures: true # Experimental
110104 install_script :
111105 - python -m pip install --upgrade pip tox pipx
112106 << : *test-template
107+ alias : base-test
113108
114109mamba_task :
115110 name : test (Linux - mambaforge)
116111 container : {image: "condaforge/mambaforge"}
117112 install_script : # Overwrite template
118- - mamba install -y pip pipx tox
113+ - mamba install -y pip pipx tox curl
119114 << : *test-template
115+ depends_on : [base-test]
120116
121117macos_task :
122118 name : test (macOS - brew)
123119 macos_instance :
124- image : ghcr.io/cirruslabs/macos-monterey-xcode
125- brew_cache : {folder: "$HOME/Library/Caches/Homebrew"}
126- install_script : brew install python tox pipx
120+ image : ghcr.io/cirruslabs/macos-runner:sonoma
127121 env :
128122 PATH : " /opt/homebrew/opt/python/libexec/bin:${PATH}"
123+ brew_cache : {folder: "$HOME/Library/Caches/Homebrew"}
124+ install_script : brew install python tox pipx
129125 << : *test-template
126+ depends_on : [build, base-test]
130127
131128freebsd_task :
132- name : test (freebsd - 3.9 )
133- freebsd_instance : {image_family: freebsd-13-1 }
129+ name : test (freebsd - 3.11 )
130+ freebsd_instance : {image_family: freebsd-14-0 }
134131 install_script :
135132 - pkg remove -y python lang/python
136- - pkg install -y git python39 py39 -pip py39 -gdbm py39 -sqlite3 py39 -tox py39-pipx py39-tomli
137- - ln -s /usr/local/bin/python3.9 /usr/local/bin/python
133+ - pkg install -y git python311 py311 -pip py311 -gdbm py311 -sqlite3 py311 -tox py311-tomli py311-pipx
134+ - ln -s /usr/local/bin/python3.11 /usr/local/bin/python
138135 << : *test-template
136+ depends_on : [build, base-test]
139137
140138windows_task :
141- name : test (Windows - 3.9.10 )
139+ name : test (Windows - 3.12.5 )
142140 windows_container :
143141 image : " cirrusci/windowsservercore:2019"
144142 os_version : 2019
145143 env :
146144 CIRRUS_SHELL : bash
147- PATH : /c/Python39 :/c/Python39 /Scripts:/c/tools:${PATH}
145+ PATH : /c/Python312 :/c/Python312 /Scripts:/c/tools:${PATH}
148146 install_script :
149147 # Activate long file paths to avoid some errors
150148 - ps : New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
151- - choco install -y --no-progress python3 --version=3.9.10 --params "/NoLockdown"
149+ - choco install -y --no-progress python3 --version=3.12.5 --params "/NoLockdown"
150+ - choco install -y --no-progress curl
152151 - pip install --upgrade certifi
153152 - python -m pip install -U pip tox pipx
154153 << : *test-template
154+ depends_on : [build, base-test]
155155
156156finalize_task :
157157 container : {image: "python:3.10-bullseye"}
158158 depends_on : [test]
159159 << : *task-template
160- install_script : pip install coveralls
160+ install_script : pip install 'coveralls<4'
161+ # ^-- https://github.com/TheKevJames/coveralls-python/issues/434
161162 finalize_coverage_script : coveralls --finish
162163
163164linkcheck_task :
164165 name : linkcheck (Linux - 3.10)
166+ only_if : $BRANCH =~ "^(main|master)$"
165167 container : {image: "python:3.10-bullseye"}
166168 depends_on : [finalize]
167169 allow_failures : true
168- dist_cache : {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download
169170 << : *task-template
170171 install_script : pip install tox
172+ download_artifact_script : *download-artifact
171173 linkcheck_script : tox --installpkg dist/*.whl -e linkcheck -- -q
172174
173175publish_task :
174176 name : publish (Linux - 3.10)
175- container : {image: "python:3.10-bullseye "}
176- depends_on : [check, build , test]
177+ container : {image: "python:3.10-bookworm "}
178+ depends_on : [build, base-test , test]
177179 only_if : $CIRRUS_TAG =~ 'v\d.*' && $CIRRUS_USER_PERMISSION == "admin"
178180 << : *task-template
179- dist_cache : {folder: dist, fingerprint_script: echo $CIRRUS_BUILD_ID} # download
180181 env :
181182 TWINE_REPOSITORY : pypi
182183 TWINE_USERNAME : __token__
@@ -187,6 +188,7 @@ publish_task:
187188 # - https://pypi.org/help/#apitoken
188189 # - https://cirrus-ci.org/guide/writing-tasks/#encrypted-variables
189190 install_script : pip install tox
191+ download_artifact_script : *download-artifact
190192 publish_script :
191193 - ls dist/*
192194 - tox -e publish
0 commit comments