[go: up one dir, main page]

Skip to content

Commit

Permalink
update windows wheel ci jobs to use pyenv, add py312 job
Browse files Browse the repository at this point in the history
  • Loading branch information
pacrob committed Jan 31, 2024
1 parent b853f5c commit 2eff6f8
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 29 deletions.
99 changes: 72 additions & 27 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,51 @@ common: &common
orbs:
win: circleci/windows@5.0.0

windows_steps: &windows_steps
executor:
name: win/default
shell: bash.exe
working_directory: C:\Users\circleci\project\<REPO_NAME>
steps:
- checkout
- restore_cache:
keys:
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
- run:
name: install dependencies
command: |
python -m pip install --upgrade pip
python -m pip install tox
- run:
name: run tox
command: python -m tox run -r
- save_cache:
paths:
- .tox
key: cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
windows-wheel-steps:
windows-wheel-setup: &windows-wheel-setup
executor:
name: win/default
shell: bash.exe
working_directory: C:\Users\circleci\project\<REPO_NAME>
environment:
TOXENV: windows-wheel
restore-cache-step: &restore-cache-step
restore_cache:
keys:
- cache-v1-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
install-pyenv-step: &install-pyenv-step
run:
name: install pyenv
command: |
pip install pyenv-win --target $HOME/.pyenv
echo 'export PYENV="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
echo 'export PYENV_ROOT="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
echo 'export PYENV_USERPROFILE="$HOME/.pyenv/pyenv-win/"' >> $BASH_ENV
echo 'export PATH="$PATH:$HOME/.pyenv/pyenv-win/bin"' >> $BASH_ENV
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:
docs:
Expand Down Expand Up @@ -163,10 +186,31 @@ jobs:
environment:
TOXENV: py312-wheel

py311-wheel-windows:
<<: *windows_steps
environment:
TOXENV: py311-wheel-windows
py311-windows-wheel:
<<: *windows-wheel-setup
steps:
- 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:
version: 2
Expand All @@ -188,4 +232,5 @@ workflows:
- py310-wheel
- py311-wheel
- py312-wheel
- py311-wheel-windows
- py311-windows-wheel
- py312-windows-wheel
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ envlist=
py{38,39,310,311,312}-core
py{38,39,310,311,312}-lint
py{38,39,310,311,312}-wheel
py311-wheel-windows
windows-wheel
docs

[flake8]
Expand All @@ -19,6 +19,7 @@ commands=
docs: make check-docs
basepython=
docs: python
windows-wheel: python
py38: python3.8
py39: python3.9
py310: python3.10
Expand Down Expand Up @@ -50,13 +51,14 @@ commands=
python -c "import <MODULE_NAME>"
skip_install=true

[testenv:py311-wheel-windows]
[testenv:windows-wheel]
deps=
wheel
build[virtualenv]
allowlist_externals=
bash.exe
commands=
python --version
python -m pip install --upgrade pip
bash.exe -c "rm -rf build dist"
python -m build
Expand Down

0 comments on commit 2eff6f8

Please sign in to comment.