Skip to content

Commit

Permalink
Update Python version to 3.13, adjust dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gabino committed Dec 31, 2024
1 parent 9c10590 commit aeca28d
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python 3.8
- name: Set up Python 3.13
uses: actions/[email protected]
with:
python-version: 3.8
python-version: 3.13
- name: Install dependencies
run: pip install -qU setuptools wheel twine
- name: Generating distribution archives
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.8
python-version: 3.13
- name: Install dependencies
run: make install-test
- name: Lint
Expand All @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -39,7 +39,7 @@ jobs:
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.8
python-version: 3.13
- name: Install dependencies
run: make install-test
- name: Generate coverage report
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
SHELL := bash
PATH := ./venv/bin:${PATH}
PYTHON = python3.8
PYTHON = python3.13
PROJECT = cuenca
isort = isort $(PROJECT) tests setup.py examples
black = black -S -l 79 --target-version py38 $(PROJECT) tests setup.py examples
black = black -S -l 79 --target-version py313 $(PROJECT) tests setup.py examples


all: test
Expand Down
9 changes: 4 additions & 5 deletions cuenca/exc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from dataclasses import dataclass

from cuenca_validations.typing import DictStrAny


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


@dataclass
class CuencaResponseException(CuencaException):
json: DictStrAny
status_code: int
def __init__(self, json: DictStrAny, status_code: int) -> None:
self.json = json
self.status_code = status_code
super().__init__()

def __str__(self) -> str:
return repr(self)
2 changes: 1 addition & 1 deletion cuenca/resources/transfers.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def _gen_idempotency_key(account_number: str, amount: int) -> str:
idempotency_key, but this provides some level of protection against
submitting duplicate transfers
"""
return f'{dt.datetime.utcnow().date()}:{account_number}:{amount}'
return f'{dt.datetime.utcnow().date()}: {account_number}: {amount}'
3 changes: 1 addition & 2 deletions examples/batch_transfers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse
import csv
import logging
from dataclasses import fields

from cuenca.resources.transfers import Transfer, TransferRequest

Expand All @@ -25,7 +24,7 @@ def main():
transfer_requests = [TransferRequest(**line) for line in reader]
transfers = Transfer.create_many(transfer_requests)
with open(args.output, 'w') as f:
fieldnames = [field.name for field in fields(Transfer)]
fieldnames = list(transfers['submitted'][0].to_dict().keys())
writer = csv.DictWriter(f, fieldnames)
writer.writeheader()
for tr in transfers['submitted']:
Expand Down
5 changes: 2 additions & 3 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==22.8.0
black==24.10.0
flake8==5.0.4
freezegun==1.5.1
isort==5.11.5
Expand All @@ -9,5 +9,4 @@ pytest-vcr==1.0.*
requests-mock==1.9.*
types-freezegun==1.1.7
types-requests
#vcrpy==6.0.2
git+https://github.com/kevin1024/vcrpy.git@master
vcrpy==7.0.0
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
requests==2.32.3
cuenca-validations==2.0.0.dev8
dataclasses>=0.7;python_version<"3.7"
pydantic-extra-types==2.10.*
14 changes: 9 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@
packages=find_packages(),
include_package_data=True,
package_data=dict(cuenca=['py.typed']),
python_requires='>=3.8',
python_requires='>=3.9',
install_requires=[
'requests>=2.24,<28',
'dataclasses>=0.7;python_version<"3.8"',
'cuenca-validations>= 0.11.3,<0.12.0',
'requests>=2.32.3',
'cuenca-validations>=2.0.0',
'pydantic-extra-types>=2.10.1',
],
classifiers=[
'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",
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
Expand Down

0 comments on commit aeca28d

Please sign in to comment.