Skip to content

Commit aeca28d

Browse files
author
gabino
committed
Update Python version to 3.13, adjust dependencies
1 parent 9c10590 commit aeca28d

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2.4.0
10-
- name: Set up Python 3.8
10+
- name: Set up Python 3.13
1111
uses: actions/setup-python@v2.3.1
1212
with:
13-
python-version: 3.8
13+
python-version: 3.13
1414
- name: Install dependencies
1515
run: pip install -qU setuptools wheel twine
1616
- name: Generating distribution archives

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Set up Python
1111
uses: actions/setup-python@v5.1.0
1212
with:
13-
python-version: 3.8
13+
python-version: 3.13
1414
- name: Install dependencies
1515
run: make install-test
1616
- name: Lint
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
23+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
2424
steps:
2525
- uses: actions/checkout@v4
2626
- name: Set up Python ${{ matrix.python-version }}
@@ -39,7 +39,7 @@ jobs:
3939
- name: Setup Python
4040
uses: actions/setup-python@v5.1.0
4141
with:
42-
python-version: 3.8
42+
python-version: 3.13
4343
- name: Install dependencies
4444
run: make install-test
4545
- name: Generate coverage report

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
SHELL := bash
22
PATH := ./venv/bin:${PATH}
3-
PYTHON = python3.8
3+
PYTHON = python3.13
44
PROJECT = cuenca
55
isort = isort $(PROJECT) tests setup.py examples
6-
black = black -S -l 79 --target-version py38 $(PROJECT) tests setup.py examples
6+
black = black -S -l 79 --target-version py313 $(PROJECT) tests setup.py examples
77

88

99
all: test

cuenca/exc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from dataclasses import dataclass
2-
31
from cuenca_validations.typing import DictStrAny
42

53

@@ -19,10 +17,11 @@ class MultipleResultsFound(CuencaException):
1917
"""One result was expected but multiple were returned"""
2018

2119

22-
@dataclass
2320
class CuencaResponseException(CuencaException):
24-
json: DictStrAny
25-
status_code: int
21+
def __init__(self, json: DictStrAny, status_code: int) -> None:
22+
self.json = json
23+
self.status_code = status_code
24+
super().__init__()
2625

2726
def __str__(self) -> str:
2827
return repr(self)

cuenca/resources/transfers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ def _gen_idempotency_key(account_number: str, amount: int) -> str:
9191
idempotency_key, but this provides some level of protection against
9292
submitting duplicate transfers
9393
"""
94-
return f'{dt.datetime.utcnow().date()}:{account_number}:{amount}'
94+
return f'{dt.datetime.utcnow().date()}: {account_number}: {amount}'

examples/batch_transfers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import argparse
22
import csv
33
import logging
4-
from dataclasses import fields
54

65
from cuenca.resources.transfers import Transfer, TransferRequest
76

@@ -25,7 +24,7 @@ def main():
2524
transfer_requests = [TransferRequest(**line) for line in reader]
2625
transfers = Transfer.create_many(transfer_requests)
2726
with open(args.output, 'w') as f:
28-
fieldnames = [field.name for field in fields(Transfer)]
27+
fieldnames = list(transfers['submitted'][0].to_dict().keys())
2928
writer = csv.DictWriter(f, fieldnames)
3029
writer.writeheader()
3130
for tr in transfers['submitted']:

requirements-test.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
black==22.8.0
1+
black==24.10.0
22
flake8==5.0.4
33
freezegun==1.5.1
44
isort==5.11.5
@@ -9,5 +9,4 @@ pytest-vcr==1.0.*
99
requests-mock==1.9.*
1010
types-freezegun==1.1.7
1111
types-requests
12-
#vcrpy==6.0.2
13-
git+https://github.com/kevin1024/vcrpy.git@master
12+
vcrpy==7.0.0

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
requests==2.32.3
22
cuenca-validations==2.0.0.dev8
3-
dataclasses>=0.7;python_version<"3.7"
43
pydantic-extra-types==2.10.*

setup.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@
2121
packages=find_packages(),
2222
include_package_data=True,
2323
package_data=dict(cuenca=['py.typed']),
24-
python_requires='>=3.8',
24+
python_requires='>=3.9',
2525
install_requires=[
26-
'requests>=2.24,<28',
27-
'dataclasses>=0.7;python_version<"3.8"',
28-
'cuenca-validations>= 0.11.3,<0.12.0',
26+
'requests>=2.32.3',
27+
'cuenca-validations>=2.0.0',
28+
'pydantic-extra-types>=2.10.1',
2929
],
3030
classifiers=[
31-
'Programming Language :: Python :: 3.8',
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Programming Language :: Python :: 3.13",
3236
'License :: OSI Approved :: MIT License',
3337
'Operating System :: OS Independent',
3438
],

0 commit comments

Comments
 (0)