Skip to content

Commit ae6857d

Browse files
dependabot[bot]Zburatorul
authored andcommitted
upload-artifact v2, download-artifact v4.1.7
some other mypy tweaks
1 parent c2c4c55 commit ae6857d

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Build
22

3+
34
on: [push, pull_request]
45

56
jobs:
@@ -15,7 +16,7 @@ jobs:
1516
- '3.9'
1617
- '3.10'
1718
node-version:
18-
- '15.x'
19+
- '18.x'
1920
runs-on: ${{ matrix.os }}
2021
steps:
2122
- uses: actions/checkout@v2
@@ -50,7 +51,7 @@ jobs:
5051
- name: Build wheel
5152
run: python setup.py bdist_wheel
5253
- name: Upload wheels as artifacts
53-
uses: actions/upload-artifact@v2
54+
uses: actions/upload-artifact@v4
5455
if: ${{ runner.os == 'Linux' && matrix.python-version == '3.9' }}
5556
with:
5657
name: python-packages
@@ -65,7 +66,7 @@ jobs:
6566
needs:
6667
- tox
6768
steps:
68-
- uses: actions/download-artifact@v2
69+
- uses: actions/download-artifact@v4.1.7
6970
with:
7071
name: python-packages
7172
path: dist

beancount_import/matching.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,8 +1489,9 @@ def get_combined_transactions(txns: Tuple[Transaction, Transaction],
14891489
for match_sets in itertools.product(*match_groups.values()):
14901490
combined_matches = sum((match_set.matches for match_set in match_sets),
14911491
[]) # type: PostingMatches
1492-
combined_removals = sum((match_set.removals
1493-
for match_set in match_sets), ())
1492+
combined_removals: MatchablePostings = tuple(removal
1493+
for match_set in match_sets
1494+
for removal in match_set.removals)
14941495
if not combined_matches:
14951496
continue
14961497
for m in combined_matches:

beancount_import/source/amazon_invoice.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
|
3030
+-> returns Order
3131
"""
32-
from typing import NamedTuple, Optional, List, Union, Iterable, Dict, Sequence, cast
32+
from typing import NamedTuple, Optional, List, Union, Iterable, Dict, Sequence, cast, Type
3333
from abc import ABC, abstractmethod
3434
import collections
3535
import re
@@ -101,12 +101,12 @@ class Locale_Data(ABC):
101101
@staticmethod
102102
@abstractmethod
103103
def parse_amount(amount, assumed_currency=None) -> Amount:
104-
raise NotImplementedError
104+
pass
105105

106106
@staticmethod
107107
@abstractmethod
108108
def parse_date(date_str) -> datetime.date:
109-
raise NotImplementedError
109+
pass
110110

111111

112112
class Locale_en_US(Locale_Data):
@@ -293,7 +293,7 @@ def parse_date(date_str) -> datetime.date:
293293
return dateutil.parser.parse(date_str, parserinfo=Locale_de_DE._parserinfo(dayfirst=True)).date()
294294

295295

296-
LOCALES = {x.LOCALE: x for x in [Locale_en_US, Locale_de_DE]}
296+
LOCALES: Dict[str, Type[Locale_Data]] = {x.LOCALE: x for x in [Locale_en_US, Locale_de_DE]}
297297

298298
Errors = List[str]
299299
Adjustment = NamedTuple('Adjustment', [

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ deps =
44
mypy
55
coverage
66
typing-extensions
7+
beautifulsoup4
8+
setuptools
79

810
commands =
9-
mypy beancount_import --install-types --non-interactive
11+
mypy beancount_import --install-types --non-interactive --disable-error-code=type-abstract
1012
coverage run -m pytest -vv

0 commit comments

Comments
 (0)