Skip to content
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
30 changes: 15 additions & 15 deletions .github/scripts/manylinux_build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,35 @@ case "$PY_ABI/$MANYLINUX_IMAGE" in
;;
esac

# Step: Install python build dependencies
echo "== [container] Step: Install python build dependencies =="
/opt/python/${PY_ABI}/bin/pip install --upgrade pip setuptools wheel build 'setuptools_scm>=8'

# Step: Set environment variables
echo "== [container] Step: Set environment variables =="
PKGVER=$(/opt/python/${PY_ABI}/bin/python setup.py --version)
echo "PKGVER=$PKGVER"
# Step: Install uv
echo "== [container] Step: Install uv =="
PYTHON="/opt/python/${PY_ABI}/bin/python"
"$PYTHON" -m pip install --upgrade uv
UV="/opt/python/${PY_ABI}/bin/uv"
# Use the image's interpreter, and keep root-owned files out of the mounted workspace.
export UV_PYTHON_PREFERENCE=only-system
export UV_PROJECT_ENVIRONMENT=/tmp/venv

# Step: Build linux_x86_64 wheel
echo "== [container] Step: Build linux_x86_64 wheel =="
/opt/python/${PY_ABI}/bin/python -m build
"$UV" build --python "$PYTHON"

# Step: Label manylinux wheel
echo "== [container] Step: Label manylinux wheel =="
ls -la dist/
auditwheel show dist/xmlsec-${PKGVER}-${PY_ABI}-linux_x86_64.whl
auditwheel repair dist/xmlsec-${PKGVER}-${PY_ABI}-linux_x86_64.whl
auditwheel show dist/xmlsec-*-${PY_ABI}-linux_x86_64.whl
auditwheel repair dist/xmlsec-*-${PY_ABI}-linux_x86_64.whl
ls -la wheelhouse/
auditwheel show wheelhouse/xmlsec-${PKGVER}-${PY_ABI}-*${MANYLINUX_IMAGE}*.whl
auditwheel show wheelhouse/xmlsec-*-${PY_ABI}-*${MANYLINUX_IMAGE}*.whl

# Step: Install test dependencies
echo "== [container] Step: Install test dependencies =="
/opt/python/${PY_ABI}/bin/pip install --upgrade -r requirements-test.txt
/opt/python/${PY_ABI}/bin/pip install xmlsec --only-binary=xmlsec --no-index --find-links=wheelhouse/
"$UV" sync --python "$PYTHON" --locked --no-default-groups --group test --no-install-project
"$UV" pip install --python /tmp/venv/bin/python xmlsec --only-binary xmlsec --no-index --find-links wheelhouse/

# Step: Run tests
echo "== [container] Step: Run tests =="
/opt/python/${PY_ABI}/bin/pytest -v --color=yes
/tmp/venv/bin/pytest -v --color=yes

# Step: Fix mounted workspace file ownership on host
echo "== [container] Step: Fix mounted workspace file ownership on host =="
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/cache_libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,12 @@ jobs:
key: >-
libs-${{ runner.os }}-${{ runner.arch }}-${{ env.LIBICONV_VERSION }}-${{ env.LIBXML2_VERSION }}-${{ env.LIBXSLT_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.XMLSEC1_VERSION }}-${{ env.ZLIB_VERSION }}

- uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install setuptools shim
run: python -m pip install --upgrade pip setuptools
- uses: astral-sh/setup-uv@v10.3.3

- name: Download latest libraries
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python build_libs_xmlsec.py --download-only
run: uv run --no-project --with setuptools python build_libs_xmlsec.py --download-only

- name: Check Windows library versions
if: ${{ contains(matrix.os, 'windows-') }}
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/linuxbrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,23 @@ jobs:
brew install python@${{ matrix.python }} gcc libxml2 libxmlsec1 pkg-config
echo "/home/linuxbrew/.linuxbrew/opt/python@${{ matrix.python }}/libexec/bin" >> $GITHUB_PATH

