Skip to content
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

update GitHub actions workflow #1432

Merged
merged 7 commits into from
Oct 13, 2024
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
20 changes: 12 additions & 8 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ on:
jobs:
release:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12

- name: Install build requirements
run: python -m pip install wheel

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
uses: pypa/gh-action-pypi-publish@release/v1
66 changes: 45 additions & 21 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
name: Python Tests

on: [push]
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]

jobs:

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12

- name: Install dependencies
run: pip install tox

- name: Validate formatting
run: tox -e format

Expand All @@ -24,10 +32,10 @@ jobs:
max-parallel: 4
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
# TODO: Remove Windows exclusion when binary wheel available for lxml
exclude:
- { platform: windows-latest, python-version: "3.11" }
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
# # TODO: Remove Windows exclusion when binary wheel available for lxml
# exclude:
# - { platform: windows-latest, python-version: "3.11" }


steps:
Expand All @@ -36,48 +44,64 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libssl-dev libxmlsec1 libxmlsec1-dev libxmlsec1-openssl libxslt1-dev pkg-config

- name: Install system dependencies
if: matrix.platform == 'macos-latest'
run: |
brew install libxmlsec1 libxslt pkgconfig
- uses: actions/checkout@v2

- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions

- name: Test with tox
run: tox
env:
PLATFORM: ${{ matrix.platform }}

- name: Prepare artifacts
run: mkdir .coverage-data && mv .coverage.* .coverage-data/
- uses: actions/upload-artifact@master

- uses: actions/upload-artifact@v4
with:
name: coverage-data
path: .coverage-data/
name: coverage-data-${{ matrix.platform }}-${{ matrix.python-version }}
path: .coverage-data/.coverage.*
include-hidden-files: true
retention-days: 1

coverage:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@master
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: coverage-data
pattern: coverage-data-*
merge-multiple: true
path: .
- name: Set up Python 3.7
uses: actions/setup-python@v2

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox

- name: Prepare Coverage report
run: tox -e coverage-report

- name: Upload to codecov
uses: codecov/[email protected]
if: github.ref == 'refs/heads/main'
uses: codecov/codecov-action@v4
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Zeep: Python SOAP client
A Python SOAP client

Highlights:
* Compatible with Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and PyPy3
* Compatible with Python 3.9, 3.10, 3.11, 3.12, 3.13 and PyPy3
* Build on top of lxml, requests and httpx
* Support for Soap 1.1, Soap 1.2 and HTTP bindings
* Support for WS-Addressing headers
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Zeep: Python SOAP client
A Python SOAP client

Highlights:
* Compatible with Python 3.7, 3.8, 3.9, 3.10, 3.11 and PyPy
* Compatible with Python 3.9, 3.10, 3.11, 3.12, 3.13 and PyPy
* Build on top of lxml and requests
* Support for Soap 1.1, Soap 1.2 and HTTP bindings
* Support for WS-Addressing headers
Expand Down
22 changes: 11 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
]

tests_require = [
"coverage[toml]==5.2.1",
"freezegun==0.3.15",
"coverage[toml]==7.6.2",
"freezegun==1.5.1",
"pretend==1.0.9",
"pytest-cov==2.8.1",
"pytest-cov==5.0.0",
"pytest-httpx",
"pytest-asyncio",
"pytest==6.2.5",
"requests_mock>=0.7.0",
"pytest==8.3.3",
"requests_mock==1.12.1",
# Linting
"isort==5.3.2",
"flake8==3.8.3",
"flake8-blind-except==0.1.1",
"flake8-debugger==3.2.1",
"isort==5.13.2",
"flake8==7.1.1",
"flake8-blind-except==0.2.1",
"flake8-debugger==4.1.2",
"flake8-imports==0.1.1",
]

