Skip to content

Commit

Permalink
upload-artifact v2, download-artifact v4.1.7
Browse files Browse the repository at this point in the history
some other mypy tweaks
  • Loading branch information
dependabot[bot] authored and Zburatorul committed Sep 17, 2024
1 parent c2c4c55 commit ae6857d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Build


on: [push, pull_request]

jobs:
Expand All @@ -15,7 +16,7 @@ jobs:
- '3.9'
- '3.10'
node-version:
- '15.x'
- '18.x'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -50,7 +51,7 @@ jobs:
- name: Build wheel
run: python setup.py bdist_wheel
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ runner.os == 'Linux' && matrix.python-version == '3.9' }}
with:
name: python-packages
Expand All @@ -65,7 +66,7 @@ jobs:
needs:
- tox
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4.1.7
with:
name: python-packages
path: dist
Expand Down
5 changes: 3 additions & 2 deletions beancount_import/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -1489,8 +1489,9 @@ def get_combined_transactions(txns: Tuple[Transaction, Transaction],
for match_sets in itertools.product(*match_groups.values()):
combined_matches = sum((match_set.matches for match_set in match_sets),
[]) # type: PostingMatches
combined_removals = sum((match_set.removals
for match_set in match_sets), ())
combined_removals: MatchablePostings = tuple(removal
for match_set in match_sets
for removal in match_set.removals)
if not combined_matches:
continue
for m in combined_matches:
Expand Down
8 changes: 4 additions & 4 deletions beancount_import/source/amazon_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
|
+-> returns Order
"""
from typing import NamedTuple, Optional, List, Union, Iterable, Dict, Sequence, cast
from typing import NamedTuple, Optional, List, Union, Iterable, Dict, Sequence, cast, Type
from abc import ABC, abstractmethod
import collections
import re
Expand Down Expand Up @@ -101,12 +101,12 @@ class Locale_Data(ABC):
@staticmethod
@abstractmethod
def parse_amount(amount, assumed_currency=None) -> Amount:
raise NotImplementedError
pass

@staticmethod
@abstractmethod
def parse_date(date_str) -> datetime.date:
raise NotImplementedError
pass


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


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

Errors = List[str]
Adjustment = NamedTuple('Adjustment', [
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ deps =
mypy
coverage
typing-extensions
beautifulsoup4
setuptools

commands =
mypy beancount_import --install-types --non-interactive
mypy beancount_import --install-types --non-interactive --disable-error-code=type-abstract
coverage run -m pytest -vv

0 comments on commit ae6857d

Please sign in to comment.