Skip to content

ctypeslib2 2.4.0 has a bug in its own version lookup #156

Open

Description

@lviollette

@trolldbois Why the change ctypeslib2 to ctypeslib22 ?

Was that a typo?

Originally posted by @lviollette in 956e0c1

Current state

Buggy output:

$ clang2py --version                                                    
versions - clang2py:Please install the latest version of this python package python-clang:21.1.7 clang:21.1.8 clang_filename:libclang-21.so.21 

On Ubuntu 22.04, with libclang-21-dev system package installed.
$ pip freeze | grep -E 'ctypeslib|clang gives clang==21.1.7 ctypeslib2==2.4.0

Proposed fix: PR: #157

On commit 9a352bd, tag v2.4.0

diff --git a/ctypeslib/__init__.py b/ctypeslib/__init__.py                   
index 7774a27..5fc09b8 100644                                                
--- a/ctypeslib/__init__.py                                                  
+++ b/ctypeslib/__init__.py                                                  
@@ -19,7 +19,7 @@ import importlib.metadata                                  
 from importlib.metadata import PackageNotFoundError                         
                                                                             
 try:                                                                        
-    __version__ = importlib.metadata.version('ctypeslib22')                 
+    __version__ = importlib.metadata.version('ctypeslib2')                  
 except PackageNotFoundError:                                                
     __version__ = 'Please install the latest version of this python package'

new output:

$ clang2py --version   
versions - clang2py:2.4.0 python-clang:21.1.7 clang:21.1.8 clang_filename:libclang-21.so.21           
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions