Skip to content

Commit 149fd52

Browse files
authored
chore: simplified setup
* Avoid splitting version more times * Fixed typo in method name
1 parent 8249939 commit 149fd52

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self) -> None:
4343
self.path = self.lookup_path()
4444
self.use_pkgconfig = self.has_pkgconfig and not self.has_env
4545

46-
def check_pkconfig(self) -> bool | None:
46+
def check_pkconfig(self) -> bool:
4747
try:
4848
subprocess.check_output(["pkg-config", "--help"])
4949
return True
@@ -151,11 +151,13 @@ def get_module():
151151
config = GammuConfig()
152152
config.check_version()
153153

154+
version_parts = VERSION.split(".")
155+
154156
module = Extension(
155157
"gammu._gammu",
156158
define_macros=[
157-
("PYTHON_GAMMU_MAJOR_VERSION", VERSION.split(".", maxsplit=1)[0]),
158-
("PYTHON_GAMMU_MINOR_VERSION", VERSION.split(".")[1]),
159+
("PYTHON_GAMMU_MAJOR_VERSION", version_parts[0]),
160+
("PYTHON_GAMMU_MINOR_VERSION", version_parts[1]),
159161
],
160162
libraries=config.get_libs(),
161163
include_dirs=["include/"],

0 commit comments

Comments
 (0)