Skip to content

Commit

Permalink
Fix type annotation syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
majiidd committed Jun 28, 2024
1 parent 72b5137 commit bc5b53c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ exclude =
venv,
.venv,
.eggs,
*.egg
*.egg
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']

steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ dmypy.json
.DS_Store

# Coverage
cover/
cover/
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ repos:
- id: fix-byte-order-marker
- id: mixed-line-ending
args: [ '--fix=lf' ]
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
Expand All @@ -35,3 +37,9 @@ repos:
hooks:
- id: flake8
additional_dependencies: [ flake8-bugbear, flake8-implicit-str-concat ]

- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
hooks:
- id: bandit
args: ["--skip", "B101,B403"]
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE README.md
include LICENSE README.md
3 changes: 2 additions & 1 deletion persiantools/digits.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
from typing import Tuple

EN_TO_FA_MAP = {
"0": "۰",
Expand Down Expand Up @@ -265,7 +266,7 @@ def _floating_number_to_word(number: float, depth: bool) -> str:
return _to_word(int(left), False)


def to_word(number: (float, int)) -> str:
def to_word(number: Tuple[float, int]) -> str:
"""
Convert a number to its Persian word representation.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_jalalidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def test_pickle(self):
file.close()

file2 = open("save.p", "rb")
j = pickle.load(file2)
j = pickle.load(file2) # nosec B301
file2.close()

self.assertEqual(j, JalaliDate(1367, 2, 14))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_jalalidatetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def test_pickle(self):
file.close()

file2 = open("save.p", "rb")
j = pickle.load(file2)
j = pickle.load(file2) # nosec B301
file2.close()

self.assertEqual(j, now)
Expand Down

0 comments on commit bc5b53c

Please sign in to comment.