diff --git a/setup.py b/setup.py
index 45d92a4..4519314 100644
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,8 @@ PACKAGE_DESCRIPTION_SHORT = """
 Small alternative frontend for tracking packages and parcels.""".strip()
 
 def parse_version_file(text: str) -> str:
-    match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
+    text = re.sub('^#.*$', '', text)
+    match = re.match(r'^\s*__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
     if match is None:
         msg = 'Malformed _version.py file!'
         raise Exception(msg)