Skip to content

Commit

Permalink
Add CI for Python 3.10, manylinux2, musllinux1 and OpenSUSE Tumbleweed (
Browse files Browse the repository at this point in the history
#225)

* add CI for python 3.10

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* skip 3.6 and 3.7 builds for tumbleweed since python versions not available in repo

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* build for manylinux2_24 soabi

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* try building for musllinux1_1 soabi

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* fix wheel selection for auditwheel repair

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* use plain parametrization in constants tests instead of hypothesis

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* battle zypper

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* battle zypper

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* battle zypper

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* battle zypper

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
  • Loading branch information
hoefling committed Aug 20, 2022
1 parent 87fb5aa commit 979be38
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ environment:
python_version: 3.9.13
- python: 39-x64
python_version: 3.9.13
- python: 310
python_version: 3.10.6
- python: 310-x64
python_version: 3.10.6

install:
- ps: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python: [3.5, 3.6, 3.7, 3.8, 3.9]
python: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v3
- name: Setup Python
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
name: manylinux2010
name: manylinux
on: [push, pull_request]
jobs:
manylinux2010_x86_64:
pep513:
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2010_x86_64
strategy:
matrix:
python-abi: [cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39]
python-abi: [cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310]
image:
- manylinux2010_x86_64
- manylinux_2_24_x86_64
- musllinux_1_1_x86_64
exclude:
- image: manylinux2010_x86_64
python-abi: cp310-cp310
- image: manylinux2010_i686
python-abi: cp310-cp310
container: quay.io/pypa/${{ matrix.image }}
steps:
- uses: actions/checkout@v1
- name: Install build dependencies
Expand All @@ -23,13 +32,13 @@ jobs:
PYXMLSEC_STATIC_DEPS: true
run: |
/opt/python/${{ matrix.python-abi }}/bin/python -m build
- name: Label manylinux2010_x86_64 wheel
- name: Label manylinux wheel
run: |
ls -la dist/
auditwheel show dist/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-linux_x86_64.whl
auditwheel repair dist/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-linux_x86_64.whl
ls -l wheelhouse/
auditwheel show wheelhouse/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
ls -la wheelhouse/
auditwheel show wheelhouse/xmlsec-${{ env.PKGVER }}-${{ matrix.python-abi }}-*${{ matrix.image }}*.whl
- name: Install test dependencies
run: |
/opt/python/${{ matrix.python-abi }}/bin/pip install --upgrade -r requirements-test.txt
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/opensuse-tumbleweed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: opensuse-tumbleweed
on: [push, pull_request]
jobs:
tumbleweed:
runs-on: ubuntu-latest
container: opensuse/tumbleweed
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- name: Install build dependencies
run: |
zypper -n install -t pattern devel_basis
PKGVER_NO_DOT=$(tr -d '.' <<< ${{ matrix.python-version }})
zypper -n install git libxmlsec1-openssl1 xmlsec1-openssl-devel python${PKGVER_NO_DOT}-devel python${PKGVER_NO_DOT}-pip
python${{ matrix.python-version }} -m venv .venv
.venv/bin/python -m pip install --upgrade pip setuptools wheel
- name: Build linux_x86_64 wheel
run: |
.venv/bin/python setup.py bdist_wheel
rm -rf build/
- name: Install test dependencies
run: |
.venv/bin/python -m pip install --upgrade -r requirements-test.txt
.venv/bin/python -m pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/
- name: Run tests
run: |
.venv/bin/python -m pytest -v --color=yes
4 changes: 2 additions & 2 deletions .github/workflows/sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: "3.10"
- name: Install build dependencies
run: |
pip install --upgrade pip setuptools wheel
Expand Down
1 change: 0 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-r requirements.txt
pytest>=4.6.9
hypothesis
lxml-stubs
10 changes: 5 additions & 5 deletions tests/test_constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test constants from :mod:`xmlsec.constants` module."""

from hypothesis import given, strategies
import pytest

import xmlsec

Expand All @@ -18,25 +18,25 @@ def _constants(typename):
)


@given(transform=strategies.sampled_from(_constants('__Transform')))
@pytest.mark.parametrize('transform', _constants('__Transform'), ids=repr)
def test_transform_str(transform):
"""Test string representation of ``xmlsec.constants.__Transform``."""
assert str(transform) == '{}, {}'.format(transform.name, transform.href)


@given(transform=strategies.sampled_from(_constants('__Transform')))
@pytest.mark.parametrize('transform', _constants('__Transform'), ids=repr)
def test_transform_repr(transform):
"""Test raw string representation of ``xmlsec.constants.__Transform``."""
assert repr(transform) == '__Transform({!r}, {!r}, {})'.format(transform.name, transform.href, transform.usage)


@given(keydata=strategies.sampled_from(_constants('__KeyData')))
@pytest.mark.parametrize('keydata', _constants('__KeyData'), ids=repr)
def test_keydata_str(keydata):
"""Test string representation of ``xmlsec.constants.__KeyData``."""
assert str(keydata) == '{}, {}'.format(keydata.name, keydata.href)


@given(keydata=strategies.sampled_from(_constants('__KeyData')))
@pytest.mark.parametrize('keydata', _constants('__KeyData'), ids=repr)
def test_keydata_repr(keydata):
"""Test raw string representation of ``xmlsec.constants.__KeyData``."""
assert repr(keydata) == '__KeyData({!r}, {!r})'.format(keydata.name, keydata.href)

0 comments on commit 979be38

Please sign in to comment.