Skip to content

Add a CircleCI Windows build #246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 76 additions & 61 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
orbs:
win: circleci/[email protected]

windows-tmpl: &windows-tmpl
parameters:
python-version:
type: string
executor:
name: win/default
shell: bash.exe
steps:
- checkout
- run:
name: Set up Python
command: |
set -e
. install.sh
install_windows_make
install_windows_python << parameters.python_version >>
init_venv python
- run:
name: Install dependencies
command: |
python --version
make develop
- run:
name: Run tests
command: |
export DEBUG=1
export SERVER_FIXTURES_JENKINS_WAR=
export PACKAGES=$(./foreach.sh --quiet 'grep -q Windows setup.py && echo $PKG || true')
make test-ci
- store_test_results:
path: junit
- run:
name: Check for failures
command: make list-test-failures

test-tmpl: &test-tmpl
command: |
Expand Down Expand Up @@ -152,47 +189,22 @@ job-tmpl: &job-tmpl
- ./*
- ./dist/*

version: 2
version: 2.1
jobs:
py36:
python-ubuntu:
<<: *job-tmpl
parameters:
python_version:
type: string
environment:
PYTHON: "python3.6"

py37:
<<: *job-tmpl
environment:
PYTHON: "python3.7"

py38:
<<: *job-tmpl
environment:
PYTHON: "python3.8"

py39:
<<: *job-tmpl
environment:
PYTHON: "python3.9"

py310:
<<: *job-tmpl
environment:
PYTHON: "python3.10"

py311:
<<: *job-tmpl
environment:
PYTHON: "python3.11"

py312:
<<: *job-tmpl
environment:
PYTHON: "python3.12"

py313:
<<: *job-tmpl
PYTHON: << parameters.python_version >>
python-windows:
<<: *windows-tmpl
parameters:
python_version:
type: string
environment:
PYTHON: "python3.13"
PYTHON: << parameters.python_version >>

pypi-release:
docker:
Expand Down Expand Up @@ -253,38 +265,41 @@ workflows:
version: 2
pytest-plugins:
jobs:
- py36
- py37
- py38
- py39
- py310
- py311
- py312
- py313
- python-windows:
matrix:
parameters:
python_version:
- "python3.6"
- "python3.7"
- "python3.8"
- "python3.9"
- "python3.10"
- "python3.11"
- "python3.12"
- python-ubuntu:
matrix:
parameters:
python_version:
- "python3.6"
- "python3.7"
- "python3.8"
- "python3.9"
- "python3.10"
- "python3.11"
- "python3.12"
- "python3.13"
- pypi-release:
requires:
- py36
- py37
- py38
- py39
- py310
- py311
- py312
- py313
- python-ubuntu
- python-windows
filters:
branches:
only:
- master
- publish-github-release:
requires:
- py36
- py37
- py38
- py39
- py310
- py311
- py312
- py313
- python-ubuntu
- python-windows
filters:
branches:
only:
Expand Down
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

6 changes: 5 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog
### 1.8.0 (2024-10-??)
### 1.8.1 (2024-10-??)
* All: Windows builds added to CircleCI
* All: Started building py3.6-py3.13 in CircleCI

### 1.8.0 (2024-10-17)
* All: Drop support for Python 2 and <3.6, removing compatibility code.
* All: Use stdlib unittest.mock instead of mock package.
* All: Removed usage of path.py and path in favour of pathlib. #174 #224
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ test:

test-ci:
rm -f FAILED-*
./foreach.sh 'cat *.egg-info/top_level.txt | xargs -Ipysrc coverage run -p --source=pysrc setup.py test -sv -ra --timeout 120 || touch ../FAILED-$$PKG'
mkdir junit
./foreach.sh 'cat *.egg-info/top_level.txt | xargs -Ipysrc coverage run -p --source=pysrc -m pytest --junitxml junit.xml -svvvv -ra || touch ../FAILED-$$PKG'
./foreach.sh 'cp junit.xml ../junit/junit-$PKG.xml || true'

list-test-failures:
@if compgen -G 'FAILED-*' > /dev/null; then \
echo "Error: Found failure artifacts:"; \
compgen -G 'FAILED-*'; \
exit 1; \
else \
echo "No failure artifacts found."; \
fi

upload:
pip install twine
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# A goody-bag of nifty plugins for [pytest](https://pytest.org)

OS | Build | Coverage |
------ | ----- | -------- |
![Linux](img/linux.png) | [![CircleCI (Linux)](https://circleci.com/gh/man-group/pytest-plugins/tree/master.svg?style=svg)](https://circleci.com/gh/man-group/pytest-plugins/tree/master) | [![Coverage Status](https://coveralls.io/repos/github/manahl/pytest-plugins/badge.svg?branch=master)](https://coveralls.io/github/manahl/pytest-plugins?branch=master)
![Windows](img/windows.png) | [![Travic CI (Windows)](https://travis-ci.org/man-group/pytest-plugins.svg?branch=master)](https://travis-ci.org/man-group/pytest-plugins) |
OS | Build | Coverage |
------ |------------------------------------------------------------------------------------------------------------------------------------------------------------------| -------- |
![Linux](img/linux.png) | [![CircleCI (Linux)](https://circleci.com/gh/man-group/pytest-plugins/tree/master.svg?style=svg)](https://circleci.com/gh/man-group/pytest-plugins/tree/master) | [![Coverage Status](https://coveralls.io/repos/github/manahl/pytest-plugins/badge.svg?branch=master)](https://coveralls.io/github/manahl/pytest-plugins?branch=master)
![Windows](img/windows.png) | [![CircleCI (Linux)](https://circleci.com/gh/man-group/pytest-plugins/tree/master.svg?style=svg)](https://circleci.com/gh/man-group/pytest-plugins/tree/master) |

Plugin | Description | Supported OS |
------ | ----------- | ------------ |
Expand Down
46 changes: 18 additions & 28 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ function install_python {

function choco_install {
local args=$*
# choco fails randomly with network errors on travis, have a few goes
for i in {1..5}; do
choco install $args && return 0
echo 'choco install failed, log tail follows:'
Expand All @@ -71,35 +70,26 @@ function install_windows_make {
choco_install make --params "/InstallDir:C:\\tools\\make"
}


function install_windows_py27 {
choco_install python2 --params "/InstallDir:C:\\Python"
export PATH="/c/Python:/c/Python/Scripts:$PATH"
install_python_packaging python
}


function install_windows_py35 {
choco_install python --version 3.5.4 --params "/InstallDir:C:\\Python"
export PATH="/c/Python35:/c/Python35/Scripts:$PATH"
install_python_packaging python
function install_windows_python() {
if [ -z "$1" ]; then
echo "Please provide a Python version argument, e.g., 'python3.11'"
return 1
fi
python_arg="$1"
python_version="${python_arg#python}"
major_version="${python_version%%.*}"
minor_version="${python_version#*.}"
choco_package="python${major_version}${minor_version}"
install_dir="/c/Python${major_version}${minor_version}"
choco_install "$choco_package" --params "/InstallDir:C:\\Python" -y
if [ $? -ne 0 ]; then
echo "Failed to install Python $python_version"
return 1
fi
export PATH="$install_dir:$install_dir/Scripts:$PATH"
install_python_packaging python
}


function install_windows_py36 {
choco_install python --version 3.6.8 --params "/InstallDir:C:\\Python"
export PATH="/c/Python36:/c/Python36/Scripts:$PATH"
install_python_packaging python
}


function install_windows_py37 {
choco_install python --version 3.7.5 --params "/InstallDir:C:\\Python"
export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
install_python_packaging python
}


function init_venv {
local py=$1
virtualenv venv --python=$py
Expand Down
Loading