- uses: astral-sh/setup-uv@v10.3.3

# Test against Homebrew's Python (first on PATH) instead of a uv-managed one.
- name: Select Python
run: |
echo "UV_PYTHON=${{ matrix.python }}" >> $GITHUB_ENV
echo "UV_PYTHON_PREFERENCE=only-system" >> $GITHUB_ENV

- name: Build wheel
run: |
python3 -m venv build_venv
source build_venv/bin/activate
pip3 install --upgrade setuptools wheel build
export CFLAGS="-I$(brew --prefix)/include"
export LDFLAGS="-L$(brew --prefix)/lib"
python3 -m build
uv build
rm -rf build/

- name: Run tests
run: |
python3 -m venv test_venv
source test_venv/bin/activate
pip3 install --upgrade --no-binary=lxml -r requirements-test.txt
pip3 install xmlsec --only-binary=xmlsec --no-index --find-links=dist/
pytest -v --color=yes
uv sync --locked --no-default-groups --group test --no-install-project --no-binary-package lxml
uv pip install xmlsec --only-binary xmlsec --no-index --find-links dist/
uv run --no-sync pytest -v --color=yes
31 changes: 16 additions & 15 deletions .github/workflows/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
runs-on: macos-latest

env:
# Runners preinstall several Pythons. Use uv's own so every job in the matrix gets the same kind of build.
UV_PYTHON_PREFERENCE: only-managed
LIBICONV_VERSION: ${{ needs.cache_libs.outputs.LIBICONV_VERSION }}
LIBXML2_VERSION: ${{ needs.cache_libs.outputs.LIBXML2_VERSION }}
LIBXSLT_VERSION: ${{ needs.cache_libs.outputs.LIBXSLT_VERSION }}
Expand All @@ -43,14 +45,12 @@ jobs:
key: >-
libs-${{ runner.os }}-${{ runner.arch }}-${{ env.LIBICONV_VERSION }}-${{ env.LIBXML2_VERSION }}-${{ env.LIBXSLT_VERSION }}-${{ env.OPENSSL_VERSION }}-${{ env.XMLSEC1_VERSION }}-${{ env.ZLIB_VERSION }}

- uses: actions/setup-python@v4
- uses: astral-sh/setup-uv@v10.3.3
with:
python-version: ${{ matrix.python }}

- name: Install build dependencies
run: |
pip install --upgrade pip setuptools wheel build
brew install libxml2 libxmlsec1 pkg-config
run: brew install libxml2 libxmlsec1 pkg-config

- name: Build macosx_x86_64 wheel
env:
Expand All @@ -62,33 +62,34 @@ jobs:
run: |
export PKG_CONFIG_PATH="$(brew --prefix)/opt/libxml2/lib/pkgconfig"
export PYXMLSEC_LIBS_DIR="$PWD/libs"
python -m build
uv build
rm -rf build/

- name: Set environment variables
shell: bash
run: |
echo "PKGVER=$(python setup.py --version)" >> $GITHUB_ENV
echo "LLVM_PROFILE_FILE=pyxmlsec.profraw" >> $GITHUB_ENV
run: echo "LLVM_PROFILE_FILE=pyxmlsec.profraw" >> $GITHUB_ENV

# Static and non-static jobs share a uv cache and build wheels with the same filename, so uv can
# install the other job's cached wheel from dist/. --refresh-package makes it use the one just built.
- name: Install test dependencies (static only)
if: matrix.static_deps == 'static'
run: |
pip install coverage --upgrade -r requirements-test.txt
pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/

uv sync --locked --no-default-groups --group test --group coverage --no-install-project
uv pip install xmlsec --only-binary xmlsec --no-index --find-links dist/ --refresh-package xmlsec

