Skip to content
Draft
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
45 changes: 19 additions & 26 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
# │ │ │ │ │
- cron: "42 3 * * 4"
push:
pull_request:
# pull_request:
workflow_dispatch:

concurrency:
Expand All @@ -33,18 +33,18 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v5.0.0
with:
fetch-depth: 0

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

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

- name: Package source dist
run: python setup.py sdist
Expand All @@ -60,34 +60,31 @@ jobs:
run: pytest -v --color=yes

- name: Upload sdist
uses: actions/upload-artifact@v4.3.1
uses: actions/upload-artifact@v5.0.0
with:
name: sdist
path: dist/*.tar.gz

generate-wheels-matrix:
generate_wheels_matrix:
# Create a matrix of all architectures & versions to build.
# This enables the next step to run cibuildwheel in parallel.
# From https://iscinumpy.dev/post/cibuildwheel-2-10-0/#only-210
name: Generate wheels matrix
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
include: ${{ steps.set-matrix.outputs.include }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5.0.0
- name: Install cibuildwheel
# Nb. keep cibuildwheel version pin consistent with job below
run: pipx install cibuildwheel==3.1.4
# N.B. Keep cibuildwheel version pin consistent with "build_wheels" job below.
run: pipx install cibuildwheel==3.3
- id: set-matrix
# Once we have the windows build figured out, it can be added here
# by updating the matrix to include windows builds as well.
# See example here:
# https://github.com/lxml/lxml/blob/3ccc7d583e325ceb0ebdf8fc295bbb7fc8cd404d/.github/workflows/wheels.yml#L95C1-L106C51
run: |
MATRIX=$(
{
cibuildwheel --print-build-identifiers --platform linux \
| jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \
| jq -nRc '{"only": inputs, "os": "ubuntu-22.04"}' \
| sed -e '/aarch64/s|ubuntu-22.04|ubuntu-22.04-arm|' \
&& cibuildwheel --print-build-identifiers --platform macos \
| jq -nRc '{"only": inputs, "os": "macos-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows \
Expand All @@ -101,38 +98,34 @@ jobs:

build_wheels:
name: Build for ${{ matrix.only }}
needs: generate-wheels-matrix
needs: generate_wheels_matrix
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.generate-wheels-matrix.outputs.include) }}

env:
PYXMLSEC_LIBXML2_VERSION: 2.14.6
PYXMLSEC_LIBXSLT_VERSION: 1.1.43
include: ${{ fromJson(needs.generate_wheels_matrix.outputs.include) }}

steps:
- name: Check out the repo
uses: actions/checkout@v4
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@v3.7.0
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v3.1.4
uses: pypa/cibuildwheel@v3.3.0
with:
only: ${{ matrix.only }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/upload-artifact@v4.3.1
- uses: actions/upload-artifact@v5.0.0
with:
path: ./wheelhouse/*.whl
name: xmlsec-wheel-${{ matrix.only }}
73 changes: 60 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
[build-system]
requires = ["setuptools==80.9.0", "wheel", "setuptools_scm[toml]>=3.4", "pkgconfig>=1.5.1", "lxml==6.0.2"]
requires = ["setuptools", "wheel", "setuptools_scm>=8", "pkgconfig>=1.5.1", "lxml>=3.8"]

[project]
name = "xmlsec"
dynamic = ["version"]
description = "Python bindings for the XML Security Library"
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.9"
dependencies = ["lxml>=3.8"]
keywords = ["xmlsec"]
authors = [
{name = "Bulat Gaifullin", email = "support@mehcode.com"}
]
maintainers = [
{name = "Oleg Hoefling", email = "oleg.hoefling@gmail.com"},
{name = "Amin Solhizadeh", email = "amin.solhizadeh@gmail.com"}
]
license = "MIT"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Programming Language :: C",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Text Processing :: Markup :: XML",
"Typing :: Typed"
]

[project.urls]
Documentation = "https://xmlsec.readthedocs.io"
Source = "https://github.com/xmlsec/python-xmlsec"
Changelog = "https://github.com/xmlsec/python-xmlsec/releases"

# setuptools
[tool.setuptools]
zip-safe = false
packages = ["xmlsec"]
package-dir = {"" = "src"}

[tool.setuptools.package-data]
xmlsec = ["py.typed", "*.pyi"]

[tool.setuptools_scm]

# mypy
[tool.mypy]
files = ['src']
ignore_missing_imports = false
Expand All @@ -22,6 +72,7 @@ warn_no_return = true
no_implicit_reexport = true
show_error_codes = true

# ruff
[tool.ruff]
# Maximum line length, same as your original Black + Flake8 config
line-length = 130
Expand Down Expand Up @@ -88,40 +139,36 @@ skip-magic-trailing-comma = false
# Enforce Unix-style line endings (LF)
line-ending = "lf"

# cibuildwheel
[tool.cibuildwheel]
build = [
"cp39-*",
"cp310-*",
"cp311-*",
"cp312-*",
"cp313-*",
# "cp39-*",
# "cp310-*",
# "cp311-*",
# "cp312-*",
# "cp313-*",
"cp314-*"
]
build-verbosity = 1
environment = {PYXMLSEC_STATIC_DEPS="true"}
build-frontend = "build"
skip = [
"pp*", # Skips PyPy builds (pp38-*, pp39-*, etc.)
"*musllinux_riscv64" # maturin and ruff currently don’t support the musl + riscv64 target
]
test-command = "pytest -v --color=yes {package}/tests"
before-test = "pip install -r requirements-test.txt"
test-skip = "*-macosx_arm64"

[tool.cibuildwheel.environment]
PYXMLSEC_STATIC_DEPS = "true"
# test-skip = "*-macosx_arm64"

[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64", "riscv64"]
environment-pass = [
"PYXMLSEC_LIBXML2_VERSION",
"PYXMLSEC_LIBXSLT_VERSION",
"PYXMLSEC_STATIC_DEPS",
"GH_TOKEN"
]

[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
before-all = "brew install perl"

[tool.cibuildwheel.windows]
archs = ["AMD64"]
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

pytest==8.4.1
lxml-stubs==0.5.1
ruff[format]==0.13.0
ruff[format]==0.14.4
22 changes: 0 additions & 22 deletions setup.cfg

This file was deleted.

48 changes: 1 addition & 47 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,11 @@
from build_support.build_ext import build_ext

src_root = Path(__file__).parent / 'src'
sources = [str(path.absolute()) for path in src_root.rglob('*.c')]
sources = [str(path.relative_to(Path(__file__).parent)) for path in src_root.rglob('*.c')]
pyxmlsec = Extension('xmlsec', sources=sources)
setup_reqs = ['setuptools_scm[toml]>=3.4', 'pkgconfig>=1.5.1', 'lxml>=3.8']


with open('README.md', encoding='utf-8') as readme:
long_desc = readme.read()


setup(
name='xmlsec',
use_scm_version=True,
description='Python bindings for the XML Security Library',
long_description=long_desc,
long_description_content_type='text/markdown',
ext_modules=[pyxmlsec],
cmdclass={'build_ext': build_ext},
python_requires='>=3.9',
setup_requires=setup_reqs,
install_requires=['lxml>=3.8'],
author='Bulat Gaifullin',
author_email='support@mehcode.com',
maintainer='Oleg Hoefling',
maintainer_email='oleg.hoefling@gmail.com',
url='https://github.com/mehcode/python-xmlsec',
project_urls={
'Documentation': 'https://xmlsec.readthedocs.io',
'Source': 'https://github.com/mehcode/python-xmlsec',
'Changelog': 'https://github.com/mehcode/python-xmlsec/releases',
},
license='MIT',
keywords=['xmlsec'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: C',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Topic :: Text Processing :: Markup :: XML',
'Typing :: Typed',
],
zip_safe=False,
packages=['xmlsec'],
package_dir={'': 'src'},
package_data={'xmlsec': ['py.typed', '*.pyi']},
)
Loading