python-mope 0.0.6__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. python_mope-0.3.0/LICENSE +21 -0
  2. python_mope-0.3.0/PKG-INFO +114 -0
  3. python_mope-0.3.0/README.md +88 -0
  4. {python-mope-0.0.6 → python_mope-0.3.0}/mope/__init__.py +1 -1
  5. python_mope-0.3.0/mope/__version__.py +2 -0
  6. python_mope-0.3.0/mope/client.py +80 -0
  7. python_mope-0.3.0/mope/json.py +49 -0
  8. python_mope-0.3.0/mope/models/payments.py +110 -0
  9. python_mope-0.3.0/mope/resources/__init__.py +0 -0
  10. python_mope-0.3.0/mope/resources/shop.py +44 -0
  11. python_mope-0.3.0/mope/transport.py +11 -0
  12. python_mope-0.3.0/pyproject.toml +73 -0
  13. python_mope-0.3.0/python_mope.egg-info/PKG-INFO +114 -0
  14. {python-mope-0.0.6 → python_mope-0.3.0}/python_mope.egg-info/SOURCES.txt +7 -3
  15. python_mope-0.3.0/python_mope.egg-info/requires.txt +1 -0
  16. python_mope-0.3.0/tests/test_models.py +167 -0
  17. python_mope-0.3.0/tests/test_mope.py +126 -0
  18. python-mope-0.0.6/PKG-INFO +0 -74
  19. python-mope-0.0.6/README.md +0 -54
  20. python-mope-0.0.6/mope/__version__.py +0 -2
  21. python-mope-0.0.6/mope/client.py +0 -48
  22. python-mope-0.0.6/mope/compat.py +0 -6
  23. python-mope-0.0.6/mope/models/payments.py +0 -64
  24. python-mope-0.0.6/mope/resources/shop.py +0 -38
  25. python-mope-0.0.6/python_mope.egg-info/PKG-INFO +0 -74
  26. python-mope-0.0.6/python_mope.egg-info/requires.txt +0 -1
  27. python-mope-0.0.6/python_mope.egg-info/zip-safe +0 -1
  28. python-mope-0.0.6/setup.py +0 -39
  29. {python-mope-0.0.6 → python_mope-0.3.0}/mope/models/__init__.py +0 -0
  30. /python-mope-0.0.6/mope/resources/__init__.py → /python_mope-0.3.0/mope/py.typed +0 -0
  31. {python-mope-0.0.6 → python_mope-0.3.0}/python_mope.egg-info/dependency_links.txt +0 -0
  32. {python-mope-0.0.6 → python_mope-0.3.0}/python_mope.egg-info/top_level.txt +0 -0
  33. {python-mope-0.0.6 → python_mope-0.3.0}/setup.cfg +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Lemuel Boyce
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-mope
3
+ Version: 0.3.0
4
+ Summary: A client library for interacting with the Mopé Web Shop API
5
+ Author-email: Lemuel Boyce <lemuel@vokality.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/rhymiz/python-mope
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
14
+ Classifier: Programming Language :: Python :: 3.15
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Development Status :: 6 - Mature
17
+ Classifier: Environment :: Web Environment
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Topic :: Office/Business :: Financial
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: requests<3,>=2.34.2
25
+ Dynamic: license-file
26
+
27
+ ![build](https://github.com/rhymiz/python-mope/workflows/build/badge.svg)
28
+ [![downloads](https://pepy.tech/badge/python-mope)](https://pepy.tech/project/python-mope)
29
+ [![Ruff](https://img.shields.io/badge/lint%20and%20format-Ruff-D7FF64.svg)](https://docs.astral.sh/ruff/)
30
+
31
+ # Python Mopé
32
+ Client library for Mopé by Hakrinbank
33
+
34
+ ### Token acquisition and API Docs
35
+ - [API Docs](https://api.mope.sr/integration/doc)
36
+ - Instructions for [acquiring a token](https://drive.google.com/file/d/10fWqgpl2Ip9JIacl0pwzUDi_HV6WLbCi/view?usp=sharing)
37
+
38
+
39
+ ### Requirements
40
+ - Python 3.11 or newer
41
+ - Mopé API Token
42
+
43
+ ### Getting Started
44
+ First, install from PyPi by running `pip install python-mope`
45
+
46
+ Example usage:
47
+
48
+ ```python
49
+ from mope import Mope
50
+
51
+ mope = Mope(token="test_123")
52
+ mope.shop.get_payment_request(payment_id="123")
53
+ ```
54
+
55
+ ### Development
56
+
57
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then run:
58
+
59
+ ```sh
60
+ uv sync --locked
61
+ uv run --locked ruff check .
62
+ uv run --locked ruff format --check .
63
+ uv run --locked ty check
64
+ uv run --locked pytest
65
+ uv build --no-sources
66
+ ```
67
+
68
+ Development uses Python 3.15.2 from `.python-version`; uv installs it when needed.
69
+ The library supports Python 3.11+, and CI tests the built wheel on Python 3.11,
70
+ 3.12, 3.13, 3.14, and 3.15. Ruff and ty target Python 3.11 compatibility.
71
+ Run `uv run ruff format .` to format code. Commit `uv.lock` after changing
72
+ dependencies; use `uv lock --upgrade` to refresh their locked versions.
73
+
74
+ The package includes inline types and a `py.typed` marker. API responses are
75
+ validated before creating models: invalid field types raise `TypeError`, invalid
76
+ status values raise `ValueError`, and missing required fields raise `KeyError`.
77
+ Values are not coerced. Payment metadata remains a list of dictionaries with
78
+ string `key` and `value` fields, as defined by the
79
+ [Mopé API schema](https://api.mope.sr/integration/paths/GetPaymentRequest.yaml).
80
+
81
+ ### Publishing
82
+
83
+ To release, update `mope/__version__.py`, run `uv lock`, and commit the changes.
84
+ Publish a GitHub release whose tag is the package version or `v` followed by that
85
+ version. The workflow checks the tag, runs lint, formatting and type checks,
86
+ builds the source distribution and wheel, and tests the installed wheel across
87
+ all supported Python versions before uploading those same artifacts to PyPI.
88
+
89
+ ### Resources
90
+ #### shop
91
+
92
+ *Methods*
93
+
94
+ ##### `shop.create_payment_request`
95
+
96
+ | Argument | Type | Required |
97
+ | --- |--- | --- |
98
+ |amount | int | yes |
99
+ |description | string | yes |
100
+ |order_id | string | yes |
101
+ |currency | enum (USD, SRD, EUR) | yes |
102
+ |redirect_url| string | yes |
103
+
104
+
105
+ return type: `mope.models.payments.CreatePaymentResponse`
106
+
107
+ ##### `shop.get_payment_request`
108
+
109
+ | Argument | Type | Required |
110
+ |--- |--- |--- |
111
+ |payment_id | string | yes |
112
+
113
+
114
+ return type: `mope.models.payments.PaymentRequest`
@@ -0,0 +1,88 @@
1
+ ![build](https://github.com/rhymiz/python-mope/workflows/build/badge.svg)
2
+ [![downloads](https://pepy.tech/badge/python-mope)](https://pepy.tech/project/python-mope)
3
+ [![Ruff](https://img.shields.io/badge/lint%20and%20format-Ruff-D7FF64.svg)](https://docs.astral.sh/ruff/)
4
+
5
+ # Python Mopé
6
+ Client library for Mopé by Hakrinbank
7
+
8
+ ### Token acquisition and API Docs
9
+ - [API Docs](https://api.mope.sr/integration/doc)
10
+ - Instructions for [acquiring a token](https://drive.google.com/file/d/10fWqgpl2Ip9JIacl0pwzUDi_HV6WLbCi/view?usp=sharing)
11
+
12
+
13
+ ### Requirements
14
+ - Python 3.11 or newer
15
+ - Mopé API Token
16
+
17
+ ### Getting Started
18
+ First, install from PyPi by running `pip install python-mope`
19
+
20
+ Example usage:
21
+
22
+ ```python
23
+ from mope import Mope
24
+
25
+ mope = Mope(token="test_123")
26
+ mope.shop.get_payment_request(payment_id="123")
27
+ ```
28
+
29
+ ### Development
30
+
31
+ Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then run:
32
+
33
+ ```sh
34
+ uv sync --locked
35
+ uv run --locked ruff check .
36
+ uv run --locked ruff format --check .
37
+ uv run --locked ty check
38
+ uv run --locked pytest
39
+ uv build --no-sources
40
+ ```
41
+
42
+ Development uses Python 3.15.2 from `.python-version`; uv installs it when needed.
43
+ The library supports Python 3.11+, and CI tests the built wheel on Python 3.11,
44
+ 3.12, 3.13, 3.14, and 3.15. Ruff and ty target Python 3.11 compatibility.
45
+ Run `uv run ruff format .` to format code. Commit `uv.lock` after changing
46
+ dependencies; use `uv lock --upgrade` to refresh their locked versions.
47
+
48
+ The package includes inline types and a `py.typed` marker. API responses are
49
+ validated before creating models: invalid field types raise `TypeError`, invalid
50
+ status values raise `ValueError`, and missing required fields raise `KeyError`.
51
+ Values are not coerced. Payment metadata remains a list of dictionaries with
52
+ string `key` and `value` fields, as defined by the
53
+ [Mopé API schema](https://api.mope.sr/integration/paths/GetPaymentRequest.yaml).
54
+
55
+ ### Publishing
56
+
57
+ To release, update `mope/__version__.py`, run `uv lock`, and commit the changes.
58
+ Publish a GitHub release whose tag is the package version or `v` followed by that
59
+ version. The workflow checks the tag, runs lint, formatting and type checks,
60
+ builds the source distribution and wheel, and tests the installed wheel across
61
+ all supported Python versions before uploading those same artifacts to PyPI.
62
+
63
+ ### Resources
64
+ #### shop
65
+
66
+ *Methods*
67
+
68
+ ##### `shop.create_payment_request`
69
+
70
+ | Argument | Type | Required |
71
+ | --- |--- | --- |
72
+ |amount | int | yes |
73
+ |description | string | yes |
74
+ |order_id | string | yes |
75
+ |currency | enum (USD, SRD, EUR) | yes |
76
+ |redirect_url| string | yes |
77
+
78
+
79
+ return type: `mope.models.payments.CreatePaymentResponse`
80
+
81
+ ##### `shop.get_payment_request`
82
+
83
+ | Argument | Type | Required |
84
+ |--- |--- |--- |
85
+ |payment_id | string | yes |
86
+
87
+
88
+ return type: `mope.models.payments.PaymentRequest`
@@ -1,3 +1,3 @@
1
1
  from mope.client import Mope
2
2
 
3
- __all__ = ['Mope']
3
+ __all__ = ["Mope"]
@@ -0,0 +1,2 @@
1
+ __author__ = "lemuel@vokality.com"
2
+ __version__ = "0.3.0"
@@ -0,0 +1,80 @@
1
+ from collections.abc import Iterable, Mapping, Set
2
+ from typing import IO, Protocol, TypeAlias
3
+ from urllib.parse import urljoin
4
+
5
+ import requests
6
+
7
+ from mope.__version__ import __version__
8
+ from mope.json import json_value
9
+ from mope.resources.shop import ShopResource
10
+
11
+ QueryScalar: TypeAlias = str | bytes | int | float
12
+ QueryValue: TypeAlias = QueryScalar | Iterable[QueryScalar] | None
13
+
14
+
15
+ class QueryItems(Protocol):
16
+ def items(self) -> Set[tuple[QueryScalar, QueryValue]]: ...
17
+
18
+
19
+ QueryParams: TypeAlias = (
20
+ QueryItems | Iterable[tuple[QueryScalar, QueryValue]] | str | bytes
21
+ )
22
+ RequestData: TypeAlias = (
23
+ Mapping[str, object]
24
+ | list[tuple[str, object]]
25
+ | tuple[tuple[str, object], ...]
26
+ | Iterable[bytes]
27
+ | IO[str]
28
+ | IO[bytes]
29
+ | str
30
+ | bytes
31
+ )
32
+
33
+ _user_agent = f"Python Mope {__version__}"
34
+
35
+
36
+ class Client:
37
+ def __init__(self, token: str) -> None:
38
+ self._token = token
39
+ self._headers = {
40
+ "User-Agent": _user_agent,
41
+ "Content-Type": "application/json",
42
+ "Authorization": f"Bearer {token}",
43
+ }
44
+ self._base_url = "https://api.mope.sr/api"
45
+
46
+ def call_api(
47
+ self,
48
+ method: str,
49
+ endpoint: str,
50
+ params: QueryParams | None = None,
51
+ data: RequestData | None = None,
52
+ json: object = None,
53
+ ) -> requests.Response:
54
+ url = urljoin(self._base_url, endpoint)
55
+ return requests.request(
56
+ method=method,
57
+ url=url,
58
+ params=params,
59
+ data=data,
60
+ json=json_value(json, path="request"),
61
+ headers=self._headers,
62
+ )
63
+
64
+
65
+ class Mope:
66
+ def __init__(self, token: str) -> None:
67
+ self._token = token
68
+ self._headers = {
69
+ "User-Agent": _user_agent,
70
+ "Content-Type": "application/json",
71
+ "Authorization": f"Bearer {token}",
72
+ }
73
+ self.base_url = "https://api.mope.sr/api"
74
+
75
+ self._client = Client(token)
76
+
77
+ self.shop = ShopResource(self._client)
78
+
79
+ def __str__(self) -> str:
80
+ return _user_agent
@@ -0,0 +1,49 @@
1
+ """JSON types and validation at the API boundary."""
2
+
3
+ from math import isfinite
4
+ from typing import TypeAlias
5
+
6
+ JsonValue: TypeAlias = (
7
+ str | int | float | bool | None | list["JsonValue"] | dict[str, "JsonValue"]
8
+ )
9
+ JsonObject: TypeAlias = dict[str, JsonValue]
10
+
11
+
12
+ def json_value(value: object, *, path: str = "response") -> JsonValue:
13
+ if value is None or isinstance(value, (str, bool, int)):
14
+ return value
15
+ if isinstance(value, float):
16
+ if not isfinite(value):
17
+ raise ValueError(f"{path} must contain a finite JSON number")
18
+ return value
19
+ if isinstance(value, list):
20
+ return [
21
+ json_value(item, path=f"{path}[{index}]")
22
+ for index, item in enumerate(value)
23
+ ]
24
+ if isinstance(value, dict):
25
+ return json_object(value, path=path)
26
+ raise TypeError(f"{path} must be a JSON value")
27
+
28
+
29
+ def json_object(value: object, *, path: str = "response") -> JsonObject:
30
+ if not isinstance(value, dict):
31
+ raise TypeError(f"{path} must be a JSON object")
32
+ result: JsonObject = {}
33
+ for key, item in value.items():
34
+ if not isinstance(key, str):
35
+ raise TypeError(f"{path} must have string keys")
36
+ result[key] = json_value(item, path=f"{path}.{key}")
37
+ return result
38
+
39
+
40
+ def json_string(value: object, *, path: str) -> str:
41
+ if not isinstance(value, str):
42
+ raise TypeError(f"{path} must be a string")
43
+ return value
44
+
45
+
46
+ def json_integer(value: object, *, path: str) -> int:
47
+ if isinstance(value, bool) or not isinstance(value, int):
48
+ raise TypeError(f"{path} must be an integer")
49
+ return value
@@ -0,0 +1,110 @@
1
+ from abc import ABC, abstractmethod
2
+ from dataclasses import asdict, dataclass
3
+ from typing import Literal, Self, TypeAlias, TypedDict
4
+
5
+ from mope.json import JsonValue, json_integer, json_object, json_string
6
+
7
+ CurrencyCode: TypeAlias = Literal["SRD", "EUR", "USD"]
8
+ PaymentStatus: TypeAlias = Literal["open", "scanned", "unconfirmed", "paid"]
9
+
10
+
11
+ class PaymentMetadata(TypedDict):
12
+ key: str
13
+ value: str
14
+
15
+
16
+ def _payment_status(value: object) -> PaymentStatus:
17
+ match value:
18
+ case "open":
19
+ return "open"
20
+ case "scanned":
21
+ return "scanned"
22
+ case "unconfirmed":
23
+ return "unconfirmed"
24
+ case "paid":
25
+ return "paid"
26
+ case _:
27
+ raise ValueError("status must be open, scanned, unconfirmed, or paid")
28
+
29
+
30
+ def _payment_metadata(value: object) -> list[PaymentMetadata]:
31
+ if not isinstance(value, list):
32
+ raise TypeError("meta_data must be an array")
33
+ result: list[PaymentMetadata] = []
34
+ for index, entry in enumerate(value):
35
+ path = f"meta_data[{index}]"
36
+ item = json_object(entry, path=path)
37
+ result.append(
38
+ PaymentMetadata(
39
+ key=json_string(item["key"], path=f"{path}.key"),
40
+ value=json_string(item["value"], path=f"{path}.value"),
41
+ )
42
+ )
43
+ return result
44
+
45
+
46
+ @dataclass
47
+ class BaseModel(ABC):
48
+ @classmethod
49
+ @abstractmethod
50
+ def from_json(cls, data: object) -> Self:
51
+ pass
52
+
53
+ def as_dict(self) -> dict[str, JsonValue]:
54
+ return json_object(asdict(self))
55
+
56
+
57
+ @dataclass
58
+ class CreatePaymentResponse(BaseModel):
59
+ id: str
60
+ url: str
61
+
62
+ @classmethod
63
+ def from_json(cls, data: object) -> Self:
64
+ payload = json_object(data)
65
+ return cls(
66
+ id=json_string(payload["id"], path="id"),
67
+ url=json_string(payload["url"], path="url"),
68
+ )
69
+
70
+
71
+ @dataclass
72
+ class Currency(BaseModel):
73
+ name: str
74
+ code: str
75
+ symbol: str
76
+
77
+ @classmethod
78
+ def from_json(cls, data: object) -> Self:
79
+ payload = json_object(data, path="currency")
80
+ return cls(
81
+ name=json_string(payload["name"], path="currency.name"),
82
+ code=json_string(payload["code"], path="currency.code"),
83
+ symbol=json_string(payload["symbol"], path="currency.symbol"),
84
+ )
85
+
86
+
87
+ @dataclass
88
+ class PaymentRequest(BaseModel):
89
+ id: str
90
+ amount: int
91
+ created_at: str
92
+ description: str
93
+ expires_at: str
94
+ currency: Currency
95
+ status: PaymentStatus
96
+ meta_data: list[PaymentMetadata]
97
+
98
+ @classmethod
99
+ def from_json(cls, data: object) -> Self:
100
+ payload = json_object(data)
101
+ return cls(
102
+ id=json_string(payload["id"], path="id"),
103
+ amount=json_integer(payload["amount"], path="amount"),
104
+ created_at=json_string(payload["created_at"], path="created_at"),
105
+ description=json_string(payload["description"], path="description"),
106
+ expires_at=json_string(payload["expires_at"], path="expires_at"),
107
+ currency=Currency.from_json(payload["currency"]),
108
+ status=_payment_status(payload["status"]),
109
+ meta_data=_payment_metadata(payload["meta_data"]),
110
+ )
File without changes
@@ -0,0 +1,44 @@
1
+ from mope.models.payments import CreatePaymentResponse, CurrencyCode, PaymentRequest
2
+ from mope.transport import ApiTransport
3
+
4
+
5
+ class ShopResource:
6
+ def __init__(self, client: ApiTransport) -> None:
7
+ self._client = client
8
+
9
+ def create_payment_request(
10
+ self,
11
+ amount: int,
12
+ description: str,
13
+ order_id: str,
14
+ currency: CurrencyCode,
15
+ redirect_url: str,
16
+ ) -> CreatePaymentResponse:
17
+ """
18
+ makes a payment request
19
+ """
20
+
21
+ endpoint = "shop/payment_request"
22
+ response = self._client.call_api(
23
+ "POST",
24
+ endpoint=endpoint,
25
+ json={
26
+ "amount": amount,
27
+ "order_id": order_id,
28
+ "currency": currency,
29
+ "description": description,
30
+ "redirect_url": redirect_url,
31
+ },
32
+ )
33
+ response.raise_for_status()
34
+ return CreatePaymentResponse.from_json(response.json())
35
+
36
+ def get_payment_request(self, payment_id: str) -> PaymentRequest:
37
+ """
38
+ fetches a payment request given a payment ID
39
+ """
40
+
41
+ endpoint = f"shop/payment_request/{payment_id}"
42
+ response = self._client.call_api("GET", endpoint=endpoint)
43
+ response.raise_for_status()
44
+ return PaymentRequest.from_json(response.json())
@@ -0,0 +1,11 @@
1
+ from typing import Protocol
2
+
3
+ from requests import Response
4
+
5
+
6
+ class ApiTransport(Protocol):
7
+ """The HTTP operations required by API resources."""
8
+
9
+ def call_api(
10
+ self, method: str, endpoint: str, *, json: object = None
11
+ ) -> Response: ...
@@ -0,0 +1,73 @@
1
+ [build-system]
2
+ requires = ["setuptools==84.2.1"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "python-mope"
7
+ dynamic = ["version"]
8
+ description = "A client library for interacting with the Mopé Web Shop API"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Lemuel Boyce", email = "lemuel@vokality.com" }]
14
+ dependencies = ["requests>=2.34.2,<3"]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ "Programming Language :: Python :: 3.15",
23
+ "Operating System :: OS Independent",
24
+ "Development Status :: 6 - Mature",
25
+ "Environment :: Web Environment",
26
+ "Intended Audience :: Developers",
27
+ "Topic :: Office/Business :: Financial",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ ]
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/rhymiz/python-mope"
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ "pytest>=9.2.0",
37
+ "ruff>=0.17.5",
38
+ "ty>=0.0.104",
39
+ "types-requests>=2.33.0.20261030",
40
+ ]
41
+
42
+ [tool.setuptools.dynamic]
43
+ version = { attr = "mope.__version__.__version__" }
44
+
45
+ [tool.setuptools.packages.find]
46
+ include = ["mope*"]
47
+
48
+ [tool.setuptools.package-data]
49
+ mope = ["py.typed"]
50
+
51
+ [tool.uv]
52
+ cache-keys = [{ file = "pyproject.toml" }, { file = "mope/__version__.py" }]
53
+
54
+ [tool.ruff]
55
+ target-version = "py311"
56
+
57
+ [tool.ruff.lint]
58
+ select = ["E4", "E7", "E9", "F", "I", "UP", "ANN"]
59
+
60
+ [tool.ty.environment]
61
+ python-version = "3.11"
62
+
63
+ [tool.ty.analysis]
64
+ strict-generic-narrowing = true
65
+
66
+ [tool.ty.rules]
67
+ missing-type-argument = "error"
68
+ unsound-assignment = "error"
69
+ unsound-return = "error"
70
+
71
+ [tool.pytest.ini_options]
72
+ testpaths = ["tests"]
73
+ addopts = "--import-mode=importlib"