Skip to content

Commit 2eff6f8

Browse files
committed
update windows wheel ci jobs to use pyenv, add py312 job
1 parent b853f5c commit 2eff6f8

File tree

2 files changed

+76
-29
lines changed

2 files changed

+76
-29
lines changed

.circleci/config.yml

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,51 @@ common: &common
3939
orbs:
4040
win: circleci/[email protected]
4141

42-
windows_steps: &windows_steps
43-
executor:
44-
name: win/default
45-
shell: bash.exe
46-
working_directory: C:\Users\circleci\project\<REPO_NAME>
47-
steps:
48-
- checkout
49-
- restore_cache:
50-
keys:
51-
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
52-
- run:
53-
name: install dependencies
54-
command: |
55-
python -m pip install --upgrade pip
56-
python -m pip install tox
57-
- run:
58-
name: run tox
59-
command: python -m tox run -r
60-
- save_cache:
61-
paths:
62-
- .tox
63-
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
42+
windows-wheel-steps:
43+
windows-wheel-setup: &windows-wheel-setup
44+
executor:
45+
name: win/default
46+
shell: bash.exe
47+
working_directory: C:\Users\circleci\project\<REPO_NAME>
48+
environment:
49+
TOXENV: windows-wheel
50+
restore-cache-step: &restore-cache-step
51+
restore_cache:
52+
keys:
53+
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
54+
install-pyenv-step: &install-pyenv-step
55+
run:
56+
name: install pyenv
57+
command: |
58+
pip install pyenv-win --target $HOME/.pyenv
59+
echo 'export PYENV="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
60+
echo 'export PYENV_ROOT="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
61+
echo 'export PYENV_USERPROFILE="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
62+
echo 'export PATH="$PATH:$HOME/.pyenv/pyenv-win/bin"' >> $BASH_ENV
63+
echo 'export PATH="$PATH:$HOME/.pyenv/pyenv-win/shims"' >> $BASH_ENV
64+
source $BASH_ENV
65+
pyenv update
66+
install-latest-python-step: &install-latest-python-step
67+
run:
68+
name: install latest python version and tox
69+
command: |
70+
LATEST_VERSION=$(pyenv install --list | grep -E "${MINOR_VERSION}\.[0-9]+$" | tail -1)
71+
echo "installing python version $LATEST_VERSION"
72+
pyenv install $LATEST_VERSION
73+
pyenv global $LATEST_VERSION
74+
python3 -m pip install --upgrade pip
75+
python3 -m pip install tox
76+
run-tox-step: &run-tox-step
77+
run:
78+
name: run tox
79+
command: |
80+
echo 'running tox with' $(python3 --version)
81+
python3 -m tox run -r
82+
save-cache-step: &save-cache-step
83+
save_cache:
84+
paths:
85+
- .tox
86+
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
6487

6588
jobs:
6689
docs:
@@ -163,10 +186,31 @@ jobs:
163186
environment:
164187
TOXENV: py312-wheel
165188

166-
py311-wheel-windows:
167-
<<: *windows_steps
168-
environment:
169-
TOXENV: py311-wheel-windows
189+
py311-windows-wheel:
190+
<<: *windows-wheel-setup
191+
steps:
192+
- checkout
193+
- <<: *restore-cache-step
194+
- <<: *install-pyenv-step
195+
- run:
196+
name: set minor version
197+
command: echo "export MINOR_VERSION='3.11'" >> $BASH_ENV
198+
- <<: *install-latest-python-step
199+
- <<: *run-tox-step
200+
- <<: *save-cache-step
201+
202+
py312-windows-wheel:
203+
<<: *windows-wheel-setup
204+
steps:
205+
- checkout
206+
- <<: *restore-cache-step
207+
- <<: *install-pyenv-step
208+
- run:
209+
name: set minor version
210+
command: echo "export MINOR_VERSION='3.12'" >> $BASH_ENV
211+
- <<: *install-latest-python-step
212+
- <<: *run-tox-step
213+
- <<: *save-cache-step
170214

171215
workflows:
172216
version: 2
@@ -188,4 +232,5 @@ workflows:
188232
- py310-wheel
189233
- py311-wheel
190234
- py312-wheel
191-
- py311-wheel-windows
235+
- py311-windows-wheel
236+
- py312-windows-wheel

tox.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ envlist=
33
py{38,39,310,311,312}-core
44
py{38,39,310,311,312}-lint
55
py{38,39,310,311,312}-wheel
6-
py311-wheel-windows
6+
windows-wheel
77
docs
88

99
[flake8]
@@ -19,6 +19,7 @@ commands=
1919
docs: make check-docs
2020
basepython=
2121
docs: python
22+
windows-wheel: python
2223
py38: python3.8
2324
py39: python3.9
2425
py310: python3.10
@@ -50,13 +51,14 @@ commands=
5051
python -c "import <MODULE_NAME>"
5152
skip_install=true
5253

53-
[testenv:py311-wheel-windows]
54+
[testenv:windows-wheel]
5455
deps=
5556
wheel
5657
build[virtualenv]
5758
allowlist_externals=
5859
bash.exe
5960
commands=
61+
python --version
6062
python -m pip install --upgrade pip
6163
bash.exe -c "rm -rf build dist"
6264
python -m build

0 commit comments

Comments
 (0)