Skip to content

CI: add Cirrus CI jobs #241

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 6 commits into from
Dec 9, 2022
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
76 changes: 76 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
test_template: &test
test_script:
- command -v python3
- python3 --version
- python3 -m pip install .[test]
- python3 -m pytest

alpine-3_task:
container:
dockerfile: ci/alpine-3.docker
cpu: 1
<< : *test

archlinux_task:
container:
dockerfile: ci/archlinux.docker
cpu: 1
<< : *test

debian-11_task:
container:
dockerfile: ci/debian-11.docker
cpu: 1
fix-pip_script:
# see https://github.com/pypa/pip/pull/11623
- python3 -m pip install --upgrade "pip @ git+https://github.com/pypa/pip.git@refs/pull/11623/merge"
<< : *test

debian-unstable_task:
container:
dockerfile: ci/debian-unstable.docker
cpu: 1
fix-pip_script:
# see https://github.com/pypa/pip/pull/11623
- python3 -m pip install --upgrade "pip @ git+https://github.com/pypa/pip.git@refs/pull/11623/merge"
<< : *test

fedora-37_task:
container:
dockerfile: ci/fedora-37.docker
cpu: 1
<< : *test

manylinux-python3.11_task:
container:
dockerfile: ci/manylinux.docker
cpu: 1
env:
PATH: "/opt/python/cp311-cp311/bin/:${PATH}"
<< : *test

manylinux-python3.7_task:
container:
dockerfile: ci/manylinux.docker
cpu: 1
env:
PATH: "/opt/python/cp37-cp37m/bin/:${PATH}"
fix-meson_script:
# see https://github.com/mesonbuild/meson/issues/11097
- mkdir wheelhouse
- python -m pip wheel --wheel-dir wheelhouse git+https://github.com/mesonbuild/meson@refs/pull/11104/head
- echo "PIP_FIND_LINKS=$(pwd)/wheelhouse/" >> $CIRRUS_ENV
- PIP_FIND_LINKS="$(pwd)/wheelhouse/" python -m pip install meson
<< : *test

miniconda_task:
container:
dockerfile: ci/miniconda.docker
cpu: 1
<< : *test

opensuse-15_task:
container:
dockerfile: ci/opensuse-15.docker
cpu: 1
<< : *test
151 changes: 0 additions & 151 deletions .github/workflows/sage.yml

This file was deleted.

3 changes: 3 additions & 0 deletions ci/alpine-3.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 20221203
FROM alpine:3
RUN apk add --no-cache python3-dev py3-pip build-base ninja git patchelf
3 changes: 3 additions & 0 deletions ci/archlinux.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 20221203
FROM archlinux:latest
RUN pacman -Sy && pacman -S --noconfirm python python-pip gcc ninja git patchelf
3 changes: 3 additions & 0 deletions ci/debian-11.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 20221203
FROM debian:bullseye
RUN apt-get update && apt-get install -y git ninja-build patchelf python3-pip python3-venv && rm -rf /var/lib/apt/lists/*
3 changes: 3 additions & 0 deletions ci/debian-unstable.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 20221203
FROM debian:unstable
RUN apt-get update && apt-get install -y git ninja-build patchelf python3-pip python3-venv && rm -rf /var/lib/apt/lists/*
3 changes: 3 additions & 0 deletions ci/fedora-37.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 20221203
FROM fedora:37
RUN dnf -y update && dnf -y install python3-devel python3-pip gcc ninja-build git patchelf && dnf clean all
2 changes: 2 additions & 0 deletions ci/manylinux.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 20221203
FROM quay.io/pypa/manylinux_2_28_x86_64
3 changes: 3 additions & 0 deletions ci/miniconda.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 20221203
FROM continuumio/miniconda3
RUN apt-get update && apt-get install -y gcc ninja-build git patchelf && rm -rf /var/lib/apt/lists/*
3 changes: 3 additions & 0 deletions ci/opensuse-15.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 20221203
FROM opensuse/leap:latest
RUN zypper --non-interactive install python310 python310-pip python310-devel gcc ninja git patchelf && zypper clean --all && ln -s python3.10 /usr/bin/python3
4 changes: 2 additions & 2 deletions mesonpy/_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ def _get_macosx_platform_tag() -> str:
#
# This results in packaging versions up to 21.3 generating
# platform tags like "macosx_10_16_x86_64" and later versions
# generating "macosx_11_0_x86_64". Using latter would be more
# generating "macosx_11_0_x86_64". Using the latter would be more
# correct but prevents the resulting wheel from being installed on
# systems using packaging 21.3 or earlier (pip 22.3 or earlier).
#
# Fortunately packaging versions carrying the workaround still
# accepts "macosx_11_0_x86_64" as a compatible platform tag. We
# accepts "macosx_10_16_x86_64" as a compatible platform tag. We
# can therefore ignore the issue and generate the slightly
# incorrect tag.

Expand Down
26 changes: 19 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,25 @@


def adjust_packaging_platform_tag(platform: str) -> str:
# The packaging module generates overly specific platforms tags on
# Linux. The platforms tags on Linux evolved over time.
# meson-python uses more relaxed platform tags to maintain
# compatibility with old wheel installation tools. The relaxed
# platform tags match the ones generated by the wheel package.
# https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/
return re.sub(r'^(many|musl)linux(1|2010|2014|_\d+_\d+)_(.*)$', r'linux_\3', platform)
if platform.startswith(('manylinux', 'musllinux')):
# The packaging module generates overly specific platforms tags on
# Linux. The platforms tags on Linux evolved over time.
# meson-python uses more relaxed platform tags to maintain
# compatibility with old wheel installation tools. The relaxed
# platform tags match the ones generated by the wheel package.
# https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/
return re.sub(r'^(many|musl)linux(1|2010|2014|_\d+_\d+)_(.*)$', r'linux_\3', platform)
if platform.startswith('macosx'):
# Python built with older macOS SDK on macOS 11, reports an
# unexising macOS 10.16 version instead of the real version.
# The packaging module introduced a workaround in version
# 22.0. Too maintain compatibility with older packaging
# releases we don't implement it. Reconcile this.
from platform import mac_ver
version = tuple(map(int, mac_ver()[0].split('.')))[:2]
if version == (10, 16):
return re.sub(r'^macosx_\d+_\d+_(.*)$', r'macosx_10_16_\1', platform)
return platform


package_dir = pathlib.Path(__file__).parent / 'packages'
Expand Down