update windows wheel ci jobs to use pyenv, add py312 job

This commit is contained in:
pacrob
2024-01-31 11:02:54 -07:00
committed by Paul Robinson
parent b853f5ccdf
commit 2eff6f8be8
2 changed files with 76 additions and 29 deletions

View File

@ -39,28 +39,51 @@ common: &common
orbs: orbs:
win: circleci/windows@5.0.0 win: circleci/windows@5.0.0
windows_steps: &windows_steps windows-wheel-steps:
executor: windows-wheel-setup: &windows-wheel-setup
name: win/default executor:
shell: bash.exe name: win/default
working_directory: C:\Users\circleci\project\<REPO_NAME> shell: bash.exe
steps: working_directory: C:\Users\circleci\project\<REPO_NAME>
- checkout environment:
- restore_cache: TOXENV: windows-wheel
keys: restore-cache-step: &restore-cache-step
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} restore_cache:
- run: keys:
name: install dependencies - cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
command: | install-pyenv-step: &install-pyenv-step
python -m pip install --upgrade pip run:
python -m pip install tox name: install pyenv
- run: command: |
name: run tox pip install pyenv-win --target $HOME/.pyenv
command: python -m tox run -r echo 'export PYENV="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
- save_cache: echo 'export PYENV_ROOT="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
paths: echo 'export PYENV_USERPROFILE="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
- .tox echo 'export PATH="$PATH:$HOME/.pyenv/pyenv-win/bin"' >> $BASH_ENV
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }} echo 'export PATH="$PATH:$HOME/.pyenv/pyenv-win/shims"' >> $BASH_ENV
source $BASH_ENV
pyenv update
install-latest-python-step: &install-latest-python-step
run:
name: install latest python version and tox
command: |
LATEST_VERSION=$(pyenv install --list | grep -E "${MINOR_VERSION}\.[0-9]+$" | tail -1)
echo "installing python version $LATEST_VERSION"
pyenv install $LATEST_VERSION
pyenv global $LATEST_VERSION
python3 -m pip install --upgrade pip
python3 -m pip install tox
run-tox-step: &run-tox-step
run:
name: run tox
command: |
echo 'running tox with' $(python3 --version)
python3 -m tox run -r
save-cache-step: &save-cache-step
save_cache:
paths:
- .tox
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
jobs: jobs:
docs: docs:
@ -163,10 +186,31 @@ jobs:
environment: environment:
TOXENV: py312-wheel TOXENV: py312-wheel
py311-wheel-windows: py311-windows-wheel:
<<: *windows_steps <<: *windows-wheel-setup
environment: steps:
TOXENV: py311-wheel-windows - checkout
- <<: *restore-cache-step
- <<: *install-pyenv-step
- run:
name: set minor version
command: echo "export MINOR_VERSION='3.11'" >> $BASH_ENV
- <<: *install-latest-python-step
- <<: *run-tox-step
- <<: *save-cache-step
py312-windows-wheel:
<<: *windows-wheel-setup
steps:
- checkout
- <<: *restore-cache-step
- <<: *install-pyenv-step
- run:
name: set minor version
command: echo "export MINOR_VERSION='3.12'" >> $BASH_ENV
- <<: *install-latest-python-step
- <<: *run-tox-step
- <<: *save-cache-step
workflows: workflows:
version: 2 version: 2
@ -188,4 +232,5 @@ workflows:
- py310-wheel - py310-wheel
- py311-wheel - py311-wheel
- py312-wheel - py312-wheel
- py311-wheel-windows - py311-windows-wheel
- py312-windows-wheel

View File

@ -3,7 +3,7 @@ envlist=
py{38,39,310,311,312}-core py{38,39,310,311,312}-core
py{38,39,310,311,312}-lint py{38,39,310,311,312}-lint
py{38,39,310,311,312}-wheel py{38,39,310,311,312}-wheel
py311-wheel-windows windows-wheel
docs docs
[flake8] [flake8]
@ -19,6 +19,7 @@ commands=
docs: make check-docs docs: make check-docs
basepython= basepython=
docs: python docs: python
windows-wheel: python
py38: python3.8 py38: python3.8
py39: python3.9 py39: python3.9
py310: python3.10 py310: python3.10
@ -50,13 +51,14 @@ commands=
python -c "import <MODULE_NAME>" python -c "import <MODULE_NAME>"
skip_install=true skip_install=true
[testenv:py311-wheel-windows] [testenv:windows-wheel]
deps= deps=
wheel wheel
build[virtualenv] build[virtualenv]
allowlist_externals= allowlist_externals=
bash.exe bash.exe
commands= commands=
python --version
python -m pip install --upgrade pip python -m pip install --upgrade pip
bash.exe -c "rm -rf build dist" bash.exe -c "rm -rf build dist"
python -m build python -m build