Expand All @@ -57,7 +57,7 @@
project_urls={
"Source": "https://github.com/mvantellingen/python-zeep",
},
python_requires=">=3.8",
python_requires=">=3.9",
install_requires=install_requires,
tests_require=tests_require,
extras_require={
Expand All @@ -74,11 +74,11 @@
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.8",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down
1 change: 0 additions & 1 deletion src/zeep/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
logger = logging.getLogger(__name__)



class Base:
"""Base class for caching backends."""

Expand Down
2 changes: 1 addition & 1 deletion src/zeep/transports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import os
from contextlib import contextmanager, closing
from contextlib import closing, contextmanager
from urllib.parse import urlparse

import requests
Expand Down
7 changes: 3 additions & 4 deletions src/zeep/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from email.message import Message
import inspect
import typing
from email.message import Message

from lxml import etree

Expand Down Expand Up @@ -91,7 +91,6 @@ def detect_soap_env(envelope):
def get_media_type(value):
"""Parse a HTTP content-type header and return the media-type"""
msg = Message()
msg['content-type'] = value

return msg.get_content_type()
msg["content-type"] = value

return msg.get_content_type()
1 change: 1 addition & 0 deletions src/zeep/wsdl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


"""

from zeep.wsdl.wsdl import Document

__all__ = ["Document"]
1 change: 0 additions & 1 deletion src/zeep/wsdl/attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"""

import base64

from functools import cached_property

from requests.structures import CaseInsensitiveDict
Expand Down
1 change: 1 addition & 0 deletions src/zeep/wsdl/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
This module defines the definitions which occur within a WSDL document,

"""

import typing
import warnings
from collections import OrderedDict, namedtuple
Expand Down
1 change: 1 addition & 0 deletions src/zeep/wsdl/messages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:parts: 1

"""

from .http import * # noqa
from .mime import * # noqa
from .soap import * # noqa
1 change: 1 addition & 0 deletions src/zeep/wsdl/messages/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
~~~~~~~~~~~~~~~~~~~~~~~

"""

import typing
from collections import namedtuple

Expand Down
1 change: 1 addition & 0 deletions src/zeep/wsdl/messages/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
~~~~~~~~~~~~~~~~~~~~~~~

"""

from zeep import xsd
from zeep.wsdl.messages.base import ConcreteMessage, SerializedMessage

Expand Down
1 change: 1 addition & 0 deletions src/zeep/wsdl/messages/mime.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
~~~~~~~~~~~~~~~~~~~~~~~

"""

from urllib.parse import urlencode

from lxml import etree
Expand Down
15 changes: 10 additions & 5 deletions src/zeep/wsdl/messages/soap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
~~~~~~~~~~~~~~~~~~~~~~~

"""

import copy
import typing
from collections import OrderedDict
Expand Down Expand Up @@ -85,9 +86,11 @@ def serialize(self, *args, **kwargs):
# Soap11Binding._set_http_headers(). But let's keep it like this for
# now.
headers = {
"SOAPAction": '"%s"' % self.operation.soapaction
if self.operation.soapaction
else '""'
"SOAPAction": (
'"%s"' % self.operation.soapaction
if self.operation.soapaction
else '""'
)
}
return SerializedMessage(path=None, headers=headers, content=envelope)

Expand Down Expand Up @@ -116,8 +119,10 @@ def deserialize(self, envelope):
return result

result = result.body
if not hasattr(result, '__len__'): # Return body directly if len is allowed (could indicated valid primitive type).
return result
if not hasattr(
result, "__len__"
): # Return body directly if len is allowed (could indicated valid primitive type).
return result
if result is None or len(result) == 0:
return None
elif len(result) > 1:
Expand Down
1 change: 1 addition & 0 deletions src/zeep/wsdl/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
~~~~~~~~~~~~~~~

"""

import typing

from lxml import etree
Expand Down
1 change: 1 addition & 0 deletions src/zeep/wsdl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
~~~~~~~~~~~~~~~

"""

from urllib.parse import urlparse, urlunparse

from lxml import etree
Expand Down
6 changes: 1 addition & 5 deletions src/zeep/wsdl/wsdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
from lxml import etree

from zeep.exceptions import IncompleteMessage
from zeep.loader import (
absolute_location,
is_relative_path,
load_external,
)
from zeep.loader import absolute_location, is_relative_path, load_external
from zeep.settings import Settings
from zeep.utils import findall_multiple_ns
from zeep.wsdl import parse
Expand Down
1 change: 1 addition & 0 deletions src/zeep/wsse/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
module.

"""

from lxml import etree
from lxml.etree import QName

Expand Down
1 change: 1 addition & 0 deletions src/zeep/xsd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
--------

"""

from zeep.xsd.const import Nil, SkipValue
from zeep.xsd.elements import * # noqa
from zeep.xsd.schema import Schema as Schema
Expand Down
Loading
Loading