diff --git a/poetry.lock b/poetry.lock index 1798361..e438f80 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "astroid" @@ -6,7 +6,6 @@ version = "3.2.4" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" -groups = ["dev"] files = [ {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, @@ -21,7 +20,6 @@ version = "24.8.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, @@ -68,7 +66,6 @@ version = "2025.1.31" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" -groups = ["main"] files = [ {file = "certifi-2025.1.31-py3-none-any.whl", hash = "sha256:ca78db4565a652026a4db2bcdf68f2fb589ea80d0be70e03929ed730746b84fe"}, {file = "certifi-2025.1.31.tar.gz", hash = "sha256:3d5da6925056f6f18f119200434a4780a94263f10d1c21d032a6f6b2baa20651"}, @@ -80,7 +77,6 @@ version = "3.4.1" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." optional = false python-versions = ">=3.7" -groups = ["main"] files = [ {file = "charset_normalizer-3.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de"}, {file = "charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176"}, @@ -182,7 +178,6 @@ version = "8.1.8" description = "Composable command line interface toolkit" optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2"}, {file = "click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a"}, @@ -197,8 +192,6 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -groups = ["dev"] -markers = "platform_system == \"Windows\" or sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -210,7 +203,6 @@ version = "7.6.1" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "coverage-7.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:b06079abebbc0e89e6163b8e8f0e16270124c154dc6e4a47b413dd538859af16"}, {file = "coverage-7.6.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cf4b19715bccd7ee27b6b120e7e9dd56037b9c0681dcc1adc9ba9db3d417fa36"}, @@ -294,14 +286,13 @@ toml = ["tomli"] [[package]] name = "dill" -version = "0.3.9" +version = "0.4.0" description = "serialize all of Python" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ - {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, - {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, + {file = "dill-0.4.0-py3-none-any.whl", hash = "sha256:44f54bf6412c2c8464c14e8243eb163690a9800dbe2c367330883b19c7561049"}, + {file = "dill-0.4.0.tar.gz", hash = "sha256:0633f1d2df477324f53a895b02c901fb961bdbf65a17122586ea7019292cbcf0"}, ] [package.extras] @@ -314,8 +305,6 @@ version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" -groups = ["dev"] -markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -330,7 +319,6 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" -groups = ["main"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -345,7 +333,6 @@ version = "2.1.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760"}, {file = "iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7"}, @@ -357,7 +344,6 @@ version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" -groups = ["dev"] files = [ {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, @@ -372,7 +358,6 @@ version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" -groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -384,7 +369,6 @@ version = "1.14.1" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb"}, {file = "mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0"}, @@ -440,26 +424,24 @@ reports = ["lxml"] [[package]] name = "mypy-extensions" -version = "1.0.0" +version = "1.1.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false -python-versions = ">=3.5" -groups = ["dev"] +python-versions = ">=3.8" files = [ - {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, - {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, + {file = "mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505"}, + {file = "mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558"}, ] [[package]] name = "packaging" -version = "24.2" +version = "25.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ - {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, - {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, + {file = "packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484"}, + {file = "packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f"}, ] [[package]] @@ -468,7 +450,6 @@ version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08"}, {file = "pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712"}, @@ -480,7 +461,6 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -497,7 +477,6 @@ version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, @@ -513,7 +492,6 @@ version = "1.10.21" description = "Data validation and settings management using python type hints" optional = false python-versions = ">=3.7" -groups = ["main"] files = [ {file = "pydantic-1.10.21-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:245e486e0fec53ec2366df9cf1cba36e0bbf066af7cd9c974bbbd9ba10e1e586"}, {file = "pydantic-1.10.21-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6c54f8d4c151c1de784c5b93dfbb872067e3414619e10e21e695f7bb84d1d1fd"}, @@ -580,7 +558,6 @@ version = "3.2.7" description = "python code static checker" optional = false python-versions = ">=3.8.0" -groups = ["dev"] files = [ {file = "pylint-3.2.7-py3-none-any.whl", hash = "sha256:02f4aedeac91be69fb3b4bea997ce580a4ac68ce58b89eaefeaf06749df73f4b"}, {file = "pylint-3.2.7.tar.gz", hash = "sha256:1b7a721b575eaeaa7d39db076b6e7743c993ea44f57979127c517c6c572c803e"}, @@ -611,7 +588,6 @@ version = "8.3.5" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"}, {file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"}, @@ -634,7 +610,6 @@ version = "5.0.0" description = "Pytest plugin for measuring coverage." optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "pytest-cov-5.0.0.tar.gz", hash = "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857"}, {file = "pytest_cov-5.0.0-py3-none-any.whl", hash = "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652"}, @@ -653,7 +628,6 @@ version = "12.0" description = "pytest plugin to re-run tests to eliminate flaky failures" optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "pytest-rerunfailures-12.0.tar.gz", hash = "sha256:784f462fa87fe9bdf781d0027d856b47a4bfe6c12af108f6bd887057a917b48e"}, {file = "pytest_rerunfailures-12.0-py3-none-any.whl", hash = "sha256:9a1afd04e21b8177faf08a9bbbf44de7a0fe3fc29f8ddbe83b9684bd5f8f92a9"}, @@ -669,7 +643,6 @@ version = "1.0.1" description = "Read key-value pairs from a .env file and set them as environment variables" optional = false python-versions = ">=3.8" -groups = ["main"] files = [ {file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"}, {file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"}, @@ -684,7 +657,6 @@ version = "2.32.3" description = "Python HTTP for Humans." optional = false python-versions = ">=3.8" -groups = ["main"] files = [ {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, @@ -706,7 +678,6 @@ version = "0.4.10" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" -groups = ["dev"] files = [ {file = "ruff-0.4.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5c2c4d0859305ac5a16310eec40e4e9a9dec5dcdfbe92697acd99624e8638dac"}, {file = "ruff-0.4.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a79489607d1495685cdd911a323a35871abfb7a95d4f98fc6f85e799227ac46e"}, @@ -727,26 +698,12 @@ files = [ {file = "ruff-0.4.10.tar.gz", hash = "sha256:3aa4f2bc388a30d346c56524f7cacca85945ba124945fe489952aadb6b5cd804"}, ] -[[package]] -name = "toml" -version = "0.10.2" -description = "Python Library for Tom's Obvious, Minimal Language" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -groups = ["main"] -files = [ - {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, - {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, -] - [[package]] name = "tomli" version = "2.2.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.8" -groups = ["dev"] -markers = "python_full_version <= \"3.11.0a6\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -788,7 +745,6 @@ version = "0.13.2" description = "Style preserving TOML library" optional = false python-versions = ">=3.8" -groups = ["dev"] files = [ {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, @@ -796,14 +752,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.13.1" +version = "4.13.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" -groups = ["main", "dev"] files = [ - {file = "typing_extensions-4.13.1-py3-none-any.whl", hash = "sha256:4b6cf02909eb5495cfbc3f6e8fd49217e6cc7944e145cdda8caa3734777f9e69"}, - {file = "typing_extensions-4.13.1.tar.gz", hash = "sha256:98795af00fb9640edec5b8e31fc647597b4691f099ad75f469a2616be1a76dff"}, + {file = "typing_extensions-4.13.2-py3-none-any.whl", hash = "sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c"}, + {file = "typing_extensions-4.13.2.tar.gz", hash = "sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef"}, ] [[package]] @@ -812,7 +767,6 @@ version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.8" -groups = ["main"] files = [ {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, @@ -825,6 +779,6 @@ socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] [metadata] -lock-version = "2.1" +lock-version = "2.0" python-versions = ">=3.8,<3.14" -content-hash = "047a0d5a88820c9aa8dbc1c6dfe180ec6bcd50e555d745f83c3470efb0a8f2b0" +content-hash = "c152f4e801fe1aadcb7d20280cca687b2d0b4a39ba3ee37c1ea31fc9d58bf487" diff --git a/pyproject.toml b/pyproject.toml index 541a476..5623082 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,6 @@ homepage = "https://multisafepay.com" [tool.poetry.dependencies] python = ">=3.8,<3.14" requests = "^2.32.3" -toml = "^0.10.2" pydantic = "^1.10.0" python-dotenv = "^1.0.1" diff --git a/src/multisafepay/api/paths/orders/request/components/plugin.py b/src/multisafepay/api/paths/orders/request/components/plugin.py index 8b38ceb..fbff2c0 100644 --- a/src/multisafepay/api/paths/orders/request/components/plugin.py +++ b/src/multisafepay/api/paths/orders/request/components/plugin.py @@ -9,7 +9,6 @@ from typing import Optional from multisafepay.model.request_model import RequestModel -from multisafepay.util.version import Version class Plugin(RequestModel): @@ -18,7 +17,6 @@ class Plugin(RequestModel): Attributes ---------- - sdk_version (Optional[str]): The version of the SDK. plugin_version (Optional[str]): The version of the plugin. shop (Optional[str]): The name of the shop. shop_version (Optional[str]): The version of the shop. @@ -27,32 +25,12 @@ class Plugin(RequestModel): """ - sdk_version: Optional[str] = Version.detect_sdk_version() plugin_version: Optional[str] shop: Optional[str] shop_version: Optional[str] partner: Optional[str] shop_root_url: Optional[str] - def add_sdk_version( - self, - sdk_version: Optional[str], - ) -> "Plugin": - """ - Adds the SDK version to the Plugin object. - - Parameters - ---------- - sdk_version (Optional[str]): The version of the SDK. - - Returns - ------- - Plugin: The updated Plugin object. - - """ - self.sdk_version = sdk_version - return self - def add_plugin_version( self, plugin_version: Optional[str], diff --git a/src/multisafepay/util/version.py b/src/multisafepay/util/version.py index 9951878..8f5e218 100644 --- a/src/multisafepay/util/version.py +++ b/src/multisafepay/util/version.py @@ -6,14 +6,9 @@ # See the DISCLAIMER.md file for disclaimer details. -from pathlib import Path from typing import Optional -from multisafepay.exception.missing_plugin_version import ( - MissingPluginVersionException, -) from pydantic import BaseModel -from tomlkit import parse class Version(BaseModel): @@ -23,28 +18,10 @@ class Version(BaseModel): Attributes ---------- plugin_version (Optional[str]): The version of the plugin, default is "unknown". - sdk_version (Optional[str]): The version of the SDK, default is None. """ plugin_version: Optional[str] = "unknown" - sdk_version: Optional[str] = None - - @staticmethod - def detect_sdk_version() -> str: - """ - Detect the SDK version from the pyproject.toml file. - - Returns - ------- - str: The detected SDK version. - - """ - project_root = Path(__file__).resolve().parent.parent.parent.parent - pyproject_path = project_root / "pyproject.toml" - with open(pyproject_path) as file: - content = parse(file.read()) - return content["tool"]["poetry"]["version"] def get_plugin_version(self) -> str: """ @@ -68,28 +45,6 @@ def set_plugin_version(self, version: Optional[str]): """ self.plugin_version = version - def get_sdk_version(self) -> Optional[str]: - """ - Get the SDK version. - - Returns - ------- - Optional[str]: The SDK version. - - """ - return self.sdk_version - - def set_sdk_version(self, version: str): - """ - Set the SDK version. - - Parameters - ---------- - version (str): The version to set for the SDK. - - """ - self.sdk_version = version - def get_version(self) -> Optional[str]: """ Get the combined version information of the plugin and SDK. @@ -103,9 +58,4 @@ def get_version(self) -> Optional[str]: MissingPluginVersionException: If the plugin version is "unknown". """ - if self.plugin_version == "unknown": - raise MissingPluginVersionException("Plugin version is missing") - if self.sdk_version is None: - self.sdk_version = Version.detect_sdk_version() - - return f"Plugin {self.plugin_version}; Python-Sdk {self.sdk_version}" + return f"Plugin {self.plugin_version}" diff --git a/tests/multisafepay/unit/api/path/orders/request/components/test_unit_plugin.py b/tests/multisafepay/unit/api/path/orders/request/components/test_unit_plugin.py index a82233b..ab38e70 100644 --- a/tests/multisafepay/unit/api/path/orders/request/components/test_unit_plugin.py +++ b/tests/multisafepay/unit/api/path/orders/request/components/test_unit_plugin.py @@ -16,7 +16,6 @@ def test_initializes_plugin_correctly(): Tests that the Plugin object is initialized correctly with the given values. """ plugin = Plugin( - sdk_version="1.0.0", plugin_version="1.0.0", shop_version="1.0.0", partner="TestPartner", @@ -24,7 +23,6 @@ def test_initializes_plugin_correctly(): shop_root_url="https://example.com", ) - assert plugin.sdk_version == "1.0.0" assert plugin.plugin_version == "1.0.0" assert plugin.shop == "TestShop" assert plugin.shop_version == "1.0.0" @@ -45,17 +43,6 @@ def test_initializes_plugin_with_empty_values(): assert plugin.shop_root_url is None -def test_add_sdk_version_updates_value(): - """ - Tests that the add_sdk_version method updates the sdk_version field correctly. - """ - plugin = Plugin() - plugin_updated = plugin.add_sdk_version("1.0.0") - - assert plugin.sdk_version == "1.0.0" - assert isinstance(plugin_updated, Plugin) - - def test_add_plugin_version_updates_value(): """ Tests that the add_plugin_version method updates the plugin_version field correctly. diff --git a/tests/multisafepay/unit/util/test_unit_version.py b/tests/multisafepay/unit/util/test_unit_version.py index 6f0f86a..5945f8b 100644 --- a/tests/multisafepay/unit/util/test_unit_version.py +++ b/tests/multisafepay/unit/util/test_unit_version.py @@ -15,9 +15,8 @@ def test_version_initialization(): """ - version = Version(plugin_version="1.0.1", sdk_version="1.0.0") + version = Version(plugin_version="1.0.1") assert version.plugin_version == "1.0.1" - assert version.sdk_version == "1.0.0" def test_version_deserialization(): @@ -26,11 +25,8 @@ def test_version_deserialization(): """ - version = Version(plugin_version="1.0.1", sdk_version="1.0.0") - assert version.dict() == { - "plugin_version": "1.0.1", - "sdk_version": "1.0.0", - } + version = Version(plugin_version="1.0.1") + assert version.dict() == {"plugin_version": "1.0.1"} def test_version_serialization(): @@ -39,10 +35,8 @@ def test_version_serialization(): """ - version = Version(plugin_version="1.0.1", sdk_version="1.0.0") - assert ( - version.json() == '{"plugin_version": "1.0.1", "sdk_version": "1.0.0"}' - ) + version = Version(plugin_version="1.0.1") + assert version.json() == '{"plugin_version": "1.0.1"}' def test_empty_version_initialization(): @@ -53,7 +47,6 @@ def test_empty_version_initialization(): """ version = Version() assert version.plugin_version == "unknown" - assert version.sdk_version is None def test_empty_version_deserialization(): @@ -62,7 +55,7 @@ def test_empty_version_deserialization(): """ version = Version() - assert version.dict() == {"plugin_version": "unknown", "sdk_version": None} + assert version.dict() == {"plugin_version": "unknown"} def test_empty_version_serialization(): @@ -71,9 +64,7 @@ def test_empty_version_serialization(): """ version = Version() - assert ( - version.json() == '{"plugin_version": "unknown", "sdk_version": null}' - ) + assert version.json() == '{"plugin_version": "unknown"}' def test_version_get_plugin_version(): @@ -82,27 +73,17 @@ def test_version_get_plugin_version(): """ - version = Version(plugin_version="1.0.1", sdk_version="1.0.0") + version = Version(plugin_version="1.0.1") assert version.get_plugin_version() == "1.0.1" -def test_version_get_sdk_version(): - """ - Test the get_sdk_version method of the Version object. - - - """ - version = Version(plugin_version="1.0.1", sdk_version="1.0.0") - assert version.get_sdk_version() == "1.0.0" - - def test_version_get_version(): """ Test the get_version method of the Version object. """ - version = Version(plugin_version="1.0.1", sdk_version="1.0.0") - assert version.get_version() == "Plugin 1.0.1; Python-Sdk 1.0.0" + version = Version(plugin_version="1.0.1") + assert version.get_version() == "Plugin 1.0.1" def test_version_set_plugin_version(): @@ -114,13 +95,3 @@ def test_version_set_plugin_version(): version = Version() version.set_plugin_version("1.0.1") assert version.plugin_version == "1.0.1" - - -def test_version_set_sdk_version(): - """ - Test the set_sdk_version method of the Version object. - - """ - version = Version() - version.set_sdk_version("1.0.0") - assert version.sdk_version == "1.0.0"