From 47256972d2a9599c8ae9724f19ce4144717183f0 Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Tue, 21 Mar 2023 09:24:40 +0100 Subject: [PATCH 1/6] hotfix the endpoint issue hotfix the endpoint issue, add the script to automatically release it and fix unit test ubuntu version (for latest 3.6 cannot be find) --- .github/workflows/pypipublish.yml | 45 +++++++++++++++++++++++++++++++ .github/workflows/unittest.yml | 2 +- Adyen/client.py | 4 +-- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pypipublish.yml diff --git a/.github/workflows/pypipublish.yml b/.github/workflows/pypipublish.yml new file mode 100644 index 00000000..72a7d0c2 --- /dev/null +++ b/.github/workflows/pypipublish.yml @@ -0,0 +1,45 @@ +name: Publish Python + +on: + release: + types: [published] + +jobs: + tests: + name: run tests + uses: ./.github/workflows/unittest.yml + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to TestPyPI + needs: [tests] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_TEST_KEY }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_KEY }} \ No newline at end of file diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index bb43ed56..a6a4c20b 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: python-version: ['3.6','3.7', '3.8'] diff --git a/Adyen/client.py b/Adyen/client.py index 43acc739..04aef751 100644 --- a/Adyen/client.py +++ b/Adyen/client.py @@ -190,11 +190,11 @@ def _determine_checkout_url(self, platform, action, path_param=None): if action == "paymentsResult": action = "payments/result" if action == "cancels": - action = "/cancels" + action = "cancels" if action == "paymentsCancelsWithReference": action = f"payments/{path_param}/cancels" if action == "paymentsCapture": - action = f"/payments/{path_param}/captures" + action = f"payments/{path_param}/captures" if action == "paymentsReversals": action = f"payments/{path_param}/reversals" if action == "paymentsRefunds": From 1b7c49d7b0b3f93f08bd45b0f8f73d0c536fa966 Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:33:01 +0100 Subject: [PATCH 2/6] Fix workflow --- .github/workflows/unittest.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index a6a4c20b..95065cef 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -1,7 +1,6 @@ name: Python package -on: - pull_request: +on: [workflow_call, pull_request] jobs: build: From 51a13c94b92abbb1df263cd9c1dcc8f986ab28e7 Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:36:11 +0100 Subject: [PATCH 3/6] add end of line --- .github/workflows/pypipublish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypipublish.yml b/.github/workflows/pypipublish.yml index 72a7d0c2..9b54ab0a 100644 --- a/.github/workflows/pypipublish.yml +++ b/.github/workflows/pypipublish.yml @@ -42,4 +42,5 @@ jobs: - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_KEY }} \ No newline at end of file + password: ${{ secrets.PYPI_KEY }} + \ No newline at end of file From 2c0c25123b9ad18a2ba90121be934232ddcd78cd Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:39:00 +0100 Subject: [PATCH 4/6] edit end of line --- .github/workflows/pypipublish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pypipublish.yml b/.github/workflows/pypipublish.yml index 9b54ab0a..0d085e09 100644 --- a/.github/workflows/pypipublish.yml +++ b/.github/workflows/pypipublish.yml @@ -43,4 +43,3 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_KEY }} - \ No newline at end of file From b8e01a0392b165443af53e0a3623f2c7cbd6f2aa Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:47:28 +0100 Subject: [PATCH 5/6] Bump the version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index aaba6251..f9556ffb 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='Adyen', packages=['Adyen'], - version='7.1.1', + version='7.1.2', maintainer='Adyen', maintainer_email='support@adyen.com', description='Adyen Python Api', From 5f21b21d4b6156861a831201e4f0f142d902a460 Mon Sep 17 00:00:00 2001 From: Antoni Stroinski <55943882+antolo-arch@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:53:35 +0100 Subject: [PATCH 6/6] Bump version in unit tests --- Adyen/settings.py | 2 +- test/CheckoutTest.py | 2 +- test/TerminalTest.py | 15 ++++++--------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Adyen/settings.py b/Adyen/settings.py index d33e829d..fbe08103 100644 --- a/Adyen/settings.py +++ b/Adyen/settings.py @@ -14,5 +14,5 @@ API_PAYMENT_VERSION = "v64" API_PAYOUT_VERSION = "v64" API_TERMINAL_VERSION = "v1" -LIB_VERSION = "7.1.1" +LIB_VERSION = "7.1.2" LIB_NAME = "adyen-python-api-library" diff --git a/test/CheckoutTest.py b/test/CheckoutTest.py index fbb1caa5..663530d3 100644 --- a/test/CheckoutTest.py +++ b/test/CheckoutTest.py @@ -97,7 +97,7 @@ def test_payments_error_mocked(self): 'returnUrl': 'https://your-company.com/...', u'applicationInfo': { u'adyenLibrary': { - u'version': '7.1.1', + u'version': '7.1.2', u'name': 'adyen-python-api-library' } }, diff --git a/test/TerminalTest.py b/test/TerminalTest.py index 3fa23695..c87d921a 100644 --- a/test/TerminalTest.py +++ b/test/TerminalTest.py @@ -1,4 +1,3 @@ -import pkg_resources import unittest import Adyen @@ -8,8 +7,6 @@ except ImportError: from .BaseTest import BaseTest -VERSION = pkg_resources.get_distribution("Adyen").version - class TestTerminal(unittest.TestCase): adyen = Adyen.Adyen(username="YourWSUser", @@ -46,7 +43,7 @@ def test_assign_terminals(self): ], "applicationInfo": { "adyenLibrary": { - "version": VERSION, + "version": '7.1.2', "name": "adyen-python-api-library" } }, @@ -91,7 +88,7 @@ def test_find_terminal(self): "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "applicationInfo": { "adyenLibrary": { - "version": VERSION, + "version": '7.1.2', "name": "adyen-python-api-library" } }, @@ -144,7 +141,7 @@ def test_get_stores_under_account(self): "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "applicationInfo": { "adyenLibrary": { - "version": VERSION, + "version": '7.1.2', "name": "adyen-python-api-library" } }, @@ -174,7 +171,7 @@ def test_get_terminal_details(self): "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "applicationInfo": { "adyenLibrary": { - "version": VERSION, + "version": '7.1.2', "name": "adyen-python-api-library" } }, @@ -231,7 +228,7 @@ def test_get_terminals_under_account(self): "merchantAccount": "YOUR_MERCHANT_ACCOUNT", "applicationInfo": { "adyenLibrary": { - "version": VERSION, + "version": '7.1.2', "name": "adyen-python-api-library" } }, @@ -274,7 +271,7 @@ def test_get_terminals_under_account_store(self): "store": "YOUR_STORE", "applicationInfo": { "adyenLibrary": { - "version": VERSION, + "version": '7.1.2', "name": "adyen-python-api-library" } },