From 54b105ebc8629615b58eeccee4242f87bdf5f050 Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Thu, 13 Nov 2025 13:01:26 +0100 Subject: [PATCH 1/8] Temporary disable all workflows except wheels --- .github/workflows/{linuxbrew.yml => linuxbrew.yml.off} | 0 .github/workflows/{macosx.yml => macosx.yml.off} | 0 .github/workflows/{manylinux.yml => manylinux.yml.off} | 0 .github/workflows/{sdist.yml => sdist.yml.off} | 0 .github/workflows/wheels.yml | 2 +- pyproject.toml | 10 +++++----- 6 files changed, 6 insertions(+), 6 deletions(-) rename .github/workflows/{linuxbrew.yml => linuxbrew.yml.off} (100%) rename .github/workflows/{macosx.yml => macosx.yml.off} (100%) rename .github/workflows/{manylinux.yml => manylinux.yml.off} (100%) rename .github/workflows/{sdist.yml => sdist.yml.off} (100%) diff --git a/.github/workflows/linuxbrew.yml b/.github/workflows/linuxbrew.yml.off similarity index 100% rename from .github/workflows/linuxbrew.yml rename to .github/workflows/linuxbrew.yml.off diff --git a/.github/workflows/macosx.yml b/.github/workflows/macosx.yml.off similarity index 100% rename from .github/workflows/macosx.yml rename to .github/workflows/macosx.yml.off diff --git a/.github/workflows/manylinux.yml b/.github/workflows/manylinux.yml.off similarity index 100% rename from .github/workflows/manylinux.yml rename to .github/workflows/manylinux.yml.off diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml.off similarity index 100% rename from .github/workflows/sdist.yml rename to .github/workflows/sdist.yml.off diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 1d4564a..323ef33 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -12,7 +12,7 @@ on: # │ │ │ │ │ - cron: "42 3 * * 4" push: - pull_request: + # pull_request: workflow_dispatch: concurrency: diff --git a/pyproject.toml b/pyproject.toml index 7c7b4bf..91f0079 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,11 +90,11 @@ line-ending = "lf" [tool.cibuildwheel] build = [ - "cp39-*", - "cp310-*", - "cp311-*", - "cp312-*", - "cp313-*", + # "cp39-*", + # "cp310-*", + # "cp311-*", + # "cp312-*", + # "cp313-*", "cp314-*" ] build-verbosity = 1 From 19384b3740c9bdab2cc339960918dc0bae4c11ec Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Thu, 13 Nov 2025 13:47:06 +0100 Subject: [PATCH 2/8] Cleanup and few improvements --- .github/workflows/wheels.yml | 25 +++++++++---------------- pyproject.toml | 2 -- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 323ef33..b05b5ff 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -65,29 +65,26 @@ jobs: 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 - 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 \ @@ -101,17 +98,13 @@ 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 @@ -126,7 +119,7 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v3.1.4 + uses: pypa/cibuildwheel@v3.3 with: only: ${{ matrix.only }} env: diff --git a/pyproject.toml b/pyproject.toml index 91f0079..061d8bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,8 +113,6 @@ PYXMLSEC_STATIC_DEPS = "true" [tool.cibuildwheel.linux] archs = ["x86_64", "aarch64", "riscv64"] environment-pass = [ - "PYXMLSEC_LIBXML2_VERSION", - "PYXMLSEC_LIBXSLT_VERSION", "PYXMLSEC_STATIC_DEPS", "GH_TOKEN" ] From cf20eeacc0c8324f979ea355bcc18dbce5bbdc72 Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Thu, 13 Nov 2025 14:09:13 +0100 Subject: [PATCH 3/8] Update actions to the latest available version --- .github/workflows/wheels.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b05b5ff..48047fa 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -33,12 +33,12 @@ 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" @@ -60,7 +60,7 @@ 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 @@ -74,7 +74,7 @@ jobs: outputs: include: ${{ steps.set-matrix.outputs.include }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5.0.0 - name: Install cibuildwheel # N.B. Keep cibuildwheel version pin consistent with "build_wheels" job below. run: pipx install cibuildwheel==3.3 @@ -108,24 +108,24 @@ jobs: 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.3 + 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 }} From 7b8e72521954631c250dd1bdc9c11d95a1c73199 Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Thu, 13 Nov 2025 14:11:51 +0100 Subject: [PATCH 4/8] Specify python version explicitly --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 48047fa..91978e7 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -40,7 +40,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6.0.0 with: - python-version: "3.x" + python-version: '3.14' - name: Install build dependencies run: | From 2229bfef01cccea1d6edc3cb7fee8f8d6abacacc Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Thu, 13 Nov 2025 15:05:27 +0100 Subject: [PATCH 5/8] Move setup attributes to pyproject --- .github/workflows/wheels.yml | 2 +- pyproject.toml | 54 +++++++++++++++++++++++++++++++++++- requirements-test.txt | 2 +- setup.cfg | 22 --------------- setup.py | 46 ------------------------------ 5 files changed, 55 insertions(+), 71 deletions(-) delete mode 100644 setup.cfg diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 91978e7..3513b29 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -44,7 +44,7 @@ jobs: - 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 diff --git a/pyproject.toml b/pyproject.toml index 061d8bc..ac6b0ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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==80.9.0", "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 @@ -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 @@ -88,6 +139,7 @@ skip-magic-trailing-comma = false # Enforce Unix-style line endings (LF) line-ending = "lf" +# cibuildwheel [tool.cibuildwheel] build = [ # "cp39-*", diff --git a/requirements-test.txt b/requirements-test.txt index ad135d9..70fe970 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,4 +2,4 @@ pytest==8.4.1 lxml-stubs==0.5.1 -ruff[format]==0.13.0 +ruff[format]==0.14.4 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 8762c65..0000000 --- a/setup.cfg +++ /dev/null @@ -1,22 +0,0 @@ -[metadata] -description_file = README.md - -[bdist_rpm] -release = 1 -build_requires = pkg-config xmlsec1-devel libxml2-devel xmlsec1-openssl-devel -group = Development/Libraries -requires = xmlsec1 xmlsec1-openssl - -[build_sphinx] -source-dir = doc/source -build-dir = doc/build -all_files = 1 - -# [flake8] -# per-file-ignores = -# *.pyi: E301, E302, E305, E501, E701, F401, F822 -# doc/source/conf.py: D1 -# doc/source/examples/*.py: D1, E501 -# tests/*.py: D1 -# exclude = .venv*,.git,*_pb2.pyi,build,dist,libs,.eggs,.direnv* -# max-line-length = 130 diff --git a/setup.py b/setup.py index 4100a52..9cf9d67 100644 --- a/setup.py +++ b/setup.py @@ -7,55 +7,9 @@ src_root = Path(__file__).parent / 'src' sources = [str(path.absolute()) 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']}, ) From 7901fbf1d11394133e6b260b9ec0f9c4c75e290c Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Thu, 13 Nov 2025 15:32:39 +0100 Subject: [PATCH 6/8] Use relative path --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9cf9d67..40a479c 100644 --- a/setup.py +++ b/setup.py @@ -4,8 +4,9 @@ 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) From 7fab84933191240ec17b0923eb02dc480a87f286 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 13 Nov 2025 14:33:05 +0000 Subject: [PATCH 7/8] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 40a479c..946855f 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,6 @@ from build_support.build_ext import build_ext - src_root = Path(__file__).parent / 'src' sources = [str(path.relative_to(Path(__file__).parent)) for path in src_root.rglob('*.c')] pyxmlsec = Extension('xmlsec', sources=sources) From f431eca8c8d49688131f1e769c0271fb85515bdc Mon Sep 17 00:00:00 2001 From: Amin Solhizadeh Date: Thu, 13 Nov 2025 15:56:16 +0100 Subject: [PATCH 8/8] Enable running test for macOS --- pyproject.toml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ac6b0ed..672070e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools==80.9.0", "wheel", "setuptools_scm>=8", "pkgconfig>=1.5.1", "lxml>=3.8"] +requires = ["setuptools", "wheel", "setuptools_scm>=8", "pkgconfig>=1.5.1", "lxml>=3.8"] [project] name = "xmlsec" @@ -150,6 +150,7 @@ build = [ "cp314-*" ] build-verbosity = 1 +environment = {PYXMLSEC_STATIC_DEPS="true"} build-frontend = "build" skip = [ "pp*", # Skips PyPy builds (pp38-*, pp39-*, etc.) @@ -157,10 +158,7 @@ skip = [ ] 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"] @@ -171,7 +169,6 @@ environment-pass = [ [tool.cibuildwheel.macos] archs = ["x86_64", "arm64"] -before-all = "brew install perl" [tool.cibuildwheel.windows] archs = ["AMD64"]