- name: Install test dependencies (non-static only)
if: matrix.static_deps != 'static'
run: |
export PKG_CONFIG_PATH="$(brew --prefix)/opt/libxml2/lib/pkgconfig"
pip install coverage --upgrade --no-binary=lxml -r requirements-test.txt
pip install xmlsec --only-binary=xmlsec --no-index --find-links=dist/
echo "PYXMLSEC_LIBFILE=$(python -c 'import xmlsec; print(xmlsec.__file__)')" >> $GITHUB_ENV
uv sync --locked --no-default-groups --group test --group coverage --no-install-project --no-binary-package lxml
uv pip install xmlsec --only-binary xmlsec --no-index --find-links dist/ --refresh-package xmlsec
# Assign separately so that a failed import stops this step.
PYXMLSEC_LIBFILE="$(uv run --no-sync python -c 'import xmlsec; print(xmlsec.__file__)')"
echo "PYXMLSEC_LIBFILE=$PYXMLSEC_LIBFILE" >> $GITHUB_ENV

- name: Run tests
run: |
coverage run -m pytest -v --color=yes
uv run --no-sync coverage run -m pytest -v --color=yes

- name: Report coverage to codecov
if: matrix.static_deps != 'static'
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
- uses: astral-sh/setup-uv@v10.3.3
with:
python-version: ${{ matrix.python }}

- name: Install build dependencies
run: |
pip install --upgrade pip setuptools wheel 'setuptools_scm>=8'

- name: Package source dist
run: |
python setup.py sdist
run: uv build --sdist

- name: Install test dependencies
run: |
sudo apt-get update
sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl opensc softhsm2 libengine-pkcs11-openssl
pip install --upgrade -r requirements-test.txt --no-binary lxml
pip install dist/xmlsec-$(python setup.py --version).tar.gz
uv sync --locked --no-default-groups --group test --no-install-project --no-binary-package lxml
uv pip install dist/xmlsec-*.tar.gz

- name: Run tests
run: |
pytest -v --color=yes
run: uv run --no-sync pytest -v --color=yes
23 changes: 10 additions & 13 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,21 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6.0.0
with:
python-version: '3.14'

- name: Install build dependencies
run: |
pip install --upgrade pip setuptools wheel setuptools_scm>=8 pkgconfig>=1.5.1
- name: Set up uv
uses: astral-sh/setup-uv@v10.3.3

- name: Package source dist
run: python setup.py sdist
run: uv build --sdist

- name: Install test dependencies
run: |
sudo apt-get update -y -q
sudo apt-get install -y -q libxml2-dev libxslt1-dev libxmlsec1-dev libxmlsec1-openssl opensc softhsm2 libengine-pkcs11-openssl
pip install --upgrade -r requirements-test.txt --no-binary lxml
pip install dist/xmlsec-$(python setup.py --version).tar.gz
uv sync --locked --no-default-groups --group test --no-install-project --no-binary-package lxml
uv pip install dist/xmlsec-*.tar.gz

- name: Run tests
run: pytest -v --color=yes
run: uv run --no-sync pytest -v --color=yes

- name: Upload sdist
uses: actions/upload-artifact@v5.0.0
Expand All @@ -83,9 +77,12 @@ jobs:
steps:
- uses: actions/checkout@v5.0.0

- name: Set up uv
uses: astral-sh/setup-uv@v10.3.3

- name: Install cibuildwheel
# N.B. Keep cibuildwheel version pin consistent with "build_wheels" job below.
run: pipx install cibuildwheel==4.3.4
run: uv tool install cibuildwheel==4.3.4

- id: set-matrix
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Dot files
.*
!.editorconfig
!.travis*
!.appveyor*
!.git*
!.readthedocs.yaml
!.pre-commit-config.yaml
!.python-version

# Python
/dist
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14.10
15 changes: 9 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ build:
os: ubuntu-24.04
tools:
python: '3.14'
jobs:
pre_create_environment:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
create_environment:
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
install:
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --no-default-groups --group docs --no-editable

sphinx:
configuration: doc/source/conf.py

python:
install:
- method: pip
path: .
- requirements: doc/source/requirements.txt
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

Loading
Loading