Skip to content

Commit

Permalink
Merge pull request #699 from chinapandaman/PPF-698
Browse files Browse the repository at this point in the history
PPF-698: fix remaining fixable pyright issues
  • Loading branch information
chinapandaman committed Jul 13, 2024
2 parents b9f3231 + 1093e58 commit 406242d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion PyPDFForm/middleware/dropdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(

super().__init__(name, value)

self.choices = None
self.choices = []

@property
def schema_definition(self) -> dict:
Expand Down
2 changes: 1 addition & 1 deletion PyPDFForm/middleware/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(
self.text_wrap_length = None
self.max_length = None
self.comb = None
self.character_paddings = None
self.character_paddings = []
self.text_lines = None
self.text_line_x_coordinates = None
self.preview = False
Expand Down
6 changes: 3 additions & 3 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"typeCheckingMode": "basic",
"reportArgumentType": "none",
"reportAttributeAccessIssue": "none",
"reportOptionalSubscript": "none",
"reportIndexIssue": "none",
"reportOperatorIssue": "none",
"reportGeneralTypeIssues": "none",
"reportOptionalMemberAccess": "none",
"reportOptionalMemberAccess": "error",
"reportPossiblyUnboundVariable": "error",
"reportUnusedImport": "error",
"reportIncompatibleMethodOverride": "error",
"reportMissingSuperCall": "error",
"reportPrivateUsage": "error",
"reportSelfClsParameterName": "error",
"reportReturnType": "error",
"reportAssignmentType": "error"
"reportAssignmentType": "error",
"reportOptionalSubscript": "error"
}
7 changes: 5 additions & 2 deletions scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
print("Bump version cannot be done on a non-issue branch.")
sys.exit(1)

v = ""
with open("PyPDFForm/__init__.py", encoding="utf8") as f:
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
version = re.search(r'__version__ = "(.*?)"', f.read())
if version:
v = v.group(1)

new_version = ".".join(
version.split(".")[:-1] + [str(int(version.split(".")[-1]) + 1)]
v.split(".")[:-1] + [str(int(v.split(".")[-1]) + 1)]
)

with open("PyPDFForm/__init__.py", encoding="utf8") as f:
Expand Down
4 changes: 3 additions & 1 deletion scripts/create_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

if __name__ == "__main__":
with open("PyPDFForm/__init__.py", encoding="utf8") as f:
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
version = re.search(r'__version__ = "(.*?)"', f.read())
if version:
version = version.group(1)

latest_version = sys.argv[1].replace("(", "").replace(")", "")
print(f"Latest deployed version: v{latest_version}.")
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import setuptools

with open("PyPDFForm/__init__.py", encoding="utf8") as f:
version = re.search(r'__version__ = "(.*?)"', f.read()).group(1)
version = re.search(r'__version__ = "(.*?)"', f.read())
if version:
version = version.group(1)

with open("README.md", mode="r", encoding="utf-8") as fh:
long_description = fh.read()
Expand Down

0 comments on commit 406242d

Please sign in to comment.