From 4cbf7613a68531a276c47304029c97703a691898 Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sun, 13 Oct 2024 08:51:55 +0200 Subject: [PATCH 1/7] fix minor formatting issues with `make format` --- src/zeep/cache.py | 1 - src/zeep/transports.py | 2 +- src/zeep/utils.py | 7 +++---- src/zeep/wsdl/__init__.py | 1 + src/zeep/wsdl/attachments.py | 1 - src/zeep/wsdl/definitions.py | 1 + src/zeep/wsdl/messages/__init__.py | 1 + src/zeep/wsdl/messages/base.py | 1 + src/zeep/wsdl/messages/http.py | 1 + src/zeep/wsdl/messages/mime.py | 1 + src/zeep/wsdl/messages/soap.py | 15 ++++++++++----- src/zeep/wsdl/parse.py | 1 + src/zeep/wsdl/utils.py | 1 + src/zeep/wsdl/wsdl.py | 6 +----- src/zeep/wsse/signature.py | 1 + src/zeep/xsd/__init__.py | 1 + src/zeep/xsd/elements/indicators.py | 3 +-- src/zeep/xsd/elements/references.py | 1 + src/zeep/xsd/types/any.py | 1 - src/zeep/xsd/types/complex.py | 3 +-- tests/conftest.py | 1 - tests/test_cache.py | 9 +++++++-- tests/test_wsdl_arrays.py | 1 - tests/test_xsd_extension.py | 4 +--- tests/test_xsd_schemas.py | 1 - 25 files changed, 36 insertions(+), 30 deletions(-) diff --git a/src/zeep/cache.py b/src/zeep/cache.py index bbc801ae4..3cc734a79 100644 --- a/src/zeep/cache.py +++ b/src/zeep/cache.py @@ -21,7 +21,6 @@ logger = logging.getLogger(__name__) - class Base: """Base class for caching backends.""" diff --git a/src/zeep/transports.py b/src/zeep/transports.py index bfaa456ce..2a1ee8bd7 100644 --- a/src/zeep/transports.py +++ b/src/zeep/transports.py @@ -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 diff --git a/src/zeep/utils.py b/src/zeep/utils.py index e08cdcd08..c011b127a 100644 --- a/src/zeep/utils.py +++ b/src/zeep/utils.py @@ -1,6 +1,6 @@ -from email.message import Message import inspect import typing +from email.message import Message from lxml import etree @@ -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() diff --git a/src/zeep/wsdl/__init__.py b/src/zeep/wsdl/__init__.py index 8b7d052c2..55351fa2e 100644 --- a/src/zeep/wsdl/__init__.py +++ b/src/zeep/wsdl/__init__.py @@ -13,6 +13,7 @@ """ + from zeep.wsdl.wsdl import Document __all__ = ["Document"] diff --git a/src/zeep/wsdl/attachments.py b/src/zeep/wsdl/attachments.py index 50d0e4949..44e09900c 100644 --- a/src/zeep/wsdl/attachments.py +++ b/src/zeep/wsdl/attachments.py @@ -5,7 +5,6 @@ """ import base64 - from functools import cached_property from requests.structures import CaseInsensitiveDict diff --git a/src/zeep/wsdl/definitions.py b/src/zeep/wsdl/definitions.py index deb33ea99..66fe3b9c4 100644 --- a/src/zeep/wsdl/definitions.py +++ b/src/zeep/wsdl/definitions.py @@ -15,6 +15,7 @@ This module defines the definitions which occur within a WSDL document, """ + import typing import warnings from collections import OrderedDict, namedtuple diff --git a/src/zeep/wsdl/messages/__init__.py b/src/zeep/wsdl/messages/__init__.py index f77f710cf..d1287dc3e 100644 --- a/src/zeep/wsdl/messages/__init__.py +++ b/src/zeep/wsdl/messages/__init__.py @@ -15,6 +15,7 @@ :parts: 1 """ + from .http import * # noqa from .mime import * # noqa from .soap import * # noqa diff --git a/src/zeep/wsdl/messages/base.py b/src/zeep/wsdl/messages/base.py index f45c365a5..1493577d9 100644 --- a/src/zeep/wsdl/messages/base.py +++ b/src/zeep/wsdl/messages/base.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~ """ + import typing from collections import namedtuple diff --git a/src/zeep/wsdl/messages/http.py b/src/zeep/wsdl/messages/http.py index 38ca00e5c..39fae02d6 100644 --- a/src/zeep/wsdl/messages/http.py +++ b/src/zeep/wsdl/messages/http.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~ """ + from zeep import xsd from zeep.wsdl.messages.base import ConcreteMessage, SerializedMessage diff --git a/src/zeep/wsdl/messages/mime.py b/src/zeep/wsdl/messages/mime.py index c37faec20..f15ebadfa 100644 --- a/src/zeep/wsdl/messages/mime.py +++ b/src/zeep/wsdl/messages/mime.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~ """ + from urllib.parse import urlencode from lxml import etree diff --git a/src/zeep/wsdl/messages/soap.py b/src/zeep/wsdl/messages/soap.py index 30e04e1b1..808325ab9 100644 --- a/src/zeep/wsdl/messages/soap.py +++ b/src/zeep/wsdl/messages/soap.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~ """ + import copy import typing from collections import OrderedDict @@ -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) @@ -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: diff --git a/src/zeep/wsdl/parse.py b/src/zeep/wsdl/parse.py index 76e976925..51ce4333e 100644 --- a/src/zeep/wsdl/parse.py +++ b/src/zeep/wsdl/parse.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~ """ + import typing from lxml import etree diff --git a/src/zeep/wsdl/utils.py b/src/zeep/wsdl/utils.py index af923db84..bbc281450 100644 --- a/src/zeep/wsdl/utils.py +++ b/src/zeep/wsdl/utils.py @@ -3,6 +3,7 @@ ~~~~~~~~~~~~~~~ """ + from urllib.parse import urlparse, urlunparse from lxml import etree diff --git a/src/zeep/wsdl/wsdl.py b/src/zeep/wsdl/wsdl.py index 8f094818e..80807d6ba 100644 --- a/src/zeep/wsdl/wsdl.py +++ b/src/zeep/wsdl/wsdl.py @@ -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 diff --git a/src/zeep/wsse/signature.py b/src/zeep/wsse/signature.py index c4aec758e..47ab7fd4e 100644 --- a/src/zeep/wsse/signature.py +++ b/src/zeep/wsse/signature.py @@ -8,6 +8,7 @@ module. """ + from lxml import etree from lxml.etree import QName diff --git a/src/zeep/xsd/__init__.py b/src/zeep/xsd/__init__.py index 45a293974..f25010460 100644 --- a/src/zeep/xsd/__init__.py +++ b/src/zeep/xsd/__init__.py @@ -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 diff --git a/src/zeep/xsd/elements/indicators.py b/src/zeep/xsd/elements/indicators.py index 0ab68a9f1..de07adc82 100644 --- a/src/zeep/xsd/elements/indicators.py +++ b/src/zeep/xsd/elements/indicators.py @@ -11,13 +11,12 @@ -> Group """ + import copy import operator from collections import OrderedDict, defaultdict, deque - from functools import cached_property as threaded_cached_property - from zeep.exceptions import UnexpectedElementError, ValidationError from zeep.xsd.const import NotSet, SkipValue from zeep.xsd.elements import Any, Element diff --git a/src/zeep/xsd/elements/references.py b/src/zeep/xsd/elements/references.py index 14a36a64b..91ea28fa6 100644 --- a/src/zeep/xsd/elements/references.py +++ b/src/zeep/xsd/elements/references.py @@ -6,6 +6,7 @@ all the elements. """ + __all__ = ["RefElement", "RefAttribute", "RefAttributeGroup", "RefGroup"] diff --git a/src/zeep/xsd/types/any.py b/src/zeep/xsd/types/any.py index 44a059eb3..ea7317380 100644 --- a/src/zeep/xsd/types/any.py +++ b/src/zeep/xsd/types/any.py @@ -1,6 +1,5 @@ import logging import typing - from functools import cached_property as threaded_cached_property from lxml import etree diff --git a/src/zeep/xsd/types/complex.py b/src/zeep/xsd/types/complex.py index 458242f64..4c69a9cde 100644 --- a/src/zeep/xsd/types/complex.py +++ b/src/zeep/xsd/types/complex.py @@ -4,9 +4,8 @@ import logging import typing from collections import OrderedDict, deque -from itertools import chain - from functools import cached_property as threaded_cached_property +from itertools import chain from lxml import etree diff --git a/tests/conftest.py b/tests/conftest.py index 0254be8e5..76e776aa4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,3 @@ - import pytest pytest.register_assert_rewrite("tests.utils") diff --git a/tests/test_cache.py b/tests/test_cache.py index 8a09c20ad..bdf3b42b6 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -2,6 +2,7 @@ import freezegun import pytest + from zeep import cache @@ -39,7 +40,9 @@ def test_has_expired(self, tmpdir): c = cache.SqliteCache(path=tmpdir.join("sqlite.cache.db").strpath) c.add("http://tests.python-zeep.org/example.wsdl", b"content") - freeze_dt = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(seconds=7200) + freeze_dt = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta( + seconds=7200 + ) with freezegun.freeze_time(freeze_dt): result = c.get("http://tests.python-zeep.org/example.wsdl") assert result is None @@ -58,7 +61,9 @@ def test_memory_cache_timeout(tmpdir): result = c.get("http://tests.python-zeep.org/example.wsdl") assert result == b"content" - freeze_dt = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(seconds=7200) + freeze_dt = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta( + seconds=7200 + ) with freezegun.freeze_time(freeze_dt): result = c.get("http://tests.python-zeep.org/example.wsdl") assert result is None diff --git a/tests/test_wsdl_arrays.py b/tests/test_wsdl_arrays.py index 1e8af4b56..47e61a129 100644 --- a/tests/test_wsdl_arrays.py +++ b/tests/test_wsdl_arrays.py @@ -1,4 +1,3 @@ - import pytest from lxml import etree diff --git a/tests/test_xsd_extension.py b/tests/test_xsd_extension.py index 6f7835ab1..def5760c4 100644 --- a/tests/test_xsd_extension.py +++ b/tests/test_xsd_extension.py @@ -436,9 +436,7 @@ def test_issue_221(): transport.bind( "https://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd", load_xml( - open("tests/wsdl_files/xmldsig-core-schema.xsd") - .read() - .encode("utf-8") + open("tests/wsdl_files/xmldsig-core-schema.xsd").read().encode("utf-8") ), ) diff --git a/tests/test_xsd_schemas.py b/tests/test_xsd_schemas.py index 28e321d7a..70f35b972 100644 --- a/tests/test_xsd_schemas.py +++ b/tests/test_xsd_schemas.py @@ -1,4 +1,3 @@ - import pytest from lxml import etree From d155d963d6d90ff6ddf17abaa2e90ef7da91580f Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sun, 13 Oct 2024 08:51:51 +0200 Subject: [PATCH 2/7] update test dependencies to latest versions --- setup.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 67fa80102..3cba6194c 100755 --- a/setup.py +++ b/setup.py @@ -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", ] From ca6f8b6dbfb3bf634a1e4e13d5bec0d896a062ce Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sun, 13 Oct 2024 07:36:23 +0200 Subject: [PATCH 3/7] Run tests only for Python 3.9 - 3.13 --- .github/workflows/python-release.yml | 12 +++++--- .github/workflows/python-test.yml | 45 ++++++++++++++++++---------- README.rst | 2 +- docs/index.rst | 2 +- setup.py | 4 +-- tox.ini | 18 +++++------ 6 files changed, 51 insertions(+), 32 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 21caa6f46..355c0de3f 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -8,15 +8,19 @@ jobs: release: runs-on: ubuntu-latest 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: diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index becd264d5..244bff9c2 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -7,13 +7,16 @@ 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 @@ -24,10 +27,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: @@ -36,25 +39,32 @@ 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 with: name: coverage-data @@ -64,20 +74,25 @@ jobs: runs-on: ubuntu-latest needs: [test] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@master with: name: coverage-data 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/codecov-action@v1.0.6 + uses: codecov/codecov-action@v4 diff --git a/README.rst b/README.rst index 1564c2bc9..b045b66dc 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/docs/index.rst b/docs/index.rst index fe2382e6e..edaac6dcb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -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 diff --git a/setup.py b/setup.py index 3cba6194c..b0aa1e496 100755 --- a/setup.py +++ b/setup.py @@ -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={ @@ -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", ], diff --git a/tox.ini b/tox.ini index 861f34892..9f44ee24f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,13 @@ [tox] -envlist = py{37,38,39,310,311}-{mac,linux,windows},pypy +envlist = py{39,310,311,312,313}-{mac,linux,windows},pypy [gh-actions] python = - 3.7: py37 - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 + 3.12: py312 + 3.13: py313 [testenv] @@ -18,11 +18,11 @@ platform = extras = test {mac,linux}: xmlsec - py{37,38,39,310,311}: async + py{39,310,311,312,313}: async deps = - py{37,38,39,310,311}: aioresponses==0.5.0 - py{37,38,39,310,311}: aiohttp==3.7.4 - py{37,38,39,310,311}: pytest-asyncio==0.11.0 + py{39,310,311,312,313}: aioresponses==0.5.0 + py{39,310,311,312,313}: aiohttp==3.7.4 + py{39,310,311,312,313}: pytest-asyncio==0.11.0 commands = coverage run --parallel -m pytest {posargs} @@ -34,7 +34,7 @@ commands = python -m pytest {posargs} [testenv:format] -basepython = python3.7 +basepython = python3.12 deps = black isort[toml] @@ -45,7 +45,7 @@ commands = [testenv:coverage-report] -basepython = python3.7 +basepython = python3.12 deps = coverage[toml] skip_install = true commands = From 89cbb00bd224673501f2b33b3f9afbd4974a2fef Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sun, 13 Oct 2024 09:13:49 +0200 Subject: [PATCH 4/7] Skip tests for xmlsec on Python 3.13 for now This seems to result in a conflict with xmlsec/libxml --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 9f44ee24f..d2e4cc6b1 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ platform = linux: linux extras = test - {mac,linux}: xmlsec + py{39,310,311,312}-{mac,linux}: xmlsec # Skip xmlsec on Python 3.13 for now py{39,310,311,312,313}: async deps = py{39,310,311,312,313}: aioresponses==0.5.0 @@ -25,7 +25,6 @@ deps = py{39,310,311,312,313}: pytest-asyncio==0.11.0 commands = coverage run --parallel -m pytest {posargs} - [testenv:pypy] extras = test From 08b6601a8cf9687c6b0ec402af5ec4ad75eb0cf2 Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sun, 13 Oct 2024 08:35:07 +0200 Subject: [PATCH 5/7] run tests on pull requets --- .github/workflows/python-test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 244bff9c2..58c7f8315 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -1,6 +1,11 @@ name: Python Tests -on: [push] +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize] jobs: @@ -95,4 +100,5 @@ jobs: run: tox -e coverage-report - name: Upload to codecov + if: github.ref == 'refs/heads/main' uses: codecov/codecov-action@v4 From 22df21281937b0b577db57e718329c8a92aff9eb Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sun, 13 Oct 2024 09:28:09 +0200 Subject: [PATCH 6/7] fix handling coverage artifacts with latest action --- .github/workflows/python-test.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 58c7f8315..37ca809c8 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -70,10 +70,12 @@ jobs: - 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 @@ -81,9 +83,10 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@master + - uses: actions/download-artifact@v4 with: - name: coverage-data + pattern: coverage-data-* + merge-multiple: true path: . - name: Set up Python 3.12 From e2ec14bcc488c385970f69f8ca4cbb085872cce1 Mon Sep 17 00:00:00 2001 From: Michael van Tellingen Date: Sun, 13 Oct 2024 09:56:24 +0200 Subject: [PATCH 7/7] use oidc to upload package to pypi --- .github/workflows/python-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 355c0de3f..6c522cba4 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -7,6 +7,9 @@ on: jobs: release: runs-on: ubuntu-latest + environment: release + permissions: + id-token: write steps: - uses: actions/checkout@v4 @@ -22,7 +25,4 @@ jobs: 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