Skip to content

Commit

Permalink
MAINT: Update packages (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Jan 31, 2022
1 parent 0a4393d commit 0b2621d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pre-commit run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.1.0
hooks:
- id: check-ast
- id: check-byte-order-marker
Expand All @@ -21,30 +21,30 @@ repos:
- id: check-pip-compile
args: ['requirements/ci.in', 'requirements/lint.in']
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
rev: v0.931
hooks:
- id: mypy
args: [--ignore-missing-imports]
additional_dependencies: [lxml]
additional_dependencies: [lxml, types-simplejson, types-pytz, types-tzlocal, types-setuptools]
- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.8.0
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.1.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.11.0
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/asottile/blacken-docs
rev: v1.10.0
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==20.8b1]
4 changes: 2 additions & 2 deletions mpu/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def add_time(datetime_obj, days=0, hours=0, minutes=0, seconds=0):
datetime : datetime.datetime
"""
seconds += minutes * 60
seconds += hours * 60 ** 2
seconds += days * 24 * 60 ** 2
seconds += hours * 60**2
seconds += days * 24 * 60**2
t14 = datetime_obj + dt.timedelta(seconds=seconds) # Invalid timezone!
t14 = t14.astimezone(pytz.utc).astimezone(t14.tzinfo) # Fix the timezone
return t14
Expand Down
2 changes: 1 addition & 1 deletion mpu/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def factorize(number: int) -> List[int]:
return factors
else:
return [1]
for factor in range(3, int(math_stl.ceil(number ** 0.5)) + 1, 2):
for factor in range(3, int(math_stl.ceil(number**0.5)) + 1, 2):
if number % factor == 0:
return factors + [factor] + factorize(number // factor)
return factors + [number]
Expand Down
2 changes: 1 addition & 1 deletion mpu/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def _calculate_german_iban_checksum(
translated = translate[val]
for char in translated:
numbers.append(char)
number = sum(int(value) * 10 ** i for i, value in enumerate(numbers[::-1]))
number = sum(int(value) * 10**i for i, value in enumerate(numbers[::-1]))
checksum = 98 - (number % 97)
return str(checksum)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ def test_factorize_float(a_float):


def test_factorize_at_border():
assert mpu.math.factorize(991 ** 2) == [991, 991]
assert mpu.math.factorize(991**2) == [991, 991]


@given(an_integer=st.integers(min_value=-(10 ** 6), max_value=10 ** 6))
@given(an_integer=st.integers(min_value=-(10**6), max_value=10**6))
def test_factorize(an_integer):
if an_integer == 0:
# This is tested in `test_factorize_zero` and should throw an exception
Expand Down
2 changes: 1 addition & 1 deletion tests/test_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_money_floatingpoint_issue2():
"""The test is the reason why one should not use float for money."""
a = Money("10.00", None)
b = Money("1.2", None)
assert str((a + b - a) * 10 ** 14 - b * 10 ** 14) == "0.00"
assert str((a + b - a) * 10**14 - b * 10**14) == "0.00"


def test_currency_operations():
Expand Down

0 comments on commit 0b2621d

Please sign in to comment.